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.
 
 
 

49995 rivejä
1.6 MiB

  1. // Package dfareporting provides access to the DCM/DFA Reporting And Trafficking API.
  2. //
  3. // See https://developers.google.com/doubleclick-advertisers/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/dfareporting/v3.0"
  8. // ...
  9. // dfareportingService, err := dfareporting.New(oauthHttpClient)
  10. package dfareporting // import "google.golang.org/api/dfareporting/v3.0"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "dfareporting:v3.0"
  41. const apiName = "dfareporting"
  42. const apiVersion = "v3.0"
  43. const basePath = "https://www.googleapis.com/dfareporting/v3.0/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // Manage DoubleClick Digital Marketing conversions
  47. DdmconversionsScope = "https://www.googleapis.com/auth/ddmconversions"
  48. // View and manage DoubleClick for Advertisers reports
  49. DfareportingScope = "https://www.googleapis.com/auth/dfareporting"
  50. // View and manage your DoubleClick Campaign Manager's (DCM) display ad
  51. // campaigns
  52. DfatraffickingScope = "https://www.googleapis.com/auth/dfatrafficking"
  53. )
  54. func New(client *http.Client) (*Service, error) {
  55. if client == nil {
  56. return nil, errors.New("client is nil")
  57. }
  58. s := &Service{client: client, BasePath: basePath}
  59. s.AccountActiveAdSummaries = NewAccountActiveAdSummariesService(s)
  60. s.AccountPermissionGroups = NewAccountPermissionGroupsService(s)
  61. s.AccountPermissions = NewAccountPermissionsService(s)
  62. s.AccountUserProfiles = NewAccountUserProfilesService(s)
  63. s.Accounts = NewAccountsService(s)
  64. s.Ads = NewAdsService(s)
  65. s.AdvertiserGroups = NewAdvertiserGroupsService(s)
  66. s.AdvertiserLandingPages = NewAdvertiserLandingPagesService(s)
  67. s.Advertisers = NewAdvertisersService(s)
  68. s.Browsers = NewBrowsersService(s)
  69. s.CampaignCreativeAssociations = NewCampaignCreativeAssociationsService(s)
  70. s.Campaigns = NewCampaignsService(s)
  71. s.ChangeLogs = NewChangeLogsService(s)
  72. s.Cities = NewCitiesService(s)
  73. s.ConnectionTypes = NewConnectionTypesService(s)
  74. s.ContentCategories = NewContentCategoriesService(s)
  75. s.Conversions = NewConversionsService(s)
  76. s.Countries = NewCountriesService(s)
  77. s.CreativeAssets = NewCreativeAssetsService(s)
  78. s.CreativeFieldValues = NewCreativeFieldValuesService(s)
  79. s.CreativeFields = NewCreativeFieldsService(s)
  80. s.CreativeGroups = NewCreativeGroupsService(s)
  81. s.Creatives = NewCreativesService(s)
  82. s.DimensionValues = NewDimensionValuesService(s)
  83. s.DirectorySiteContacts = NewDirectorySiteContactsService(s)
  84. s.DirectorySites = NewDirectorySitesService(s)
  85. s.DynamicTargetingKeys = NewDynamicTargetingKeysService(s)
  86. s.EventTags = NewEventTagsService(s)
  87. s.Files = NewFilesService(s)
  88. s.FloodlightActivities = NewFloodlightActivitiesService(s)
  89. s.FloodlightActivityGroups = NewFloodlightActivityGroupsService(s)
  90. s.FloodlightConfigurations = NewFloodlightConfigurationsService(s)
  91. s.InventoryItems = NewInventoryItemsService(s)
  92. s.Languages = NewLanguagesService(s)
  93. s.Metros = NewMetrosService(s)
  94. s.MobileCarriers = NewMobileCarriersService(s)
  95. s.OperatingSystemVersions = NewOperatingSystemVersionsService(s)
  96. s.OperatingSystems = NewOperatingSystemsService(s)
  97. s.OrderDocuments = NewOrderDocumentsService(s)
  98. s.Orders = NewOrdersService(s)
  99. s.PlacementGroups = NewPlacementGroupsService(s)
  100. s.PlacementStrategies = NewPlacementStrategiesService(s)
  101. s.Placements = NewPlacementsService(s)
  102. s.PlatformTypes = NewPlatformTypesService(s)
  103. s.PostalCodes = NewPostalCodesService(s)
  104. s.Projects = NewProjectsService(s)
  105. s.Regions = NewRegionsService(s)
  106. s.RemarketingListShares = NewRemarketingListSharesService(s)
  107. s.RemarketingLists = NewRemarketingListsService(s)
  108. s.Reports = NewReportsService(s)
  109. s.Sites = NewSitesService(s)
  110. s.Sizes = NewSizesService(s)
  111. s.Subaccounts = NewSubaccountsService(s)
  112. s.TargetableRemarketingLists = NewTargetableRemarketingListsService(s)
  113. s.TargetingTemplates = NewTargetingTemplatesService(s)
  114. s.UserProfiles = NewUserProfilesService(s)
  115. s.UserRolePermissionGroups = NewUserRolePermissionGroupsService(s)
  116. s.UserRolePermissions = NewUserRolePermissionsService(s)
  117. s.UserRoles = NewUserRolesService(s)
  118. s.VideoFormats = NewVideoFormatsService(s)
  119. return s, nil
  120. }
  121. type Service struct {
  122. client *http.Client
  123. BasePath string // API endpoint base URL
  124. UserAgent string // optional additional User-Agent fragment
  125. AccountActiveAdSummaries *AccountActiveAdSummariesService
  126. AccountPermissionGroups *AccountPermissionGroupsService
  127. AccountPermissions *AccountPermissionsService
  128. AccountUserProfiles *AccountUserProfilesService
  129. Accounts *AccountsService
  130. Ads *AdsService
  131. AdvertiserGroups *AdvertiserGroupsService
  132. AdvertiserLandingPages *AdvertiserLandingPagesService
  133. Advertisers *AdvertisersService
  134. Browsers *BrowsersService
  135. CampaignCreativeAssociations *CampaignCreativeAssociationsService
  136. Campaigns *CampaignsService
  137. ChangeLogs *ChangeLogsService
  138. Cities *CitiesService
  139. ConnectionTypes *ConnectionTypesService
  140. ContentCategories *ContentCategoriesService
  141. Conversions *ConversionsService
  142. Countries *CountriesService
  143. CreativeAssets *CreativeAssetsService
  144. CreativeFieldValues *CreativeFieldValuesService
  145. CreativeFields *CreativeFieldsService
  146. CreativeGroups *CreativeGroupsService
  147. Creatives *CreativesService
  148. DimensionValues *DimensionValuesService
  149. DirectorySiteContacts *DirectorySiteContactsService
  150. DirectorySites *DirectorySitesService
  151. DynamicTargetingKeys *DynamicTargetingKeysService
  152. EventTags *EventTagsService
  153. Files *FilesService
  154. FloodlightActivities *FloodlightActivitiesService
  155. FloodlightActivityGroups *FloodlightActivityGroupsService
  156. FloodlightConfigurations *FloodlightConfigurationsService
  157. InventoryItems *InventoryItemsService
  158. Languages *LanguagesService
  159. Metros *MetrosService
  160. MobileCarriers *MobileCarriersService
  161. OperatingSystemVersions *OperatingSystemVersionsService
  162. OperatingSystems *OperatingSystemsService
  163. OrderDocuments *OrderDocumentsService
  164. Orders *OrdersService
  165. PlacementGroups *PlacementGroupsService
  166. PlacementStrategies *PlacementStrategiesService
  167. Placements *PlacementsService
  168. PlatformTypes *PlatformTypesService
  169. PostalCodes *PostalCodesService
  170. Projects *ProjectsService
  171. Regions *RegionsService
  172. RemarketingListShares *RemarketingListSharesService
  173. RemarketingLists *RemarketingListsService
  174. Reports *ReportsService
  175. Sites *SitesService
  176. Sizes *SizesService
  177. Subaccounts *SubaccountsService
  178. TargetableRemarketingLists *TargetableRemarketingListsService
  179. TargetingTemplates *TargetingTemplatesService
  180. UserProfiles *UserProfilesService
  181. UserRolePermissionGroups *UserRolePermissionGroupsService
  182. UserRolePermissions *UserRolePermissionsService
  183. UserRoles *UserRolesService
  184. VideoFormats *VideoFormatsService
  185. }
  186. func (s *Service) userAgent() string {
  187. if s.UserAgent == "" {
  188. return googleapi.UserAgent
  189. }
  190. return googleapi.UserAgent + " " + s.UserAgent
  191. }
  192. func NewAccountActiveAdSummariesService(s *Service) *AccountActiveAdSummariesService {
  193. rs := &AccountActiveAdSummariesService{s: s}
  194. return rs
  195. }
  196. type AccountActiveAdSummariesService struct {
  197. s *Service
  198. }
  199. func NewAccountPermissionGroupsService(s *Service) *AccountPermissionGroupsService {
  200. rs := &AccountPermissionGroupsService{s: s}
  201. return rs
  202. }
  203. type AccountPermissionGroupsService struct {
  204. s *Service
  205. }
  206. func NewAccountPermissionsService(s *Service) *AccountPermissionsService {
  207. rs := &AccountPermissionsService{s: s}
  208. return rs
  209. }
  210. type AccountPermissionsService struct {
  211. s *Service
  212. }
  213. func NewAccountUserProfilesService(s *Service) *AccountUserProfilesService {
  214. rs := &AccountUserProfilesService{s: s}
  215. return rs
  216. }
  217. type AccountUserProfilesService struct {
  218. s *Service
  219. }
  220. func NewAccountsService(s *Service) *AccountsService {
  221. rs := &AccountsService{s: s}
  222. return rs
  223. }
  224. type AccountsService struct {
  225. s *Service
  226. }
  227. func NewAdsService(s *Service) *AdsService {
  228. rs := &AdsService{s: s}
  229. return rs
  230. }
  231. type AdsService struct {
  232. s *Service
  233. }
  234. func NewAdvertiserGroupsService(s *Service) *AdvertiserGroupsService {
  235. rs := &AdvertiserGroupsService{s: s}
  236. return rs
  237. }
  238. type AdvertiserGroupsService struct {
  239. s *Service
  240. }
  241. func NewAdvertiserLandingPagesService(s *Service) *AdvertiserLandingPagesService {
  242. rs := &AdvertiserLandingPagesService{s: s}
  243. return rs
  244. }
  245. type AdvertiserLandingPagesService struct {
  246. s *Service
  247. }
  248. func NewAdvertisersService(s *Service) *AdvertisersService {
  249. rs := &AdvertisersService{s: s}
  250. return rs
  251. }
  252. type AdvertisersService struct {
  253. s *Service
  254. }
  255. func NewBrowsersService(s *Service) *BrowsersService {
  256. rs := &BrowsersService{s: s}
  257. return rs
  258. }
  259. type BrowsersService struct {
  260. s *Service
  261. }
  262. func NewCampaignCreativeAssociationsService(s *Service) *CampaignCreativeAssociationsService {
  263. rs := &CampaignCreativeAssociationsService{s: s}
  264. return rs
  265. }
  266. type CampaignCreativeAssociationsService struct {
  267. s *Service
  268. }
  269. func NewCampaignsService(s *Service) *CampaignsService {
  270. rs := &CampaignsService{s: s}
  271. return rs
  272. }
  273. type CampaignsService struct {
  274. s *Service
  275. }
  276. func NewChangeLogsService(s *Service) *ChangeLogsService {
  277. rs := &ChangeLogsService{s: s}
  278. return rs
  279. }
  280. type ChangeLogsService struct {
  281. s *Service
  282. }
  283. func NewCitiesService(s *Service) *CitiesService {
  284. rs := &CitiesService{s: s}
  285. return rs
  286. }
  287. type CitiesService struct {
  288. s *Service
  289. }
  290. func NewConnectionTypesService(s *Service) *ConnectionTypesService {
  291. rs := &ConnectionTypesService{s: s}
  292. return rs
  293. }
  294. type ConnectionTypesService struct {
  295. s *Service
  296. }
  297. func NewContentCategoriesService(s *Service) *ContentCategoriesService {
  298. rs := &ContentCategoriesService{s: s}
  299. return rs
  300. }
  301. type ContentCategoriesService struct {
  302. s *Service
  303. }
  304. func NewConversionsService(s *Service) *ConversionsService {
  305. rs := &ConversionsService{s: s}
  306. return rs
  307. }
  308. type ConversionsService struct {
  309. s *Service
  310. }
  311. func NewCountriesService(s *Service) *CountriesService {
  312. rs := &CountriesService{s: s}
  313. return rs
  314. }
  315. type CountriesService struct {
  316. s *Service
  317. }
  318. func NewCreativeAssetsService(s *Service) *CreativeAssetsService {
  319. rs := &CreativeAssetsService{s: s}
  320. return rs
  321. }
  322. type CreativeAssetsService struct {
  323. s *Service
  324. }
  325. func NewCreativeFieldValuesService(s *Service) *CreativeFieldValuesService {
  326. rs := &CreativeFieldValuesService{s: s}
  327. return rs
  328. }
  329. type CreativeFieldValuesService struct {
  330. s *Service
  331. }
  332. func NewCreativeFieldsService(s *Service) *CreativeFieldsService {
  333. rs := &CreativeFieldsService{s: s}
  334. return rs
  335. }
  336. type CreativeFieldsService struct {
  337. s *Service
  338. }
  339. func NewCreativeGroupsService(s *Service) *CreativeGroupsService {
  340. rs := &CreativeGroupsService{s: s}
  341. return rs
  342. }
  343. type CreativeGroupsService struct {
  344. s *Service
  345. }
  346. func NewCreativesService(s *Service) *CreativesService {
  347. rs := &CreativesService{s: s}
  348. return rs
  349. }
  350. type CreativesService struct {
  351. s *Service
  352. }
  353. func NewDimensionValuesService(s *Service) *DimensionValuesService {
  354. rs := &DimensionValuesService{s: s}
  355. return rs
  356. }
  357. type DimensionValuesService struct {
  358. s *Service
  359. }
  360. func NewDirectorySiteContactsService(s *Service) *DirectorySiteContactsService {
  361. rs := &DirectorySiteContactsService{s: s}
  362. return rs
  363. }
  364. type DirectorySiteContactsService struct {
  365. s *Service
  366. }
  367. func NewDirectorySitesService(s *Service) *DirectorySitesService {
  368. rs := &DirectorySitesService{s: s}
  369. return rs
  370. }
  371. type DirectorySitesService struct {
  372. s *Service
  373. }
  374. func NewDynamicTargetingKeysService(s *Service) *DynamicTargetingKeysService {
  375. rs := &DynamicTargetingKeysService{s: s}
  376. return rs
  377. }
  378. type DynamicTargetingKeysService struct {
  379. s *Service
  380. }
  381. func NewEventTagsService(s *Service) *EventTagsService {
  382. rs := &EventTagsService{s: s}
  383. return rs
  384. }
  385. type EventTagsService struct {
  386. s *Service
  387. }
  388. func NewFilesService(s *Service) *FilesService {
  389. rs := &FilesService{s: s}
  390. return rs
  391. }
  392. type FilesService struct {
  393. s *Service
  394. }
  395. func NewFloodlightActivitiesService(s *Service) *FloodlightActivitiesService {
  396. rs := &FloodlightActivitiesService{s: s}
  397. return rs
  398. }
  399. type FloodlightActivitiesService struct {
  400. s *Service
  401. }
  402. func NewFloodlightActivityGroupsService(s *Service) *FloodlightActivityGroupsService {
  403. rs := &FloodlightActivityGroupsService{s: s}
  404. return rs
  405. }
  406. type FloodlightActivityGroupsService struct {
  407. s *Service
  408. }
  409. func NewFloodlightConfigurationsService(s *Service) *FloodlightConfigurationsService {
  410. rs := &FloodlightConfigurationsService{s: s}
  411. return rs
  412. }
  413. type FloodlightConfigurationsService struct {
  414. s *Service
  415. }
  416. func NewInventoryItemsService(s *Service) *InventoryItemsService {
  417. rs := &InventoryItemsService{s: s}
  418. return rs
  419. }
  420. type InventoryItemsService struct {
  421. s *Service
  422. }
  423. func NewLanguagesService(s *Service) *LanguagesService {
  424. rs := &LanguagesService{s: s}
  425. return rs
  426. }
  427. type LanguagesService struct {
  428. s *Service
  429. }
  430. func NewMetrosService(s *Service) *MetrosService {
  431. rs := &MetrosService{s: s}
  432. return rs
  433. }
  434. type MetrosService struct {
  435. s *Service
  436. }
  437. func NewMobileCarriersService(s *Service) *MobileCarriersService {
  438. rs := &MobileCarriersService{s: s}
  439. return rs
  440. }
  441. type MobileCarriersService struct {
  442. s *Service
  443. }
  444. func NewOperatingSystemVersionsService(s *Service) *OperatingSystemVersionsService {
  445. rs := &OperatingSystemVersionsService{s: s}
  446. return rs
  447. }
  448. type OperatingSystemVersionsService struct {
  449. s *Service
  450. }
  451. func NewOperatingSystemsService(s *Service) *OperatingSystemsService {
  452. rs := &OperatingSystemsService{s: s}
  453. return rs
  454. }
  455. type OperatingSystemsService struct {
  456. s *Service
  457. }
  458. func NewOrderDocumentsService(s *Service) *OrderDocumentsService {
  459. rs := &OrderDocumentsService{s: s}
  460. return rs
  461. }
  462. type OrderDocumentsService struct {
  463. s *Service
  464. }
  465. func NewOrdersService(s *Service) *OrdersService {
  466. rs := &OrdersService{s: s}
  467. return rs
  468. }
  469. type OrdersService struct {
  470. s *Service
  471. }
  472. func NewPlacementGroupsService(s *Service) *PlacementGroupsService {
  473. rs := &PlacementGroupsService{s: s}
  474. return rs
  475. }
  476. type PlacementGroupsService struct {
  477. s *Service
  478. }
  479. func NewPlacementStrategiesService(s *Service) *PlacementStrategiesService {
  480. rs := &PlacementStrategiesService{s: s}
  481. return rs
  482. }
  483. type PlacementStrategiesService struct {
  484. s *Service
  485. }
  486. func NewPlacementsService(s *Service) *PlacementsService {
  487. rs := &PlacementsService{s: s}
  488. return rs
  489. }
  490. type PlacementsService struct {
  491. s *Service
  492. }
  493. func NewPlatformTypesService(s *Service) *PlatformTypesService {
  494. rs := &PlatformTypesService{s: s}
  495. return rs
  496. }
  497. type PlatformTypesService struct {
  498. s *Service
  499. }
  500. func NewPostalCodesService(s *Service) *PostalCodesService {
  501. rs := &PostalCodesService{s: s}
  502. return rs
  503. }
  504. type PostalCodesService struct {
  505. s *Service
  506. }
  507. func NewProjectsService(s *Service) *ProjectsService {
  508. rs := &ProjectsService{s: s}
  509. return rs
  510. }
  511. type ProjectsService struct {
  512. s *Service
  513. }
  514. func NewRegionsService(s *Service) *RegionsService {
  515. rs := &RegionsService{s: s}
  516. return rs
  517. }
  518. type RegionsService struct {
  519. s *Service
  520. }
  521. func NewRemarketingListSharesService(s *Service) *RemarketingListSharesService {
  522. rs := &RemarketingListSharesService{s: s}
  523. return rs
  524. }
  525. type RemarketingListSharesService struct {
  526. s *Service
  527. }
  528. func NewRemarketingListsService(s *Service) *RemarketingListsService {
  529. rs := &RemarketingListsService{s: s}
  530. return rs
  531. }
  532. type RemarketingListsService struct {
  533. s *Service
  534. }
  535. func NewReportsService(s *Service) *ReportsService {
  536. rs := &ReportsService{s: s}
  537. rs.CompatibleFields = NewReportsCompatibleFieldsService(s)
  538. rs.Files = NewReportsFilesService(s)
  539. return rs
  540. }
  541. type ReportsService struct {
  542. s *Service
  543. CompatibleFields *ReportsCompatibleFieldsService
  544. Files *ReportsFilesService
  545. }
  546. func NewReportsCompatibleFieldsService(s *Service) *ReportsCompatibleFieldsService {
  547. rs := &ReportsCompatibleFieldsService{s: s}
  548. return rs
  549. }
  550. type ReportsCompatibleFieldsService struct {
  551. s *Service
  552. }
  553. func NewReportsFilesService(s *Service) *ReportsFilesService {
  554. rs := &ReportsFilesService{s: s}
  555. return rs
  556. }
  557. type ReportsFilesService struct {
  558. s *Service
  559. }
  560. func NewSitesService(s *Service) *SitesService {
  561. rs := &SitesService{s: s}
  562. return rs
  563. }
  564. type SitesService struct {
  565. s *Service
  566. }
  567. func NewSizesService(s *Service) *SizesService {
  568. rs := &SizesService{s: s}
  569. return rs
  570. }
  571. type SizesService struct {
  572. s *Service
  573. }
  574. func NewSubaccountsService(s *Service) *SubaccountsService {
  575. rs := &SubaccountsService{s: s}
  576. return rs
  577. }
  578. type SubaccountsService struct {
  579. s *Service
  580. }
  581. func NewTargetableRemarketingListsService(s *Service) *TargetableRemarketingListsService {
  582. rs := &TargetableRemarketingListsService{s: s}
  583. return rs
  584. }
  585. type TargetableRemarketingListsService struct {
  586. s *Service
  587. }
  588. func NewTargetingTemplatesService(s *Service) *TargetingTemplatesService {
  589. rs := &TargetingTemplatesService{s: s}
  590. return rs
  591. }
  592. type TargetingTemplatesService struct {
  593. s *Service
  594. }
  595. func NewUserProfilesService(s *Service) *UserProfilesService {
  596. rs := &UserProfilesService{s: s}
  597. return rs
  598. }
  599. type UserProfilesService struct {
  600. s *Service
  601. }
  602. func NewUserRolePermissionGroupsService(s *Service) *UserRolePermissionGroupsService {
  603. rs := &UserRolePermissionGroupsService{s: s}
  604. return rs
  605. }
  606. type UserRolePermissionGroupsService struct {
  607. s *Service
  608. }
  609. func NewUserRolePermissionsService(s *Service) *UserRolePermissionsService {
  610. rs := &UserRolePermissionsService{s: s}
  611. return rs
  612. }
  613. type UserRolePermissionsService struct {
  614. s *Service
  615. }
  616. func NewUserRolesService(s *Service) *UserRolesService {
  617. rs := &UserRolesService{s: s}
  618. return rs
  619. }
  620. type UserRolesService struct {
  621. s *Service
  622. }
  623. func NewVideoFormatsService(s *Service) *VideoFormatsService {
  624. rs := &VideoFormatsService{s: s}
  625. return rs
  626. }
  627. type VideoFormatsService struct {
  628. s *Service
  629. }
  630. // Account: Contains properties of a DCM account.
  631. type Account struct {
  632. // AccountPermissionIds: Account permissions assigned to this account.
  633. AccountPermissionIds googleapi.Int64s `json:"accountPermissionIds,omitempty"`
  634. // AccountProfile: Profile for this account. This is a read-only field
  635. // that can be left blank.
  636. //
  637. // Possible values:
  638. // "ACCOUNT_PROFILE_BASIC"
  639. // "ACCOUNT_PROFILE_STANDARD"
  640. AccountProfile string `json:"accountProfile,omitempty"`
  641. // Active: Whether this account is active.
  642. Active bool `json:"active,omitempty"`
  643. // ActiveAdsLimitTier: Maximum number of active ads allowed for this
  644. // account.
  645. //
  646. // Possible values:
  647. // "ACTIVE_ADS_TIER_100K"
  648. // "ACTIVE_ADS_TIER_1M"
  649. // "ACTIVE_ADS_TIER_200K"
  650. // "ACTIVE_ADS_TIER_300K"
  651. // "ACTIVE_ADS_TIER_40K"
  652. // "ACTIVE_ADS_TIER_500K"
  653. // "ACTIVE_ADS_TIER_750K"
  654. // "ACTIVE_ADS_TIER_75K"
  655. ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"`
  656. // ActiveViewOptOut: Whether to serve creatives with Active View tags.
  657. // If disabled, viewability data will not be available for any
  658. // impressions.
  659. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  660. // AvailablePermissionIds: User role permissions available to the user
  661. // roles of this account.
  662. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  663. // CountryId: ID of the country associated with this account.
  664. CountryId int64 `json:"countryId,omitempty,string"`
  665. // CurrencyId: ID of currency associated with this account. This is a
  666. // required field.
  667. // Acceptable values are:
  668. // - "1" for USD
  669. // - "2" for GBP
  670. // - "3" for ESP
  671. // - "4" for SEK
  672. // - "5" for CAD
  673. // - "6" for JPY
  674. // - "7" for DEM
  675. // - "8" for AUD
  676. // - "9" for FRF
  677. // - "10" for ITL
  678. // - "11" for DKK
  679. // - "12" for NOK
  680. // - "13" for FIM
  681. // - "14" for ZAR
  682. // - "15" for IEP
  683. // - "16" for NLG
  684. // - "17" for EUR
  685. // - "18" for KRW
  686. // - "19" for TWD
  687. // - "20" for SGD
  688. // - "21" for CNY
  689. // - "22" for HKD
  690. // - "23" for NZD
  691. // - "24" for MYR
  692. // - "25" for BRL
  693. // - "26" for PTE
  694. // - "27" for MXP
  695. // - "28" for CLP
  696. // - "29" for TRY
  697. // - "30" for ARS
  698. // - "31" for PEN
  699. // - "32" for ILS
  700. // - "33" for CHF
  701. // - "34" for VEF
  702. // - "35" for COP
  703. // - "36" for GTQ
  704. // - "37" for PLN
  705. // - "39" for INR
  706. // - "40" for THB
  707. // - "41" for IDR
  708. // - "42" for CZK
  709. // - "43" for RON
  710. // - "44" for HUF
  711. // - "45" for RUB
  712. // - "46" for AED
  713. // - "47" for BGN
  714. // - "48" for HRK
  715. // - "49" for MXN
  716. // - "50" for NGN
  717. CurrencyId int64 `json:"currencyId,omitempty,string"`
  718. // DefaultCreativeSizeId: Default placement dimensions for this account.
  719. DefaultCreativeSizeId int64 `json:"defaultCreativeSizeId,omitempty,string"`
  720. // Description: Description of this account.
  721. Description string `json:"description,omitempty"`
  722. // Id: ID of this account. This is a read-only, auto-generated field.
  723. Id int64 `json:"id,omitempty,string"`
  724. // Kind: Identifies what kind of resource this is. Value: the fixed
  725. // string "dfareporting#account".
  726. Kind string `json:"kind,omitempty"`
  727. // Locale: Locale of this account.
  728. // Acceptable values are:
  729. // - "cs" (Czech)
  730. // - "de" (German)
  731. // - "en" (English)
  732. // - "en-GB" (English United Kingdom)
  733. // - "es" (Spanish)
  734. // - "fr" (French)
  735. // - "it" (Italian)
  736. // - "ja" (Japanese)
  737. // - "ko" (Korean)
  738. // - "pl" (Polish)
  739. // - "pt-BR" (Portuguese Brazil)
  740. // - "ru" (Russian)
  741. // - "sv" (Swedish)
  742. // - "tr" (Turkish)
  743. // - "zh-CN" (Chinese Simplified)
  744. // - "zh-TW" (Chinese Traditional)
  745. Locale string `json:"locale,omitempty"`
  746. // MaximumImageSize: Maximum image size allowed for this account, in
  747. // kilobytes. Value must be greater than or equal to 1.
  748. MaximumImageSize int64 `json:"maximumImageSize,omitempty,string"`
  749. // Name: Name of this account. This is a required field, and must be
  750. // less than 128 characters long and be globally unique.
  751. Name string `json:"name,omitempty"`
  752. // NielsenOcrEnabled: Whether campaigns created in this account will be
  753. // enabled for Nielsen OCR reach ratings by default.
  754. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  755. // ReportsConfiguration: Reporting configuration of this account.
  756. ReportsConfiguration *ReportsConfiguration `json:"reportsConfiguration,omitempty"`
  757. // ShareReportsWithTwitter: Share Path to Conversion reports with
  758. // Twitter.
  759. ShareReportsWithTwitter bool `json:"shareReportsWithTwitter,omitempty"`
  760. // TeaserSizeLimit: File size limit in kilobytes of Rich Media teaser
  761. // creatives. Acceptable values are 1 to 10240, inclusive.
  762. TeaserSizeLimit int64 `json:"teaserSizeLimit,omitempty,string"`
  763. // ServerResponse contains the HTTP response code and headers from the
  764. // server.
  765. googleapi.ServerResponse `json:"-"`
  766. // ForceSendFields is a list of field names (e.g.
  767. // "AccountPermissionIds") to unconditionally include in API requests.
  768. // By default, fields with empty values are omitted from API requests.
  769. // However, any non-pointer, non-interface field appearing in
  770. // ForceSendFields will be sent to the server regardless of whether the
  771. // field is empty or not. This may be used to include empty fields in
  772. // Patch requests.
  773. ForceSendFields []string `json:"-"`
  774. // NullFields is a list of field names (e.g. "AccountPermissionIds") to
  775. // include in API requests with the JSON null value. By default, fields
  776. // with empty values are omitted from API requests. However, any field
  777. // with an empty value appearing in NullFields will be sent to the
  778. // server as null. It is an error if a field in this list has a
  779. // non-empty value. This may be used to include null fields in Patch
  780. // requests.
  781. NullFields []string `json:"-"`
  782. }
  783. func (s *Account) MarshalJSON() ([]byte, error) {
  784. type NoMethod Account
  785. raw := NoMethod(*s)
  786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  787. }
  788. // AccountActiveAdSummary: Gets a summary of active ads in an account.
  789. type AccountActiveAdSummary struct {
  790. // AccountId: ID of the account.
  791. AccountId int64 `json:"accountId,omitempty,string"`
  792. // ActiveAds: Ads that have been activated for the account
  793. ActiveAds int64 `json:"activeAds,omitempty,string"`
  794. // ActiveAdsLimitTier: Maximum number of active ads allowed for the
  795. // account.
  796. //
  797. // Possible values:
  798. // "ACTIVE_ADS_TIER_100K"
  799. // "ACTIVE_ADS_TIER_1M"
  800. // "ACTIVE_ADS_TIER_200K"
  801. // "ACTIVE_ADS_TIER_300K"
  802. // "ACTIVE_ADS_TIER_40K"
  803. // "ACTIVE_ADS_TIER_500K"
  804. // "ACTIVE_ADS_TIER_750K"
  805. // "ACTIVE_ADS_TIER_75K"
  806. ActiveAdsLimitTier string `json:"activeAdsLimitTier,omitempty"`
  807. // AvailableAds: Ads that can be activated for the account.
  808. AvailableAds int64 `json:"availableAds,omitempty,string"`
  809. // Kind: Identifies what kind of resource this is. Value: the fixed
  810. // string "dfareporting#accountActiveAdSummary".
  811. Kind string `json:"kind,omitempty"`
  812. // ServerResponse contains the HTTP response code and headers from the
  813. // server.
  814. googleapi.ServerResponse `json:"-"`
  815. // ForceSendFields is a list of field names (e.g. "AccountId") to
  816. // unconditionally include in API requests. By default, fields with
  817. // empty values are omitted from API requests. However, any non-pointer,
  818. // non-interface field appearing in ForceSendFields will be sent to the
  819. // server regardless of whether the field is empty or not. This may be
  820. // used to include empty fields in Patch requests.
  821. ForceSendFields []string `json:"-"`
  822. // NullFields is a list of field names (e.g. "AccountId") to include in
  823. // API requests with the JSON null value. By default, fields with empty
  824. // values are omitted from API requests. However, any field with an
  825. // empty value appearing in NullFields will be sent to the server as
  826. // null. It is an error if a field in this list has a non-empty value.
  827. // This may be used to include null fields in Patch requests.
  828. NullFields []string `json:"-"`
  829. }
  830. func (s *AccountActiveAdSummary) MarshalJSON() ([]byte, error) {
  831. type NoMethod AccountActiveAdSummary
  832. raw := NoMethod(*s)
  833. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  834. }
  835. // AccountPermission: AccountPermissions contains information about a
  836. // particular account permission. Some features of DCM require an
  837. // account permission to be present in the account.
  838. type AccountPermission struct {
  839. // AccountProfiles: Account profiles associated with this account
  840. // permission.
  841. //
  842. // Possible values are:
  843. // - "ACCOUNT_PROFILE_BASIC"
  844. // - "ACCOUNT_PROFILE_STANDARD"
  845. //
  846. // Possible values:
  847. // "ACCOUNT_PROFILE_BASIC"
  848. // "ACCOUNT_PROFILE_STANDARD"
  849. AccountProfiles []string `json:"accountProfiles,omitempty"`
  850. // Id: ID of this account permission.
  851. Id int64 `json:"id,omitempty,string"`
  852. // Kind: Identifies what kind of resource this is. Value: the fixed
  853. // string "dfareporting#accountPermission".
  854. Kind string `json:"kind,omitempty"`
  855. // Level: Administrative level required to enable this account
  856. // permission.
  857. //
  858. // Possible values:
  859. // "ADMINISTRATOR"
  860. // "USER"
  861. Level string `json:"level,omitempty"`
  862. // Name: Name of this account permission.
  863. Name string `json:"name,omitempty"`
  864. // PermissionGroupId: Permission group of this account permission.
  865. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  866. // ServerResponse contains the HTTP response code and headers from the
  867. // server.
  868. googleapi.ServerResponse `json:"-"`
  869. // ForceSendFields is a list of field names (e.g. "AccountProfiles") to
  870. // unconditionally include in API requests. By default, fields with
  871. // empty values are omitted from API requests. However, any non-pointer,
  872. // non-interface field appearing in ForceSendFields will be sent to the
  873. // server regardless of whether the field is empty or not. This may be
  874. // used to include empty fields in Patch requests.
  875. ForceSendFields []string `json:"-"`
  876. // NullFields is a list of field names (e.g. "AccountProfiles") to
  877. // include in API requests with the JSON null value. By default, fields
  878. // with empty values are omitted from API requests. However, any field
  879. // with an empty value appearing in NullFields will be sent to the
  880. // server as null. It is an error if a field in this list has a
  881. // non-empty value. This may be used to include null fields in Patch
  882. // requests.
  883. NullFields []string `json:"-"`
  884. }
  885. func (s *AccountPermission) MarshalJSON() ([]byte, error) {
  886. type NoMethod AccountPermission
  887. raw := NoMethod(*s)
  888. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  889. }
  890. // AccountPermissionGroup: AccountPermissionGroups contains a mapping of
  891. // permission group IDs to names. A permission group is a grouping of
  892. // account permissions.
  893. type AccountPermissionGroup struct {
  894. // Id: ID of this account permission group.
  895. Id int64 `json:"id,omitempty,string"`
  896. // Kind: Identifies what kind of resource this is. Value: the fixed
  897. // string "dfareporting#accountPermissionGroup".
  898. Kind string `json:"kind,omitempty"`
  899. // Name: Name of this account permission group.
  900. Name string `json:"name,omitempty"`
  901. // ServerResponse contains the HTTP response code and headers from the
  902. // server.
  903. googleapi.ServerResponse `json:"-"`
  904. // ForceSendFields is a list of field names (e.g. "Id") to
  905. // unconditionally include in API requests. By default, fields with
  906. // empty values are omitted from API requests. However, any non-pointer,
  907. // non-interface field appearing in ForceSendFields will be sent to the
  908. // server regardless of whether the field is empty or not. This may be
  909. // used to include empty fields in Patch requests.
  910. ForceSendFields []string `json:"-"`
  911. // NullFields is a list of field names (e.g. "Id") to include in API
  912. // requests with the JSON null value. By default, fields with empty
  913. // values are omitted from API requests. However, any field with an
  914. // empty value appearing in NullFields will be sent to the server as
  915. // null. It is an error if a field in this list has a non-empty value.
  916. // This may be used to include null fields in Patch requests.
  917. NullFields []string `json:"-"`
  918. }
  919. func (s *AccountPermissionGroup) MarshalJSON() ([]byte, error) {
  920. type NoMethod AccountPermissionGroup
  921. raw := NoMethod(*s)
  922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  923. }
  924. // AccountPermissionGroupsListResponse: Account Permission Group List
  925. // Response
  926. type AccountPermissionGroupsListResponse struct {
  927. // AccountPermissionGroups: Account permission group collection.
  928. AccountPermissionGroups []*AccountPermissionGroup `json:"accountPermissionGroups,omitempty"`
  929. // Kind: Identifies what kind of resource this is. Value: the fixed
  930. // string "dfareporting#accountPermissionGroupsListResponse".
  931. Kind string `json:"kind,omitempty"`
  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.
  936. // "AccountPermissionGroups") to unconditionally include in API
  937. // requests. By default, fields with empty values are omitted from API
  938. // requests. However, any non-pointer, non-interface field appearing in
  939. // ForceSendFields will be sent to the server regardless of whether the
  940. // field is empty or not. This may be used to include empty fields in
  941. // Patch requests.
  942. ForceSendFields []string `json:"-"`
  943. // NullFields is a list of field names (e.g. "AccountPermissionGroups")
  944. // to include in API requests with the JSON null value. By default,
  945. // fields with empty values are omitted from API requests. However, any
  946. // field with an empty value appearing in NullFields will be sent to the
  947. // server as null. It is an error if a field in this list has a
  948. // non-empty value. This may be used to include null fields in Patch
  949. // requests.
  950. NullFields []string `json:"-"`
  951. }
  952. func (s *AccountPermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  953. type NoMethod AccountPermissionGroupsListResponse
  954. raw := NoMethod(*s)
  955. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  956. }
  957. // AccountPermissionsListResponse: Account Permission List Response
  958. type AccountPermissionsListResponse struct {
  959. // AccountPermissions: Account permission collection.
  960. AccountPermissions []*AccountPermission `json:"accountPermissions,omitempty"`
  961. // Kind: Identifies what kind of resource this is. Value: the fixed
  962. // string "dfareporting#accountPermissionsListResponse".
  963. Kind string `json:"kind,omitempty"`
  964. // ServerResponse contains the HTTP response code and headers from the
  965. // server.
  966. googleapi.ServerResponse `json:"-"`
  967. // ForceSendFields is a list of field names (e.g. "AccountPermissions")
  968. // to unconditionally include in API requests. By default, fields with
  969. // empty values are omitted from API requests. However, any non-pointer,
  970. // non-interface field appearing in ForceSendFields will be sent to the
  971. // server regardless of whether the field is empty or not. This may be
  972. // used to include empty fields in Patch requests.
  973. ForceSendFields []string `json:"-"`
  974. // NullFields is a list of field names (e.g. "AccountPermissions") to
  975. // include in API requests with the JSON null value. By default, fields
  976. // with empty values are omitted from API requests. However, any field
  977. // with an empty value appearing in NullFields will be sent to the
  978. // server as null. It is an error if a field in this list has a
  979. // non-empty value. This may be used to include null fields in Patch
  980. // requests.
  981. NullFields []string `json:"-"`
  982. }
  983. func (s *AccountPermissionsListResponse) MarshalJSON() ([]byte, error) {
  984. type NoMethod AccountPermissionsListResponse
  985. raw := NoMethod(*s)
  986. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  987. }
  988. // AccountUserProfile: AccountUserProfiles contains properties of a DCM
  989. // user profile. This resource is specifically for managing user
  990. // profiles, whereas UserProfiles is for accessing the API.
  991. type AccountUserProfile struct {
  992. // AccountId: Account ID of the user profile. This is a read-only field
  993. // that can be left blank.
  994. AccountId int64 `json:"accountId,omitempty,string"`
  995. // Active: Whether this user profile is active. This defaults to false,
  996. // and must be set true on insert for the user profile to be usable.
  997. Active bool `json:"active,omitempty"`
  998. // AdvertiserFilter: Filter that describes which advertisers are visible
  999. // to the user profile.
  1000. AdvertiserFilter *ObjectFilter `json:"advertiserFilter,omitempty"`
  1001. // CampaignFilter: Filter that describes which campaigns are visible to
  1002. // the user profile.
  1003. CampaignFilter *ObjectFilter `json:"campaignFilter,omitempty"`
  1004. // Comments: Comments for this user profile.
  1005. Comments string `json:"comments,omitempty"`
  1006. // Email: Email of the user profile. The email addresss must be linked
  1007. // to a Google Account. This field is required on insertion and is
  1008. // read-only after insertion.
  1009. Email string `json:"email,omitempty"`
  1010. // Id: ID of the user profile. This is a read-only, auto-generated
  1011. // field.
  1012. Id int64 `json:"id,omitempty,string"`
  1013. // Kind: Identifies what kind of resource this is. Value: the fixed
  1014. // string "dfareporting#accountUserProfile".
  1015. Kind string `json:"kind,omitempty"`
  1016. // Locale: Locale of the user profile. This is a required
  1017. // field.
  1018. // Acceptable values are:
  1019. // - "cs" (Czech)
  1020. // - "de" (German)
  1021. // - "en" (English)
  1022. // - "en-GB" (English United Kingdom)
  1023. // - "es" (Spanish)
  1024. // - "fr" (French)
  1025. // - "it" (Italian)
  1026. // - "ja" (Japanese)
  1027. // - "ko" (Korean)
  1028. // - "pl" (Polish)
  1029. // - "pt-BR" (Portuguese Brazil)
  1030. // - "ru" (Russian)
  1031. // - "sv" (Swedish)
  1032. // - "tr" (Turkish)
  1033. // - "zh-CN" (Chinese Simplified)
  1034. // - "zh-TW" (Chinese Traditional)
  1035. Locale string `json:"locale,omitempty"`
  1036. // Name: Name of the user profile. This is a required field. Must be
  1037. // less than 64 characters long, must be globally unique, and cannot
  1038. // contain whitespace or any of the following characters: "&;"#%,".
  1039. Name string `json:"name,omitempty"`
  1040. // SiteFilter: Filter that describes which sites are visible to the user
  1041. // profile.
  1042. SiteFilter *ObjectFilter `json:"siteFilter,omitempty"`
  1043. // SubaccountId: Subaccount ID of the user profile. This is a read-only
  1044. // field that can be left blank.
  1045. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1046. // TraffickerType: Trafficker type of this user profile. This is a
  1047. // read-only field.
  1048. //
  1049. // Possible values:
  1050. // "EXTERNAL_TRAFFICKER"
  1051. // "INTERNAL_NON_TRAFFICKER"
  1052. // "INTERNAL_TRAFFICKER"
  1053. TraffickerType string `json:"traffickerType,omitempty"`
  1054. // UserAccessType: User type of the user profile. This is a read-only
  1055. // field that can be left blank.
  1056. //
  1057. // Possible values:
  1058. // "INTERNAL_ADMINISTRATOR"
  1059. // "NORMAL_USER"
  1060. // "READ_ONLY_SUPER_USER"
  1061. // "SUPER_USER"
  1062. UserAccessType string `json:"userAccessType,omitempty"`
  1063. // UserRoleFilter: Filter that describes which user roles are visible to
  1064. // the user profile.
  1065. UserRoleFilter *ObjectFilter `json:"userRoleFilter,omitempty"`
  1066. // UserRoleId: User role ID of the user profile. This is a required
  1067. // field.
  1068. UserRoleId int64 `json:"userRoleId,omitempty,string"`
  1069. // ServerResponse contains the HTTP response code and headers from the
  1070. // server.
  1071. googleapi.ServerResponse `json:"-"`
  1072. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1073. // unconditionally include in API requests. By default, fields with
  1074. // empty values are omitted from API requests. However, any non-pointer,
  1075. // non-interface field appearing in ForceSendFields will be sent to the
  1076. // server regardless of whether the field is empty or not. This may be
  1077. // used to include empty fields in Patch requests.
  1078. ForceSendFields []string `json:"-"`
  1079. // NullFields is a list of field names (e.g. "AccountId") to include in
  1080. // API requests with the JSON null value. By default, fields with empty
  1081. // values are omitted from API requests. However, any field with an
  1082. // empty value appearing in NullFields will be sent to the server as
  1083. // null. It is an error if a field in this list has a non-empty value.
  1084. // This may be used to include null fields in Patch requests.
  1085. NullFields []string `json:"-"`
  1086. }
  1087. func (s *AccountUserProfile) MarshalJSON() ([]byte, error) {
  1088. type NoMethod AccountUserProfile
  1089. raw := NoMethod(*s)
  1090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1091. }
  1092. // AccountUserProfilesListResponse: Account User Profile List Response
  1093. type AccountUserProfilesListResponse struct {
  1094. // AccountUserProfiles: Account user profile collection.
  1095. AccountUserProfiles []*AccountUserProfile `json:"accountUserProfiles,omitempty"`
  1096. // Kind: Identifies what kind of resource this is. Value: the fixed
  1097. // string "dfareporting#accountUserProfilesListResponse".
  1098. Kind string `json:"kind,omitempty"`
  1099. // NextPageToken: Pagination token to be used for the next list
  1100. // operation.
  1101. NextPageToken string `json:"nextPageToken,omitempty"`
  1102. // ServerResponse contains the HTTP response code and headers from the
  1103. // server.
  1104. googleapi.ServerResponse `json:"-"`
  1105. // ForceSendFields is a list of field names (e.g. "AccountUserProfiles")
  1106. // to unconditionally include in API requests. By default, fields with
  1107. // empty values are omitted from API requests. However, any non-pointer,
  1108. // non-interface field appearing in ForceSendFields will be sent to the
  1109. // server regardless of whether the field is empty or not. This may be
  1110. // used to include empty fields in Patch requests.
  1111. ForceSendFields []string `json:"-"`
  1112. // NullFields is a list of field names (e.g. "AccountUserProfiles") to
  1113. // include in API requests with the JSON null value. By default, fields
  1114. // with empty values are omitted from API requests. However, any field
  1115. // with an empty value appearing in NullFields will be sent to the
  1116. // server as null. It is an error if a field in this list has a
  1117. // non-empty value. This may be used to include null fields in Patch
  1118. // requests.
  1119. NullFields []string `json:"-"`
  1120. }
  1121. func (s *AccountUserProfilesListResponse) MarshalJSON() ([]byte, error) {
  1122. type NoMethod AccountUserProfilesListResponse
  1123. raw := NoMethod(*s)
  1124. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1125. }
  1126. // AccountsListResponse: Account List Response
  1127. type AccountsListResponse struct {
  1128. // Accounts: Account collection.
  1129. Accounts []*Account `json:"accounts,omitempty"`
  1130. // Kind: Identifies what kind of resource this is. Value: the fixed
  1131. // string "dfareporting#accountsListResponse".
  1132. Kind string `json:"kind,omitempty"`
  1133. // NextPageToken: Pagination token to be used for the next list
  1134. // operation.
  1135. NextPageToken string `json:"nextPageToken,omitempty"`
  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. "Accounts") 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. "Accounts") 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 *AccountsListResponse) MarshalJSON() ([]byte, error) {
  1155. type NoMethod AccountsListResponse
  1156. raw := NoMethod(*s)
  1157. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1158. }
  1159. // Activities: Represents an activity group.
  1160. type Activities struct {
  1161. // Filters: List of activity filters. The dimension values need to be
  1162. // all either of type "dfa:activity" or "dfa:activityGroup".
  1163. Filters []*DimensionValue `json:"filters,omitempty"`
  1164. // Kind: The kind of resource this is, in this case
  1165. // dfareporting#activities.
  1166. Kind string `json:"kind,omitempty"`
  1167. // MetricNames: List of names of floodlight activity metrics.
  1168. MetricNames []string `json:"metricNames,omitempty"`
  1169. // ForceSendFields is a list of field names (e.g. "Filters") to
  1170. // unconditionally include in API requests. By default, fields with
  1171. // empty values are omitted from API requests. However, any non-pointer,
  1172. // non-interface field appearing in ForceSendFields will be sent to the
  1173. // server regardless of whether the field is empty or not. This may be
  1174. // used to include empty fields in Patch requests.
  1175. ForceSendFields []string `json:"-"`
  1176. // NullFields is a list of field names (e.g. "Filters") to include in
  1177. // API requests with the JSON null value. By default, fields with empty
  1178. // values are omitted from API requests. However, any field with an
  1179. // empty value appearing in NullFields will be sent to the server as
  1180. // null. It is an error if a field in this list has a non-empty value.
  1181. // This may be used to include null fields in Patch requests.
  1182. NullFields []string `json:"-"`
  1183. }
  1184. func (s *Activities) MarshalJSON() ([]byte, error) {
  1185. type NoMethod Activities
  1186. raw := NoMethod(*s)
  1187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1188. }
  1189. // Ad: Contains properties of a DCM ad.
  1190. type Ad struct {
  1191. // AccountId: Account ID of this ad. This is a read-only field that can
  1192. // be left blank.
  1193. AccountId int64 `json:"accountId,omitempty,string"`
  1194. // Active: Whether this ad is active. When true, archived must be false.
  1195. Active bool `json:"active,omitempty"`
  1196. // AdvertiserId: Advertiser ID of this ad. This is a required field on
  1197. // insertion.
  1198. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1199. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  1200. // advertiser. This is a read-only, auto-generated field.
  1201. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1202. // Archived: Whether this ad is archived. When true, active must be
  1203. // false.
  1204. Archived bool `json:"archived,omitempty"`
  1205. // AudienceSegmentId: Audience segment ID that is being targeted for
  1206. // this ad. Applicable when type is AD_SERVING_STANDARD_AD.
  1207. AudienceSegmentId int64 `json:"audienceSegmentId,omitempty,string"`
  1208. // CampaignId: Campaign ID of this ad. This is a required field on
  1209. // insertion.
  1210. CampaignId int64 `json:"campaignId,omitempty,string"`
  1211. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  1212. // This is a read-only, auto-generated field.
  1213. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  1214. // ClickThroughUrl: Click-through URL for this ad. This is a required
  1215. // field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER.
  1216. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  1217. // ClickThroughUrlSuffixProperties: Click-through URL suffix properties
  1218. // for this ad. Applies to the URL in the ad or (if overriding ad
  1219. // properties) the URL in the creative.
  1220. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1221. // Comments: Comments for this ad.
  1222. Comments string `json:"comments,omitempty"`
  1223. // Compatibility: Compatibility of this ad. Applicable when type is
  1224. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  1225. // either rendering on desktop or on mobile devices or in mobile apps
  1226. // for regular or interstitial ads, respectively. APP and
  1227. // APP_INTERSTITIAL are only used for existing default ads. New mobile
  1228. // placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and
  1229. // default ads created for those placements will be limited to those
  1230. // compatibility types. IN_STREAM_VIDEO refers to rendering in-stream
  1231. // video ads developed with the VAST standard.
  1232. //
  1233. // Possible values:
  1234. // "APP"
  1235. // "APP_INTERSTITIAL"
  1236. // "DISPLAY"
  1237. // "DISPLAY_INTERSTITIAL"
  1238. // "IN_STREAM_AUDIO"
  1239. // "IN_STREAM_VIDEO"
  1240. Compatibility string `json:"compatibility,omitempty"`
  1241. // CreateInfo: Information about the creation of this ad. This is a
  1242. // read-only field.
  1243. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1244. // CreativeGroupAssignments: Creative group assignments for this ad.
  1245. // Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment
  1246. // per creative group number is allowed for a maximum of two
  1247. // assignments.
  1248. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  1249. // CreativeRotation: Creative rotation for this ad. Applicable when type
  1250. // is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or
  1251. // AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field
  1252. // should have exactly one creativeAssignment.
  1253. CreativeRotation *CreativeRotation `json:"creativeRotation,omitempty"`
  1254. // DayPartTargeting: Time and day targeting information for this ad.
  1255. // This field must be left blank if the ad is using a targeting
  1256. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1257. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  1258. // DefaultClickThroughEventTagProperties: Default click-through event
  1259. // tag properties for this ad.
  1260. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1261. // DeliverySchedule: Delivery schedule information for this ad.
  1262. // Applicable when type is AD_SERVING_STANDARD_AD or
  1263. // AD_SERVING_TRACKING. This field along with subfields priority and
  1264. // impressionRatio are required on insertion when type is
  1265. // AD_SERVING_STANDARD_AD.
  1266. DeliverySchedule *DeliverySchedule `json:"deliverySchedule,omitempty"`
  1267. // DynamicClickTracker: Whether this ad is a dynamic click tracker.
  1268. // Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required
  1269. // field on insert, and is read-only after insert.
  1270. DynamicClickTracker bool `json:"dynamicClickTracker,omitempty"`
  1271. // EndTime: Date and time that this ad should stop serving. Must be
  1272. // later than the start time. This is a required field on insertion.
  1273. EndTime string `json:"endTime,omitempty"`
  1274. // EventTagOverrides: Event tag overrides for this ad.
  1275. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1276. // GeoTargeting: Geographical targeting information for this ad. This
  1277. // field must be left blank if the ad is using a targeting template.
  1278. // Applicable when type is AD_SERVING_STANDARD_AD.
  1279. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  1280. // Id: ID of this ad. This is a read-only, auto-generated field.
  1281. Id int64 `json:"id,omitempty,string"`
  1282. // IdDimensionValue: Dimension value for the ID of this ad. This is a
  1283. // read-only, auto-generated field.
  1284. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1285. // KeyValueTargetingExpression: Key-value targeting information for this
  1286. // ad. This field must be left blank if the ad is using a targeting
  1287. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1288. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  1289. // Kind: Identifies what kind of resource this is. Value: the fixed
  1290. // string "dfareporting#ad".
  1291. Kind string `json:"kind,omitempty"`
  1292. // LanguageTargeting: Language targeting information for this ad. This
  1293. // field must be left blank if the ad is using a targeting template.
  1294. // Applicable when type is AD_SERVING_STANDARD_AD.
  1295. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  1296. // LastModifiedInfo: Information about the most recent modification of
  1297. // this ad. This is a read-only field.
  1298. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1299. // Name: Name of this ad. This is a required field and must be less than
  1300. // 256 characters long.
  1301. Name string `json:"name,omitempty"`
  1302. // PlacementAssignments: Placement assignments for this ad.
  1303. PlacementAssignments []*PlacementAssignment `json:"placementAssignments,omitempty"`
  1304. // RemarketingListExpression: Remarketing list targeting expression for
  1305. // this ad. This field must be left blank if the ad is using a targeting
  1306. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1307. RemarketingListExpression *ListTargetingExpression `json:"remarketingListExpression,omitempty"`
  1308. // Size: Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD.
  1309. Size *Size `json:"size,omitempty"`
  1310. // SslCompliant: Whether this ad is ssl compliant. This is a read-only
  1311. // field that is auto-generated when the ad is inserted or updated.
  1312. SslCompliant bool `json:"sslCompliant,omitempty"`
  1313. // SslRequired: Whether this ad requires ssl. This is a read-only field
  1314. // that is auto-generated when the ad is inserted or updated.
  1315. SslRequired bool `json:"sslRequired,omitempty"`
  1316. // StartTime: Date and time that this ad should start serving. If
  1317. // creating an ad, this field must be a time in the future. This is a
  1318. // required field on insertion.
  1319. StartTime string `json:"startTime,omitempty"`
  1320. // SubaccountId: Subaccount ID of this ad. This is a read-only field
  1321. // that can be left blank.
  1322. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1323. // TargetingTemplateId: Targeting template ID, used to apply
  1324. // preconfigured targeting information to this ad. This cannot be set
  1325. // while any of dayPartTargeting, geoTargeting,
  1326. // keyValueTargetingExpression, languageTargeting,
  1327. // remarketingListExpression, or technologyTargeting are set. Applicable
  1328. // when type is AD_SERVING_STANDARD_AD.
  1329. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  1330. // TechnologyTargeting: Technology platform targeting information for
  1331. // this ad. This field must be left blank if the ad is using a targeting
  1332. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1333. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  1334. // Type: Type of ad. This is a required field on insertion. Note that
  1335. // default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see
  1336. // Creative resource).
  1337. //
  1338. // Possible values:
  1339. // "AD_SERVING_CLICK_TRACKER"
  1340. // "AD_SERVING_DEFAULT_AD"
  1341. // "AD_SERVING_STANDARD_AD"
  1342. // "AD_SERVING_TRACKING"
  1343. Type string `json:"type,omitempty"`
  1344. // ServerResponse contains the HTTP response code and headers from the
  1345. // server.
  1346. googleapi.ServerResponse `json:"-"`
  1347. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1348. // unconditionally include in API requests. By default, fields with
  1349. // empty values are omitted from API requests. However, any non-pointer,
  1350. // non-interface field appearing in ForceSendFields will be sent to the
  1351. // server regardless of whether the field is empty or not. This may be
  1352. // used to include empty fields in Patch requests.
  1353. ForceSendFields []string `json:"-"`
  1354. // NullFields is a list of field names (e.g. "AccountId") to include in
  1355. // API requests with the JSON null value. By default, fields with empty
  1356. // values are omitted from API requests. However, any field with an
  1357. // empty value appearing in NullFields will be sent to the server as
  1358. // null. It is an error if a field in this list has a non-empty value.
  1359. // This may be used to include null fields in Patch requests.
  1360. NullFields []string `json:"-"`
  1361. }
  1362. func (s *Ad) MarshalJSON() ([]byte, error) {
  1363. type NoMethod Ad
  1364. raw := NoMethod(*s)
  1365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1366. }
  1367. // AdBlockingConfiguration: Campaign ad blocking settings.
  1368. type AdBlockingConfiguration struct {
  1369. // ClickThroughUrl: Click-through URL used by brand-neutral ads. This is
  1370. // a required field when overrideClickThroughUrl is set to true.
  1371. ClickThroughUrl string `json:"clickThroughUrl,omitempty"`
  1372. // CreativeBundleId: ID of a creative bundle to use for this campaign.
  1373. // If set, brand-neutral ads will select creatives from this bundle.
  1374. // Otherwise, a default transparent pixel will be used.
  1375. CreativeBundleId int64 `json:"creativeBundleId,omitempty,string"`
  1376. // Enabled: Whether this campaign has enabled ad blocking. When true, ad
  1377. // blocking is enabled for placements in the campaign, but this may be
  1378. // overridden by site and placement settings. When false, ad blocking is
  1379. // disabled for all placements under the campaign, regardless of site
  1380. // and placement settings.
  1381. Enabled bool `json:"enabled,omitempty"`
  1382. // OverrideClickThroughUrl: Whether the brand-neutral ad's click-through
  1383. // URL comes from the campaign's creative bundle or the override URL.
  1384. // Must be set to true if ad blocking is enabled and no creative bundle
  1385. // is configured.
  1386. OverrideClickThroughUrl bool `json:"overrideClickThroughUrl,omitempty"`
  1387. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  1388. // unconditionally include in API requests. By default, fields with
  1389. // empty values are omitted from API requests. However, any non-pointer,
  1390. // non-interface field appearing in ForceSendFields will be sent to the
  1391. // server regardless of whether the field is empty or not. This may be
  1392. // used to include empty fields in Patch requests.
  1393. ForceSendFields []string `json:"-"`
  1394. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  1395. // include in API requests with the JSON null value. By default, fields
  1396. // with empty values are omitted from API requests. However, any field
  1397. // with an empty value appearing in NullFields will be sent to the
  1398. // server as null. It is an error if a field in this list has a
  1399. // non-empty value. This may be used to include null fields in Patch
  1400. // requests.
  1401. NullFields []string `json:"-"`
  1402. }
  1403. func (s *AdBlockingConfiguration) MarshalJSON() ([]byte, error) {
  1404. type NoMethod AdBlockingConfiguration
  1405. raw := NoMethod(*s)
  1406. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1407. }
  1408. // AdSlot: Ad Slot
  1409. type AdSlot struct {
  1410. // Comment: Comment for this ad slot.
  1411. Comment string `json:"comment,omitempty"`
  1412. // Compatibility: Ad slot compatibility. DISPLAY and
  1413. // DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile
  1414. // devices or in mobile apps for regular or interstitial ads
  1415. // respectively. APP and APP_INTERSTITIAL are for rendering in mobile
  1416. // apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads
  1417. // developed with the VAST standard.
  1418. //
  1419. // Possible values:
  1420. // "APP"
  1421. // "APP_INTERSTITIAL"
  1422. // "DISPLAY"
  1423. // "DISPLAY_INTERSTITIAL"
  1424. // "IN_STREAM_AUDIO"
  1425. // "IN_STREAM_VIDEO"
  1426. Compatibility string `json:"compatibility,omitempty"`
  1427. // Height: Height of this ad slot.
  1428. Height int64 `json:"height,omitempty,string"`
  1429. // LinkedPlacementId: ID of the placement from an external platform that
  1430. // is linked to this ad slot.
  1431. LinkedPlacementId int64 `json:"linkedPlacementId,omitempty,string"`
  1432. // Name: Name of this ad slot.
  1433. Name string `json:"name,omitempty"`
  1434. // PaymentSourceType: Payment source type of this ad slot.
  1435. //
  1436. // Possible values:
  1437. // "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID"
  1438. // "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID"
  1439. PaymentSourceType string `json:"paymentSourceType,omitempty"`
  1440. // Primary: Primary ad slot of a roadblock inventory item.
  1441. Primary bool `json:"primary,omitempty"`
  1442. // Width: Width of this ad slot.
  1443. Width int64 `json:"width,omitempty,string"`
  1444. // ForceSendFields is a list of field names (e.g. "Comment") to
  1445. // unconditionally include in API requests. By default, fields with
  1446. // empty values are omitted from API requests. However, any non-pointer,
  1447. // non-interface field appearing in ForceSendFields will be sent to the
  1448. // server regardless of whether the field is empty or not. This may be
  1449. // used to include empty fields in Patch requests.
  1450. ForceSendFields []string `json:"-"`
  1451. // NullFields is a list of field names (e.g. "Comment") to include in
  1452. // API requests with the JSON null value. By default, fields with empty
  1453. // values are omitted from API requests. However, any field with an
  1454. // empty value appearing in NullFields will be sent to the server as
  1455. // null. It is an error if a field in this list has a non-empty value.
  1456. // This may be used to include null fields in Patch requests.
  1457. NullFields []string `json:"-"`
  1458. }
  1459. func (s *AdSlot) MarshalJSON() ([]byte, error) {
  1460. type NoMethod AdSlot
  1461. raw := NoMethod(*s)
  1462. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1463. }
  1464. // AdsListResponse: Ad List Response
  1465. type AdsListResponse struct {
  1466. // Ads: Ad collection.
  1467. Ads []*Ad `json:"ads,omitempty"`
  1468. // Kind: Identifies what kind of resource this is. Value: the fixed
  1469. // string "dfareporting#adsListResponse".
  1470. Kind string `json:"kind,omitempty"`
  1471. // NextPageToken: Pagination token to be used for the next list
  1472. // operation.
  1473. NextPageToken string `json:"nextPageToken,omitempty"`
  1474. // ServerResponse contains the HTTP response code and headers from the
  1475. // server.
  1476. googleapi.ServerResponse `json:"-"`
  1477. // ForceSendFields is a list of field names (e.g. "Ads") to
  1478. // unconditionally include in API requests. By default, fields with
  1479. // empty values are omitted from API requests. However, any non-pointer,
  1480. // non-interface field appearing in ForceSendFields will be sent to the
  1481. // server regardless of whether the field is empty or not. This may be
  1482. // used to include empty fields in Patch requests.
  1483. ForceSendFields []string `json:"-"`
  1484. // NullFields is a list of field names (e.g. "Ads") to include in API
  1485. // requests with the JSON null value. By default, fields with empty
  1486. // values are omitted from API requests. However, any field with an
  1487. // empty value appearing in NullFields will be sent to the server as
  1488. // null. It is an error if a field in this list has a non-empty value.
  1489. // This may be used to include null fields in Patch requests.
  1490. NullFields []string `json:"-"`
  1491. }
  1492. func (s *AdsListResponse) MarshalJSON() ([]byte, error) {
  1493. type NoMethod AdsListResponse
  1494. raw := NoMethod(*s)
  1495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1496. }
  1497. // Advertiser: Contains properties of a DCM advertiser.
  1498. type Advertiser struct {
  1499. // AccountId: Account ID of this advertiser.This is a read-only field
  1500. // that can be left blank.
  1501. AccountId int64 `json:"accountId,omitempty,string"`
  1502. // AdvertiserGroupId: ID of the advertiser group this advertiser belongs
  1503. // to. You can group advertisers for reporting purposes, allowing you to
  1504. // see aggregated information for all advertisers in each group.
  1505. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1506. // ClickThroughUrlSuffix: Suffix added to click-through URL of ad
  1507. // creative associations under this advertiser. Must be less than 129
  1508. // characters long.
  1509. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  1510. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  1511. // apply by default to the landing pages of this advertiser's campaigns.
  1512. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  1513. // DefaultEmail: Default email address used in sender field for tag
  1514. // emails.
  1515. DefaultEmail string `json:"defaultEmail,omitempty"`
  1516. // FloodlightConfigurationId: Floodlight configuration ID of this
  1517. // advertiser. The floodlight configuration ID will be created
  1518. // automatically, so on insert this field should be left blank. This
  1519. // field can be set to another advertiser's floodlight configuration ID
  1520. // in order to share that advertiser's floodlight configuration with
  1521. // this advertiser, so long as:
  1522. // - This advertiser's original floodlight configuration is not already
  1523. // associated with floodlight activities or floodlight activity groups.
  1524. //
  1525. // - This advertiser's original floodlight configuration is not already
  1526. // shared with another advertiser.
  1527. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  1528. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  1529. // of the floodlight configuration. This is a read-only, auto-generated
  1530. // field.
  1531. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  1532. // Id: ID of this advertiser. This is a read-only, auto-generated field.
  1533. Id int64 `json:"id,omitempty,string"`
  1534. // IdDimensionValue: Dimension value for the ID of this advertiser. This
  1535. // is a read-only, auto-generated field.
  1536. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1537. // Kind: Identifies what kind of resource this is. Value: the fixed
  1538. // string "dfareporting#advertiser".
  1539. Kind string `json:"kind,omitempty"`
  1540. // Name: Name of this advertiser. This is a required field and must be
  1541. // less than 256 characters long and unique among advertisers of the
  1542. // same account.
  1543. Name string `json:"name,omitempty"`
  1544. // OriginalFloodlightConfigurationId: Original floodlight configuration
  1545. // before any sharing occurred. Set the floodlightConfigurationId of
  1546. // this advertiser to originalFloodlightConfigurationId to unshare the
  1547. // advertiser's current floodlight configuration. You cannot unshare an
  1548. // advertiser's floodlight configuration if the shared configuration has
  1549. // activities associated with any campaign or placement.
  1550. OriginalFloodlightConfigurationId int64 `json:"originalFloodlightConfigurationId,omitempty,string"`
  1551. // Status: Status of this advertiser.
  1552. //
  1553. // Possible values:
  1554. // "APPROVED"
  1555. // "ON_HOLD"
  1556. Status string `json:"status,omitempty"`
  1557. // SubaccountId: Subaccount ID of this advertiser.This is a read-only
  1558. // field that can be left blank.
  1559. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1560. // Suspended: Suspension status of this advertiser.
  1561. Suspended bool `json:"suspended,omitempty"`
  1562. // ServerResponse contains the HTTP response code and headers from the
  1563. // server.
  1564. googleapi.ServerResponse `json:"-"`
  1565. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1566. // unconditionally include in API requests. By default, fields with
  1567. // empty values are omitted from API requests. However, any non-pointer,
  1568. // non-interface field appearing in ForceSendFields will be sent to the
  1569. // server regardless of whether the field is empty or not. This may be
  1570. // used to include empty fields in Patch requests.
  1571. ForceSendFields []string `json:"-"`
  1572. // NullFields is a list of field names (e.g. "AccountId") to include in
  1573. // API requests with the JSON null value. By default, fields with empty
  1574. // values are omitted from API requests. However, any field with an
  1575. // empty value appearing in NullFields will be sent to the server as
  1576. // null. It is an error if a field in this list has a non-empty value.
  1577. // This may be used to include null fields in Patch requests.
  1578. NullFields []string `json:"-"`
  1579. }
  1580. func (s *Advertiser) MarshalJSON() ([]byte, error) {
  1581. type NoMethod Advertiser
  1582. raw := NoMethod(*s)
  1583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1584. }
  1585. // AdvertiserGroup: Groups advertisers together so that reports can be
  1586. // generated for the entire group at once.
  1587. type AdvertiserGroup struct {
  1588. // AccountId: Account ID of this advertiser group. This is a read-only
  1589. // field that can be left blank.
  1590. AccountId int64 `json:"accountId,omitempty,string"`
  1591. // Id: ID of this advertiser group. This is a read-only, auto-generated
  1592. // field.
  1593. Id int64 `json:"id,omitempty,string"`
  1594. // Kind: Identifies what kind of resource this is. Value: the fixed
  1595. // string "dfareporting#advertiserGroup".
  1596. Kind string `json:"kind,omitempty"`
  1597. // Name: Name of this advertiser group. This is a required field and
  1598. // must be less than 256 characters long and unique among advertiser
  1599. // groups of the same account.
  1600. Name string `json:"name,omitempty"`
  1601. // ServerResponse contains the HTTP response code and headers from the
  1602. // server.
  1603. googleapi.ServerResponse `json:"-"`
  1604. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1605. // unconditionally include in API requests. By default, fields with
  1606. // empty values are omitted from API requests. However, any non-pointer,
  1607. // non-interface field appearing in ForceSendFields will be sent to the
  1608. // server regardless of whether the field is empty or not. This may be
  1609. // used to include empty fields in Patch requests.
  1610. ForceSendFields []string `json:"-"`
  1611. // NullFields is a list of field names (e.g. "AccountId") to include in
  1612. // API requests with the JSON null value. By default, fields with empty
  1613. // values are omitted from API requests. However, any field with an
  1614. // empty value appearing in NullFields will be sent to the server as
  1615. // null. It is an error if a field in this list has a non-empty value.
  1616. // This may be used to include null fields in Patch requests.
  1617. NullFields []string `json:"-"`
  1618. }
  1619. func (s *AdvertiserGroup) MarshalJSON() ([]byte, error) {
  1620. type NoMethod AdvertiserGroup
  1621. raw := NoMethod(*s)
  1622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1623. }
  1624. // AdvertiserGroupsListResponse: Advertiser Group List Response
  1625. type AdvertiserGroupsListResponse struct {
  1626. // AdvertiserGroups: Advertiser group collection.
  1627. AdvertiserGroups []*AdvertiserGroup `json:"advertiserGroups,omitempty"`
  1628. // Kind: Identifies what kind of resource this is. Value: the fixed
  1629. // string "dfareporting#advertiserGroupsListResponse".
  1630. Kind string `json:"kind,omitempty"`
  1631. // NextPageToken: Pagination token to be used for the next list
  1632. // operation.
  1633. NextPageToken string `json:"nextPageToken,omitempty"`
  1634. // ServerResponse contains the HTTP response code and headers from the
  1635. // server.
  1636. googleapi.ServerResponse `json:"-"`
  1637. // ForceSendFields is a list of field names (e.g. "AdvertiserGroups") to
  1638. // unconditionally include in API requests. By default, fields with
  1639. // empty values are omitted from API requests. However, any non-pointer,
  1640. // non-interface field appearing in ForceSendFields will be sent to the
  1641. // server regardless of whether the field is empty or not. This may be
  1642. // used to include empty fields in Patch requests.
  1643. ForceSendFields []string `json:"-"`
  1644. // NullFields is a list of field names (e.g. "AdvertiserGroups") to
  1645. // include in API requests with the JSON null value. By default, fields
  1646. // with empty values are omitted from API requests. However, any field
  1647. // with an empty value appearing in NullFields will be sent to the
  1648. // server as null. It is an error if a field in this list has a
  1649. // non-empty value. This may be used to include null fields in Patch
  1650. // requests.
  1651. NullFields []string `json:"-"`
  1652. }
  1653. func (s *AdvertiserGroupsListResponse) MarshalJSON() ([]byte, error) {
  1654. type NoMethod AdvertiserGroupsListResponse
  1655. raw := NoMethod(*s)
  1656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1657. }
  1658. // AdvertiserLandingPagesListResponse: Landing Page List Response
  1659. type AdvertiserLandingPagesListResponse struct {
  1660. // Kind: Identifies what kind of resource this is. Value: the fixed
  1661. // string "dfareporting#advertiserLandingPagesListResponse".
  1662. Kind string `json:"kind,omitempty"`
  1663. // LandingPages: Landing page collection
  1664. LandingPages []*LandingPage `json:"landingPages,omitempty"`
  1665. // NextPageToken: Pagination token to be used for the next list
  1666. // operation.
  1667. NextPageToken string `json:"nextPageToken,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. "Kind") 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. "Kind") to include in API
  1679. // 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 *AdvertiserLandingPagesListResponse) MarshalJSON() ([]byte, error) {
  1687. type NoMethod AdvertiserLandingPagesListResponse
  1688. raw := NoMethod(*s)
  1689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1690. }
  1691. // AdvertisersListResponse: Advertiser List Response
  1692. type AdvertisersListResponse struct {
  1693. // Advertisers: Advertiser collection.
  1694. Advertisers []*Advertiser `json:"advertisers,omitempty"`
  1695. // Kind: Identifies what kind of resource this is. Value: the fixed
  1696. // string "dfareporting#advertisersListResponse".
  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. "Advertisers") 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. "Advertisers") to include
  1712. // in API requests with the JSON null value. By default, fields with
  1713. // empty values are omitted from API requests. However, any field with
  1714. // an empty value appearing in NullFields will be sent to the server as
  1715. // null. It is an error if a field in this list has a non-empty value.
  1716. // This may be used to include null fields in Patch requests.
  1717. NullFields []string `json:"-"`
  1718. }
  1719. func (s *AdvertisersListResponse) MarshalJSON() ([]byte, error) {
  1720. type NoMethod AdvertisersListResponse
  1721. raw := NoMethod(*s)
  1722. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1723. }
  1724. // AudienceSegment: Audience Segment.
  1725. type AudienceSegment struct {
  1726. // Allocation: Weight allocated to this segment. The weight assigned
  1727. // will be understood in proportion to the weights assigned to other
  1728. // segments in the same segment group. Acceptable values are 1 to 1000,
  1729. // inclusive.
  1730. Allocation int64 `json:"allocation,omitempty"`
  1731. // Id: ID of this audience segment. This is a read-only, auto-generated
  1732. // field.
  1733. Id int64 `json:"id,omitempty,string"`
  1734. // Name: Name of this audience segment. This is a required field and
  1735. // must be less than 65 characters long.
  1736. Name string `json:"name,omitempty"`
  1737. // ForceSendFields is a list of field names (e.g. "Allocation") to
  1738. // unconditionally include in API requests. By default, fields with
  1739. // empty values are omitted from API requests. However, any non-pointer,
  1740. // non-interface field appearing in ForceSendFields will be sent to the
  1741. // server regardless of whether the field is empty or not. This may be
  1742. // used to include empty fields in Patch requests.
  1743. ForceSendFields []string `json:"-"`
  1744. // NullFields is a list of field names (e.g. "Allocation") to include in
  1745. // API requests with the JSON null value. By default, fields with empty
  1746. // values are omitted from API requests. However, any field with an
  1747. // empty value appearing in NullFields will be sent to the server as
  1748. // null. It is an error if a field in this list has a non-empty value.
  1749. // This may be used to include null fields in Patch requests.
  1750. NullFields []string `json:"-"`
  1751. }
  1752. func (s *AudienceSegment) MarshalJSON() ([]byte, error) {
  1753. type NoMethod AudienceSegment
  1754. raw := NoMethod(*s)
  1755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1756. }
  1757. // AudienceSegmentGroup: Audience Segment Group.
  1758. type AudienceSegmentGroup struct {
  1759. // AudienceSegments: Audience segments assigned to this group. The
  1760. // number of segments must be between 2 and 100.
  1761. AudienceSegments []*AudienceSegment `json:"audienceSegments,omitempty"`
  1762. // Id: ID of this audience segment group. This is a read-only,
  1763. // auto-generated field.
  1764. Id int64 `json:"id,omitempty,string"`
  1765. // Name: Name of this audience segment group. This is a required field
  1766. // and must be less than 65 characters long.
  1767. Name string `json:"name,omitempty"`
  1768. // ForceSendFields is a list of field names (e.g. "AudienceSegments") to
  1769. // unconditionally include in API requests. By default, fields with
  1770. // empty values are omitted from API requests. However, any non-pointer,
  1771. // non-interface field appearing in ForceSendFields will be sent to the
  1772. // server regardless of whether the field is empty or not. This may be
  1773. // used to include empty fields in Patch requests.
  1774. ForceSendFields []string `json:"-"`
  1775. // NullFields is a list of field names (e.g. "AudienceSegments") to
  1776. // include in API requests with the JSON null value. By default, fields
  1777. // with empty values are omitted from API requests. However, any field
  1778. // with an empty value appearing in NullFields will be sent to the
  1779. // server as null. It is an error if a field in this list has a
  1780. // non-empty value. This may be used to include null fields in Patch
  1781. // requests.
  1782. NullFields []string `json:"-"`
  1783. }
  1784. func (s *AudienceSegmentGroup) MarshalJSON() ([]byte, error) {
  1785. type NoMethod AudienceSegmentGroup
  1786. raw := NoMethod(*s)
  1787. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1788. }
  1789. // Browser: Contains information about a browser that can be targeted by
  1790. // ads.
  1791. type Browser struct {
  1792. // BrowserVersionId: ID referring to this grouping of browser and
  1793. // version numbers. This is the ID used for targeting.
  1794. BrowserVersionId int64 `json:"browserVersionId,omitempty,string"`
  1795. // DartId: DART ID of this browser. This is the ID used when generating
  1796. // reports.
  1797. DartId int64 `json:"dartId,omitempty,string"`
  1798. // Kind: Identifies what kind of resource this is. Value: the fixed
  1799. // string "dfareporting#browser".
  1800. Kind string `json:"kind,omitempty"`
  1801. // MajorVersion: Major version number (leftmost number) of this browser.
  1802. // For example, for Chrome 5.0.376.86 beta, this field should be set to
  1803. // 5. An asterisk (*) may be used to target any version number, and a
  1804. // question mark (?) may be used to target cases where the version
  1805. // number cannot be identified. For example, Chrome *.* targets any
  1806. // version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1807. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1808. // server knows the browser is Firefox but can't tell which version it
  1809. // is.
  1810. MajorVersion string `json:"majorVersion,omitempty"`
  1811. // MinorVersion: Minor version number (number after first dot on left)
  1812. // of this browser. For example, for Chrome 5.0.375.86 beta, this field
  1813. // should be set to 0. An asterisk (*) may be used to target any version
  1814. // number, and a question mark (?) may be used to target cases where the
  1815. // version number cannot be identified. For example, Chrome *.* targets
  1816. // any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1817. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1818. // server knows the browser is Firefox but can't tell which version it
  1819. // is.
  1820. MinorVersion string `json:"minorVersion,omitempty"`
  1821. // Name: Name of this browser.
  1822. Name string `json:"name,omitempty"`
  1823. // ForceSendFields is a list of field names (e.g. "BrowserVersionId") to
  1824. // unconditionally include in API requests. By default, fields with
  1825. // empty values are omitted from API requests. However, any non-pointer,
  1826. // non-interface field appearing in ForceSendFields will be sent to the
  1827. // server regardless of whether the field is empty or not. This may be
  1828. // used to include empty fields in Patch requests.
  1829. ForceSendFields []string `json:"-"`
  1830. // NullFields is a list of field names (e.g. "BrowserVersionId") to
  1831. // include in API requests with the JSON null value. By default, fields
  1832. // with empty values are omitted from API requests. However, any field
  1833. // with an empty value appearing in NullFields will be sent to the
  1834. // server as null. It is an error if a field in this list has a
  1835. // non-empty value. This may be used to include null fields in Patch
  1836. // requests.
  1837. NullFields []string `json:"-"`
  1838. }
  1839. func (s *Browser) MarshalJSON() ([]byte, error) {
  1840. type NoMethod Browser
  1841. raw := NoMethod(*s)
  1842. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1843. }
  1844. // BrowsersListResponse: Browser List Response
  1845. type BrowsersListResponse struct {
  1846. // Browsers: Browser collection.
  1847. Browsers []*Browser `json:"browsers,omitempty"`
  1848. // Kind: Identifies what kind of resource this is. Value: the fixed
  1849. // string "dfareporting#browsersListResponse".
  1850. Kind string `json:"kind,omitempty"`
  1851. // ServerResponse contains the HTTP response code and headers from the
  1852. // server.
  1853. googleapi.ServerResponse `json:"-"`
  1854. // ForceSendFields is a list of field names (e.g. "Browsers") to
  1855. // unconditionally include in API requests. By default, fields with
  1856. // empty values are omitted from API requests. However, any non-pointer,
  1857. // non-interface field appearing in ForceSendFields will be sent to the
  1858. // server regardless of whether the field is empty or not. This may be
  1859. // used to include empty fields in Patch requests.
  1860. ForceSendFields []string `json:"-"`
  1861. // NullFields is a list of field names (e.g. "Browsers") to include in
  1862. // API requests with the JSON null value. By default, fields with empty
  1863. // values are omitted from API requests. However, any field with an
  1864. // empty value appearing in NullFields will be sent to the server as
  1865. // null. It is an error if a field in this list has a non-empty value.
  1866. // This may be used to include null fields in Patch requests.
  1867. NullFields []string `json:"-"`
  1868. }
  1869. func (s *BrowsersListResponse) MarshalJSON() ([]byte, error) {
  1870. type NoMethod BrowsersListResponse
  1871. raw := NoMethod(*s)
  1872. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1873. }
  1874. // Campaign: Contains properties of a DCM campaign.
  1875. type Campaign struct {
  1876. // AccountId: Account ID of this campaign. This is a read-only field
  1877. // that can be left blank.
  1878. AccountId int64 `json:"accountId,omitempty,string"`
  1879. // AdBlockingConfiguration: Ad blocking settings for this campaign.
  1880. AdBlockingConfiguration *AdBlockingConfiguration `json:"adBlockingConfiguration,omitempty"`
  1881. // AdditionalCreativeOptimizationConfigurations: Additional creative
  1882. // optimization configurations for the campaign.
  1883. AdditionalCreativeOptimizationConfigurations []*CreativeOptimizationConfiguration `json:"additionalCreativeOptimizationConfigurations,omitempty"`
  1884. // AdvertiserGroupId: Advertiser group ID of the associated advertiser.
  1885. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1886. // AdvertiserId: Advertiser ID of this campaign. This is a required
  1887. // field.
  1888. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1889. // AdvertiserIdDimensionValue: Dimension value for the advertiser ID of
  1890. // this campaign. This is a read-only, auto-generated field.
  1891. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1892. // Archived: Whether this campaign has been archived.
  1893. Archived bool `json:"archived,omitempty"`
  1894. // AudienceSegmentGroups: Audience segment groups assigned to this
  1895. // campaign. Cannot have more than 300 segment groups.
  1896. AudienceSegmentGroups []*AudienceSegmentGroup `json:"audienceSegmentGroups,omitempty"`
  1897. // BillingInvoiceCode: Billing invoice code included in the DCM client
  1898. // billing invoices associated with the campaign.
  1899. BillingInvoiceCode string `json:"billingInvoiceCode,omitempty"`
  1900. // ClickThroughUrlSuffixProperties: Click-through URL suffix override
  1901. // properties for this campaign.
  1902. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1903. // Comment: Arbitrary comments about this campaign. Must be less than
  1904. // 256 characters long.
  1905. Comment string `json:"comment,omitempty"`
  1906. // CreateInfo: Information about the creation of this campaign. This is
  1907. // a read-only field.
  1908. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1909. // CreativeGroupIds: List of creative group IDs that are assigned to the
  1910. // campaign.
  1911. CreativeGroupIds googleapi.Int64s `json:"creativeGroupIds,omitempty"`
  1912. // CreativeOptimizationConfiguration: Creative optimization
  1913. // configuration for the campaign.
  1914. CreativeOptimizationConfiguration *CreativeOptimizationConfiguration `json:"creativeOptimizationConfiguration,omitempty"`
  1915. // DefaultClickThroughEventTagProperties: Click-through event tag ID
  1916. // override properties for this campaign.
  1917. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1918. // DefaultLandingPageId: The default landing page ID for this campaign.
  1919. DefaultLandingPageId int64 `json:"defaultLandingPageId,omitempty,string"`
  1920. // EndDate: Date on which the campaign will stop running. On insert, the
  1921. // end date must be today or a future date. The end date must be later
  1922. // than or be the same as the start date. If, for example, you set
  1923. // 6/25/2015 as both the start and end dates, the effective campaign run
  1924. // date is just that day only, 6/25/2015. The hours, minutes, and
  1925. // seconds of the end date should not be set, as doing so will result in
  1926. // an error. This is a required field.
  1927. EndDate string `json:"endDate,omitempty"`
  1928. // EventTagOverrides: Overrides that can be used to activate or
  1929. // deactivate advertiser event tags.
  1930. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1931. // ExternalId: External ID for this campaign.
  1932. ExternalId string `json:"externalId,omitempty"`
  1933. // Id: ID of this campaign. This is a read-only auto-generated field.
  1934. Id int64 `json:"id,omitempty,string"`
  1935. // IdDimensionValue: Dimension value for the ID of this campaign. This
  1936. // is a read-only, auto-generated field.
  1937. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1938. // Kind: Identifies what kind of resource this is. Value: the fixed
  1939. // string "dfareporting#campaign".
  1940. Kind string `json:"kind,omitempty"`
  1941. // LastModifiedInfo: Information about the most recent modification of
  1942. // this campaign. This is a read-only field.
  1943. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1944. // LookbackConfiguration: Lookback window settings for the campaign.
  1945. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  1946. // Name: Name of this campaign. This is a required field and must be
  1947. // less than 256 characters long and unique among campaigns of the same
  1948. // advertiser.
  1949. Name string `json:"name,omitempty"`
  1950. // NielsenOcrEnabled: Whether Nielsen reports are enabled for this
  1951. // campaign.
  1952. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  1953. // StartDate: Date on which the campaign starts running. The start date
  1954. // can be any date. The hours, minutes, and seconds of the start date
  1955. // should not be set, as doing so will result in an error. This is a
  1956. // required field.
  1957. StartDate string `json:"startDate,omitempty"`
  1958. // SubaccountId: Subaccount ID of this campaign. This is a read-only
  1959. // field that can be left blank.
  1960. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1961. // TraffickerEmails: Campaign trafficker contact emails.
  1962. TraffickerEmails []string `json:"traffickerEmails,omitempty"`
  1963. // ServerResponse contains the HTTP response code and headers from the
  1964. // server.
  1965. googleapi.ServerResponse `json:"-"`
  1966. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1967. // unconditionally include in API requests. By default, fields with
  1968. // empty values are omitted from API requests. However, any non-pointer,
  1969. // non-interface field appearing in ForceSendFields will be sent to the
  1970. // server regardless of whether the field is empty or not. This may be
  1971. // used to include empty fields in Patch requests.
  1972. ForceSendFields []string `json:"-"`
  1973. // NullFields is a list of field names (e.g. "AccountId") to include in
  1974. // API requests with the JSON null value. By default, fields with empty
  1975. // values are omitted from API requests. However, any field with an
  1976. // empty value appearing in NullFields will be sent to the server as
  1977. // null. It is an error if a field in this list has a non-empty value.
  1978. // This may be used to include null fields in Patch requests.
  1979. NullFields []string `json:"-"`
  1980. }
  1981. func (s *Campaign) MarshalJSON() ([]byte, error) {
  1982. type NoMethod Campaign
  1983. raw := NoMethod(*s)
  1984. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1985. }
  1986. // CampaignCreativeAssociation: Identifies a creative which has been
  1987. // associated with a given campaign.
  1988. type CampaignCreativeAssociation struct {
  1989. // CreativeId: ID of the creative associated with the campaign. This is
  1990. // a required field.
  1991. CreativeId int64 `json:"creativeId,omitempty,string"`
  1992. // Kind: Identifies what kind of resource this is. Value: the fixed
  1993. // string "dfareporting#campaignCreativeAssociation".
  1994. Kind string `json:"kind,omitempty"`
  1995. // ServerResponse contains the HTTP response code and headers from the
  1996. // server.
  1997. googleapi.ServerResponse `json:"-"`
  1998. // ForceSendFields is a list of field names (e.g. "CreativeId") to
  1999. // unconditionally include in API requests. By default, fields with
  2000. // empty values are omitted from API requests. However, any non-pointer,
  2001. // non-interface field appearing in ForceSendFields will be sent to the
  2002. // server regardless of whether the field is empty or not. This may be
  2003. // used to include empty fields in Patch requests.
  2004. ForceSendFields []string `json:"-"`
  2005. // NullFields is a list of field names (e.g. "CreativeId") to include in
  2006. // API requests with the JSON null value. By default, fields with empty
  2007. // values are omitted from API requests. However, any field with an
  2008. // empty value appearing in NullFields will be sent to the server as
  2009. // null. It is an error if a field in this list has a non-empty value.
  2010. // This may be used to include null fields in Patch requests.
  2011. NullFields []string `json:"-"`
  2012. }
  2013. func (s *CampaignCreativeAssociation) MarshalJSON() ([]byte, error) {
  2014. type NoMethod CampaignCreativeAssociation
  2015. raw := NoMethod(*s)
  2016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2017. }
  2018. // CampaignCreativeAssociationsListResponse: Campaign Creative
  2019. // Association List Response
  2020. type CampaignCreativeAssociationsListResponse struct {
  2021. // CampaignCreativeAssociations: Campaign creative association
  2022. // collection
  2023. CampaignCreativeAssociations []*CampaignCreativeAssociation `json:"campaignCreativeAssociations,omitempty"`
  2024. // Kind: Identifies what kind of resource this is. Value: the fixed
  2025. // string "dfareporting#campaignCreativeAssociationsListResponse".
  2026. Kind string `json:"kind,omitempty"`
  2027. // NextPageToken: Pagination token to be used for the next list
  2028. // operation.
  2029. NextPageToken string `json:"nextPageToken,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.
  2034. // "CampaignCreativeAssociations") to unconditionally include in API
  2035. // requests. By default, fields with empty values are omitted from API
  2036. // requests. However, any non-pointer, non-interface field appearing in
  2037. // ForceSendFields will be sent to the server regardless of whether the
  2038. // field is empty or not. This may be used to include empty fields in
  2039. // Patch requests.
  2040. ForceSendFields []string `json:"-"`
  2041. // NullFields is a list of field names (e.g.
  2042. // "CampaignCreativeAssociations") to include in API requests with the
  2043. // JSON null value. By default, fields with empty values are omitted
  2044. // from API requests. However, any field with an empty value appearing
  2045. // in NullFields will be sent to the server as null. It is an error if a
  2046. // field in this list has a non-empty value. This may be used to include
  2047. // null fields in Patch requests.
  2048. NullFields []string `json:"-"`
  2049. }
  2050. func (s *CampaignCreativeAssociationsListResponse) MarshalJSON() ([]byte, error) {
  2051. type NoMethod CampaignCreativeAssociationsListResponse
  2052. raw := NoMethod(*s)
  2053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2054. }
  2055. // CampaignsListResponse: Campaign List Response
  2056. type CampaignsListResponse struct {
  2057. // Campaigns: Campaign collection.
  2058. Campaigns []*Campaign `json:"campaigns,omitempty"`
  2059. // Kind: Identifies what kind of resource this is. Value: the fixed
  2060. // string "dfareporting#campaignsListResponse".
  2061. Kind string `json:"kind,omitempty"`
  2062. // NextPageToken: Pagination token to be used for the next list
  2063. // operation.
  2064. NextPageToken string `json:"nextPageToken,omitempty"`
  2065. // ServerResponse contains the HTTP response code and headers from the
  2066. // server.
  2067. googleapi.ServerResponse `json:"-"`
  2068. // ForceSendFields is a list of field names (e.g. "Campaigns") to
  2069. // unconditionally include in API requests. By default, fields with
  2070. // empty values are omitted from API requests. However, any non-pointer,
  2071. // non-interface field appearing in ForceSendFields will be sent to the
  2072. // server regardless of whether the field is empty or not. This may be
  2073. // used to include empty fields in Patch requests.
  2074. ForceSendFields []string `json:"-"`
  2075. // NullFields is a list of field names (e.g. "Campaigns") to include in
  2076. // API requests with the JSON null value. By default, fields with empty
  2077. // values are omitted from API requests. However, any field with an
  2078. // empty value appearing in NullFields will be sent to the server as
  2079. // null. It is an error if a field in this list has a non-empty value.
  2080. // This may be used to include null fields in Patch requests.
  2081. NullFields []string `json:"-"`
  2082. }
  2083. func (s *CampaignsListResponse) MarshalJSON() ([]byte, error) {
  2084. type NoMethod CampaignsListResponse
  2085. raw := NoMethod(*s)
  2086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2087. }
  2088. // ChangeLog: Describes a change that a user has made to a resource.
  2089. type ChangeLog struct {
  2090. // AccountId: Account ID of the modified object.
  2091. AccountId int64 `json:"accountId,omitempty,string"`
  2092. // Action: Action which caused the change.
  2093. Action string `json:"action,omitempty"`
  2094. // ChangeTime: Time when the object was modified.
  2095. ChangeTime string `json:"changeTime,omitempty"`
  2096. // FieldName: Field name of the object which changed.
  2097. FieldName string `json:"fieldName,omitempty"`
  2098. // Id: ID of this change log.
  2099. Id int64 `json:"id,omitempty,string"`
  2100. // Kind: Identifies what kind of resource this is. Value: the fixed
  2101. // string "dfareporting#changeLog".
  2102. Kind string `json:"kind,omitempty"`
  2103. // NewValue: New value of the object field.
  2104. NewValue string `json:"newValue,omitempty"`
  2105. // ObjectId: ID of the object of this change log. The object could be a
  2106. // campaign, placement, ad, or other type.
  2107. ObjectId int64 `json:"objectId,omitempty,string"`
  2108. // ObjectType: Object type of the change log.
  2109. ObjectType string `json:"objectType,omitempty"`
  2110. // OldValue: Old value of the object field.
  2111. OldValue string `json:"oldValue,omitempty"`
  2112. // SubaccountId: Subaccount ID of the modified object.
  2113. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  2114. // TransactionId: Transaction ID of this change log. When a single API
  2115. // call results in many changes, each change will have a separate ID in
  2116. // the change log but will share the same transactionId.
  2117. TransactionId int64 `json:"transactionId,omitempty,string"`
  2118. // UserProfileId: ID of the user who modified the object.
  2119. UserProfileId int64 `json:"userProfileId,omitempty,string"`
  2120. // UserProfileName: User profile name of the user who modified the
  2121. // object.
  2122. UserProfileName string `json:"userProfileName,omitempty"`
  2123. // ServerResponse contains the HTTP response code and headers from the
  2124. // server.
  2125. googleapi.ServerResponse `json:"-"`
  2126. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2127. // unconditionally include in API requests. By default, fields with
  2128. // empty values are omitted from API requests. However, any non-pointer,
  2129. // non-interface field appearing in ForceSendFields will be sent to the
  2130. // server regardless of whether the field is empty or not. This may be
  2131. // used to include empty fields in Patch requests.
  2132. ForceSendFields []string `json:"-"`
  2133. // NullFields is a list of field names (e.g. "AccountId") to include in
  2134. // API requests with the JSON null value. By default, fields with empty
  2135. // values are omitted from API requests. However, any field with an
  2136. // empty value appearing in NullFields will be sent to the server as
  2137. // null. It is an error if a field in this list has a non-empty value.
  2138. // This may be used to include null fields in Patch requests.
  2139. NullFields []string `json:"-"`
  2140. }
  2141. func (s *ChangeLog) MarshalJSON() ([]byte, error) {
  2142. type NoMethod ChangeLog
  2143. raw := NoMethod(*s)
  2144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2145. }
  2146. // ChangeLogsListResponse: Change Log List Response
  2147. type ChangeLogsListResponse struct {
  2148. // ChangeLogs: Change log collection.
  2149. ChangeLogs []*ChangeLog `json:"changeLogs,omitempty"`
  2150. // Kind: Identifies what kind of resource this is. Value: the fixed
  2151. // string "dfareporting#changeLogsListResponse".
  2152. Kind string `json:"kind,omitempty"`
  2153. // NextPageToken: Pagination token to be used for the next list
  2154. // operation.
  2155. NextPageToken string `json:"nextPageToken,omitempty"`
  2156. // ServerResponse contains the HTTP response code and headers from the
  2157. // server.
  2158. googleapi.ServerResponse `json:"-"`
  2159. // ForceSendFields is a list of field names (e.g. "ChangeLogs") to
  2160. // unconditionally include in API requests. By default, fields with
  2161. // empty values are omitted from API requests. However, any non-pointer,
  2162. // non-interface field appearing in ForceSendFields will be sent to the
  2163. // server regardless of whether the field is empty or not. This may be
  2164. // used to include empty fields in Patch requests.
  2165. ForceSendFields []string `json:"-"`
  2166. // NullFields is a list of field names (e.g. "ChangeLogs") to include in
  2167. // API requests with the JSON null value. By default, fields with empty
  2168. // values are omitted from API requests. However, any field with an
  2169. // empty value appearing in NullFields will be sent to the server as
  2170. // null. It is an error if a field in this list has a non-empty value.
  2171. // This may be used to include null fields in Patch requests.
  2172. NullFields []string `json:"-"`
  2173. }
  2174. func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) {
  2175. type NoMethod ChangeLogsListResponse
  2176. raw := NoMethod(*s)
  2177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2178. }
  2179. // CitiesListResponse: City List Response
  2180. type CitiesListResponse struct {
  2181. // Cities: City collection.
  2182. Cities []*City `json:"cities,omitempty"`
  2183. // Kind: Identifies what kind of resource this is. Value: the fixed
  2184. // string "dfareporting#citiesListResponse".
  2185. Kind string `json:"kind,omitempty"`
  2186. // ServerResponse contains the HTTP response code and headers from the
  2187. // server.
  2188. googleapi.ServerResponse `json:"-"`
  2189. // ForceSendFields is a list of field names (e.g. "Cities") to
  2190. // unconditionally include in API requests. By default, fields with
  2191. // empty values are omitted from API requests. However, any non-pointer,
  2192. // non-interface field appearing in ForceSendFields will be sent to the
  2193. // server regardless of whether the field is empty or not. This may be
  2194. // used to include empty fields in Patch requests.
  2195. ForceSendFields []string `json:"-"`
  2196. // NullFields is a list of field names (e.g. "Cities") to include in API
  2197. // requests with the JSON null value. By default, fields with empty
  2198. // values are omitted from API requests. However, any field with an
  2199. // empty value appearing in NullFields will be sent to the server as
  2200. // null. It is an error if a field in this list has a non-empty value.
  2201. // This may be used to include null fields in Patch requests.
  2202. NullFields []string `json:"-"`
  2203. }
  2204. func (s *CitiesListResponse) MarshalJSON() ([]byte, error) {
  2205. type NoMethod CitiesListResponse
  2206. raw := NoMethod(*s)
  2207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2208. }
  2209. // City: Contains information about a city that can be targeted by ads.
  2210. type City struct {
  2211. // CountryCode: Country code of the country to which this city belongs.
  2212. CountryCode string `json:"countryCode,omitempty"`
  2213. // CountryDartId: DART ID of the country to which this city belongs.
  2214. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  2215. // DartId: DART ID of this city. This is the ID used for targeting and
  2216. // generating reports.
  2217. DartId int64 `json:"dartId,omitempty,string"`
  2218. // Kind: Identifies what kind of resource this is. Value: the fixed
  2219. // string "dfareporting#city".
  2220. Kind string `json:"kind,omitempty"`
  2221. // MetroCode: Metro region code of the metro region (DMA) to which this
  2222. // city belongs.
  2223. MetroCode string `json:"metroCode,omitempty"`
  2224. // MetroDmaId: ID of the metro region (DMA) to which this city belongs.
  2225. MetroDmaId int64 `json:"metroDmaId,omitempty,string"`
  2226. // Name: Name of this city.
  2227. Name string `json:"name,omitempty"`
  2228. // RegionCode: Region code of the region to which this city belongs.
  2229. RegionCode string `json:"regionCode,omitempty"`
  2230. // RegionDartId: DART ID of the region to which this city belongs.
  2231. RegionDartId int64 `json:"regionDartId,omitempty,string"`
  2232. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2233. // unconditionally include in API requests. By default, fields with
  2234. // empty values are omitted from API requests. However, any non-pointer,
  2235. // non-interface field appearing in ForceSendFields will be sent to the
  2236. // server regardless of whether the field is empty or not. This may be
  2237. // used to include empty fields in Patch requests.
  2238. ForceSendFields []string `json:"-"`
  2239. // NullFields is a list of field names (e.g. "CountryCode") to include
  2240. // in API requests with the JSON null value. By default, fields with
  2241. // empty values are omitted from API requests. However, any field with
  2242. // an empty value appearing in NullFields will be sent to the server as
  2243. // null. It is an error if a field in this list has a non-empty value.
  2244. // This may be used to include null fields in Patch requests.
  2245. NullFields []string `json:"-"`
  2246. }
  2247. func (s *City) MarshalJSON() ([]byte, error) {
  2248. type NoMethod City
  2249. raw := NoMethod(*s)
  2250. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2251. }
  2252. // ClickTag: Creative Click Tag.
  2253. type ClickTag struct {
  2254. // ClickThroughUrl: Parameter value for the specified click tag. This
  2255. // field contains a click-through url.
  2256. ClickThroughUrl *CreativeClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2257. // EventName: Advertiser event name associated with the click tag. This
  2258. // field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives.
  2259. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  2260. EventName string `json:"eventName,omitempty"`
  2261. // Name: Parameter name for the specified click tag. For
  2262. // DISPLAY_IMAGE_GALLERY creative assets, this field must match the
  2263. // value of the creative asset's creativeAssetId.name field.
  2264. Name string `json:"name,omitempty"`
  2265. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2266. // unconditionally include in API requests. By default, fields with
  2267. // empty values are omitted from API requests. However, any non-pointer,
  2268. // non-interface field appearing in ForceSendFields will be sent to the
  2269. // server regardless of whether the field is empty or not. This may be
  2270. // used to include empty fields in Patch requests.
  2271. ForceSendFields []string `json:"-"`
  2272. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2273. // include in API requests with the JSON null value. By default, fields
  2274. // with empty values are omitted from API requests. However, any field
  2275. // with an empty value appearing in NullFields will be sent to the
  2276. // server as null. It is an error if a field in this list has a
  2277. // non-empty value. This may be used to include null fields in Patch
  2278. // requests.
  2279. NullFields []string `json:"-"`
  2280. }
  2281. func (s *ClickTag) MarshalJSON() ([]byte, error) {
  2282. type NoMethod ClickTag
  2283. raw := NoMethod(*s)
  2284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2285. }
  2286. // ClickThroughUrl: Click-through URL
  2287. type ClickThroughUrl struct {
  2288. // ComputedClickThroughUrl: Read-only convenience field representing the
  2289. // actual URL that will be used for this click-through. The URL is
  2290. // computed as follows:
  2291. // - If defaultLandingPage is enabled then the campaign's default
  2292. // landing page URL is assigned to this field.
  2293. // - If defaultLandingPage is not enabled and a landingPageId is
  2294. // specified then that landing page's URL is assigned to this field.
  2295. // - If neither of the above cases apply, then the customClickThroughUrl
  2296. // is assigned to this field.
  2297. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  2298. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  2299. // defaultLandingPage field is set to false and the landingPageId field
  2300. // is left unset.
  2301. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  2302. // DefaultLandingPage: Whether the campaign default landing page is
  2303. // used.
  2304. DefaultLandingPage bool `json:"defaultLandingPage,omitempty"`
  2305. // LandingPageId: ID of the landing page for the click-through URL.
  2306. // Applicable if the defaultLandingPage field is set to false.
  2307. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  2308. // ForceSendFields is a list of field names (e.g.
  2309. // "ComputedClickThroughUrl") to unconditionally include in API
  2310. // requests. By default, fields with empty values are omitted from API
  2311. // requests. However, any non-pointer, non-interface field appearing in
  2312. // ForceSendFields will be sent to the server regardless of whether the
  2313. // field is empty or not. This may be used to include empty fields in
  2314. // Patch requests.
  2315. ForceSendFields []string `json:"-"`
  2316. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  2317. // to include in API requests with the JSON null value. By default,
  2318. // fields with empty values are omitted from API requests. However, any
  2319. // field with an empty value appearing in NullFields will be sent to the
  2320. // server as null. It is an error if a field in this list has a
  2321. // non-empty value. This may be used to include null fields in Patch
  2322. // requests.
  2323. NullFields []string `json:"-"`
  2324. }
  2325. func (s *ClickThroughUrl) MarshalJSON() ([]byte, error) {
  2326. type NoMethod ClickThroughUrl
  2327. raw := NoMethod(*s)
  2328. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2329. }
  2330. // ClickThroughUrlSuffixProperties: Click Through URL Suffix settings.
  2331. type ClickThroughUrlSuffixProperties struct {
  2332. // ClickThroughUrlSuffix: Click-through URL suffix to apply to all ads
  2333. // in this entity's scope. Must be less than 128 characters long.
  2334. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  2335. // OverrideInheritedSuffix: Whether this entity should override the
  2336. // inherited click-through URL suffix with its own defined value.
  2337. OverrideInheritedSuffix bool `json:"overrideInheritedSuffix,omitempty"`
  2338. // ForceSendFields is a list of field names (e.g.
  2339. // "ClickThroughUrlSuffix") to unconditionally include in API requests.
  2340. // By default, fields with empty values are omitted from API requests.
  2341. // However, any non-pointer, non-interface field appearing in
  2342. // ForceSendFields will be sent to the server regardless of whether the
  2343. // field is empty or not. This may be used to include empty fields in
  2344. // Patch requests.
  2345. ForceSendFields []string `json:"-"`
  2346. // NullFields is a list of field names (e.g. "ClickThroughUrlSuffix") to
  2347. // include in API requests with the JSON null value. By default, fields
  2348. // with empty values are omitted from API requests. However, any field
  2349. // with an empty value appearing in NullFields will be sent to the
  2350. // server as null. It is an error if a field in this list has a
  2351. // non-empty value. This may be used to include null fields in Patch
  2352. // requests.
  2353. NullFields []string `json:"-"`
  2354. }
  2355. func (s *ClickThroughUrlSuffixProperties) MarshalJSON() ([]byte, error) {
  2356. type NoMethod ClickThroughUrlSuffixProperties
  2357. raw := NoMethod(*s)
  2358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2359. }
  2360. // CompanionClickThroughOverride: Companion Click-through override.
  2361. type CompanionClickThroughOverride struct {
  2362. // ClickThroughUrl: Click-through URL of this companion click-through
  2363. // override.
  2364. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2365. // CreativeId: ID of the creative for this companion click-through
  2366. // override.
  2367. CreativeId int64 `json:"creativeId,omitempty,string"`
  2368. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2369. // unconditionally include in API requests. By default, fields with
  2370. // empty values are omitted from API requests. However, any non-pointer,
  2371. // non-interface field appearing in ForceSendFields will be sent to the
  2372. // server regardless of whether the field is empty or not. This may be
  2373. // used to include empty fields in Patch requests.
  2374. ForceSendFields []string `json:"-"`
  2375. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2376. // include in API requests with the JSON null value. By default, fields
  2377. // with empty values are omitted from API requests. However, any field
  2378. // with an empty value appearing in NullFields will be sent to the
  2379. // server as null. It is an error if a field in this list has a
  2380. // non-empty value. This may be used to include null fields in Patch
  2381. // requests.
  2382. NullFields []string `json:"-"`
  2383. }
  2384. func (s *CompanionClickThroughOverride) MarshalJSON() ([]byte, error) {
  2385. type NoMethod CompanionClickThroughOverride
  2386. raw := NoMethod(*s)
  2387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2388. }
  2389. // CompanionSetting: Companion Settings
  2390. type CompanionSetting struct {
  2391. // CompanionsDisabled: Whether companions are disabled for this
  2392. // placement.
  2393. CompanionsDisabled bool `json:"companionsDisabled,omitempty"`
  2394. // EnabledSizes: Whitelist of companion sizes to be served to this
  2395. // placement. Set this list to null or empty to serve all companion
  2396. // sizes.
  2397. EnabledSizes []*Size `json:"enabledSizes,omitempty"`
  2398. // ImageOnly: Whether to serve only static images as companions.
  2399. ImageOnly bool `json:"imageOnly,omitempty"`
  2400. // Kind: Identifies what kind of resource this is. Value: the fixed
  2401. // string "dfareporting#companionSetting".
  2402. Kind string `json:"kind,omitempty"`
  2403. // ForceSendFields is a list of field names (e.g. "CompanionsDisabled")
  2404. // to unconditionally include in API requests. By default, fields with
  2405. // empty values are omitted from API requests. However, any non-pointer,
  2406. // non-interface field appearing in ForceSendFields will be sent to the
  2407. // server regardless of whether the field is empty or not. This may be
  2408. // used to include empty fields in Patch requests.
  2409. ForceSendFields []string `json:"-"`
  2410. // NullFields is a list of field names (e.g. "CompanionsDisabled") to
  2411. // include in API requests with the JSON null value. By default, fields
  2412. // with empty values are omitted from API requests. However, any field
  2413. // with an empty value appearing in NullFields will be sent to the
  2414. // server as null. It is an error if a field in this list has a
  2415. // non-empty value. This may be used to include null fields in Patch
  2416. // requests.
  2417. NullFields []string `json:"-"`
  2418. }
  2419. func (s *CompanionSetting) MarshalJSON() ([]byte, error) {
  2420. type NoMethod CompanionSetting
  2421. raw := NoMethod(*s)
  2422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2423. }
  2424. // CompatibleFields: Represents a response to the queryCompatibleFields
  2425. // method.
  2426. type CompatibleFields struct {
  2427. // CrossDimensionReachReportCompatibleFields: Contains items that are
  2428. // compatible to be selected for a report of type
  2429. // "CROSS_DIMENSION_REACH".
  2430. CrossDimensionReachReportCompatibleFields *CrossDimensionReachReportCompatibleFields `json:"crossDimensionReachReportCompatibleFields,omitempty"`
  2431. // FloodlightReportCompatibleFields: Contains items that are compatible
  2432. // to be selected for a report of type "FLOODLIGHT".
  2433. FloodlightReportCompatibleFields *FloodlightReportCompatibleFields `json:"floodlightReportCompatibleFields,omitempty"`
  2434. // Kind: The kind of resource this is, in this case
  2435. // dfareporting#compatibleFields.
  2436. Kind string `json:"kind,omitempty"`
  2437. // PathToConversionReportCompatibleFields: Contains items that are
  2438. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  2439. PathToConversionReportCompatibleFields *PathToConversionReportCompatibleFields `json:"pathToConversionReportCompatibleFields,omitempty"`
  2440. // ReachReportCompatibleFields: Contains items that are compatible to be
  2441. // selected for a report of type "REACH".
  2442. ReachReportCompatibleFields *ReachReportCompatibleFields `json:"reachReportCompatibleFields,omitempty"`
  2443. // ReportCompatibleFields: Contains items that are compatible to be
  2444. // selected for a report of type "STANDARD".
  2445. ReportCompatibleFields *ReportCompatibleFields `json:"reportCompatibleFields,omitempty"`
  2446. // ServerResponse contains the HTTP response code and headers from the
  2447. // server.
  2448. googleapi.ServerResponse `json:"-"`
  2449. // ForceSendFields is a list of field names (e.g.
  2450. // "CrossDimensionReachReportCompatibleFields") to unconditionally
  2451. // include in API requests. By default, fields with empty values are
  2452. // omitted from API requests. However, any non-pointer, non-interface
  2453. // field appearing in ForceSendFields will be sent to the server
  2454. // regardless of whether the field is empty or not. This may be used to
  2455. // include empty fields in Patch requests.
  2456. ForceSendFields []string `json:"-"`
  2457. // NullFields is a list of field names (e.g.
  2458. // "CrossDimensionReachReportCompatibleFields") to include in API
  2459. // requests with the JSON null value. By default, fields with empty
  2460. // values are omitted from API requests. However, any field with an
  2461. // empty value appearing in NullFields will be sent to the server as
  2462. // null. It is an error if a field in this list has a non-empty value.
  2463. // This may be used to include null fields in Patch requests.
  2464. NullFields []string `json:"-"`
  2465. }
  2466. func (s *CompatibleFields) MarshalJSON() ([]byte, error) {
  2467. type NoMethod CompatibleFields
  2468. raw := NoMethod(*s)
  2469. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2470. }
  2471. // ConnectionType: Contains information about an internet connection
  2472. // type that can be targeted by ads. Clients can use the connection type
  2473. // to target mobile vs. broadband users.
  2474. type ConnectionType struct {
  2475. // Id: ID of this connection type.
  2476. Id int64 `json:"id,omitempty,string"`
  2477. // Kind: Identifies what kind of resource this is. Value: the fixed
  2478. // string "dfareporting#connectionType".
  2479. Kind string `json:"kind,omitempty"`
  2480. // Name: Name of this connection type.
  2481. Name string `json:"name,omitempty"`
  2482. // ServerResponse contains the HTTP response code and headers from the
  2483. // server.
  2484. googleapi.ServerResponse `json:"-"`
  2485. // ForceSendFields is a list of field names (e.g. "Id") to
  2486. // unconditionally include in API requests. By default, fields with
  2487. // empty values are omitted from API requests. However, any non-pointer,
  2488. // non-interface field appearing in ForceSendFields will be sent to the
  2489. // server regardless of whether the field is empty or not. This may be
  2490. // used to include empty fields in Patch requests.
  2491. ForceSendFields []string `json:"-"`
  2492. // NullFields is a list of field names (e.g. "Id") to include in API
  2493. // requests with the JSON null value. By default, fields with empty
  2494. // values are omitted from API requests. However, any field with an
  2495. // empty value appearing in NullFields will be sent to the server as
  2496. // null. It is an error if a field in this list has a non-empty value.
  2497. // This may be used to include null fields in Patch requests.
  2498. NullFields []string `json:"-"`
  2499. }
  2500. func (s *ConnectionType) MarshalJSON() ([]byte, error) {
  2501. type NoMethod ConnectionType
  2502. raw := NoMethod(*s)
  2503. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2504. }
  2505. // ConnectionTypesListResponse: Connection Type List Response
  2506. type ConnectionTypesListResponse struct {
  2507. // ConnectionTypes: Collection of connection types such as broadband and
  2508. // mobile.
  2509. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  2510. // Kind: Identifies what kind of resource this is. Value: the fixed
  2511. // string "dfareporting#connectionTypesListResponse".
  2512. Kind string `json:"kind,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. "ConnectionTypes") to
  2517. // unconditionally include in API requests. By default, fields with
  2518. // empty values are omitted from API requests. However, any non-pointer,
  2519. // non-interface field appearing in ForceSendFields will be sent to the
  2520. // server regardless of whether the field is empty or not. This may be
  2521. // used to include empty fields in Patch requests.
  2522. ForceSendFields []string `json:"-"`
  2523. // NullFields is a list of field names (e.g. "ConnectionTypes") to
  2524. // include in API requests with the JSON null value. By default, fields
  2525. // with empty values are omitted from API requests. However, any field
  2526. // with an empty value appearing in NullFields will be sent to the
  2527. // server as null. It is an error if a field in this list has a
  2528. // non-empty value. This may be used to include null fields in Patch
  2529. // requests.
  2530. NullFields []string `json:"-"`
  2531. }
  2532. func (s *ConnectionTypesListResponse) MarshalJSON() ([]byte, error) {
  2533. type NoMethod ConnectionTypesListResponse
  2534. raw := NoMethod(*s)
  2535. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2536. }
  2537. // ContentCategoriesListResponse: Content Category List Response
  2538. type ContentCategoriesListResponse struct {
  2539. // ContentCategories: Content category collection.
  2540. ContentCategories []*ContentCategory `json:"contentCategories,omitempty"`
  2541. // Kind: Identifies what kind of resource this is. Value: the fixed
  2542. // string "dfareporting#contentCategoriesListResponse".
  2543. Kind string `json:"kind,omitempty"`
  2544. // NextPageToken: Pagination token to be used for the next list
  2545. // operation.
  2546. NextPageToken string `json:"nextPageToken,omitempty"`
  2547. // ServerResponse contains the HTTP response code and headers from the
  2548. // server.
  2549. googleapi.ServerResponse `json:"-"`
  2550. // ForceSendFields is a list of field names (e.g. "ContentCategories")
  2551. // to unconditionally include in API requests. By default, fields with
  2552. // empty values are omitted from API requests. However, any non-pointer,
  2553. // non-interface field appearing in ForceSendFields will be sent to the
  2554. // server regardless of whether the field is empty or not. This may be
  2555. // used to include empty fields in Patch requests.
  2556. ForceSendFields []string `json:"-"`
  2557. // NullFields is a list of field names (e.g. "ContentCategories") to
  2558. // include in API requests with the JSON null value. By default, fields
  2559. // with empty values are omitted from API requests. However, any field
  2560. // with an empty value appearing in NullFields will be sent to the
  2561. // server as null. It is an error if a field in this list has a
  2562. // non-empty value. This may be used to include null fields in Patch
  2563. // requests.
  2564. NullFields []string `json:"-"`
  2565. }
  2566. func (s *ContentCategoriesListResponse) MarshalJSON() ([]byte, error) {
  2567. type NoMethod ContentCategoriesListResponse
  2568. raw := NoMethod(*s)
  2569. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2570. }
  2571. // ContentCategory: Organizes placements according to the contents of
  2572. // their associated webpages.
  2573. type ContentCategory struct {
  2574. // AccountId: Account ID of this content category. This is a read-only
  2575. // field that can be left blank.
  2576. AccountId int64 `json:"accountId,omitempty,string"`
  2577. // Id: ID of this content category. This is a read-only, auto-generated
  2578. // field.
  2579. Id int64 `json:"id,omitempty,string"`
  2580. // Kind: Identifies what kind of resource this is. Value: the fixed
  2581. // string "dfareporting#contentCategory".
  2582. Kind string `json:"kind,omitempty"`
  2583. // Name: Name of this content category. This is a required field and
  2584. // must be less than 256 characters long and unique among content
  2585. // categories of the same account.
  2586. Name string `json:"name,omitempty"`
  2587. // ServerResponse contains the HTTP response code and headers from the
  2588. // server.
  2589. googleapi.ServerResponse `json:"-"`
  2590. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2591. // unconditionally include in API requests. By default, fields with
  2592. // empty values are omitted from API requests. However, any non-pointer,
  2593. // non-interface field appearing in ForceSendFields will be sent to the
  2594. // server regardless of whether the field is empty or not. This may be
  2595. // used to include empty fields in Patch requests.
  2596. ForceSendFields []string `json:"-"`
  2597. // NullFields is a list of field names (e.g. "AccountId") to include in
  2598. // API requests with the JSON null value. By default, fields with empty
  2599. // values are omitted from API requests. However, any field with an
  2600. // empty value appearing in NullFields will be sent to the server as
  2601. // null. It is an error if a field in this list has a non-empty value.
  2602. // This may be used to include null fields in Patch requests.
  2603. NullFields []string `json:"-"`
  2604. }
  2605. func (s *ContentCategory) MarshalJSON() ([]byte, error) {
  2606. type NoMethod ContentCategory
  2607. raw := NoMethod(*s)
  2608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2609. }
  2610. // Conversion: A Conversion represents when a user successfully performs
  2611. // a desired action after seeing an ad.
  2612. type Conversion struct {
  2613. // ChildDirectedTreatment: Whether the conversion was directed toward
  2614. // children.
  2615. ChildDirectedTreatment bool `json:"childDirectedTreatment,omitempty"`
  2616. // CustomVariables: Custom floodlight variables.
  2617. CustomVariables []*CustomFloodlightVariable `json:"customVariables,omitempty"`
  2618. // EncryptedUserId: The alphanumeric encrypted user ID. When set,
  2619. // encryptionInfo should also be specified. This field is mutually
  2620. // exclusive with encryptedUserIdCandidates[], mobileDeviceId and gclid.
  2621. // This or encryptedUserIdCandidates[] or mobileDeviceId or gclid is a
  2622. // required field.
  2623. EncryptedUserId string `json:"encryptedUserId,omitempty"`
  2624. // EncryptedUserIdCandidates: A list of the alphanumeric encrypted user
  2625. // IDs. Any user ID with exposure prior to the conversion timestamp will
  2626. // be used in the inserted conversion. If no such user ID is found then
  2627. // the conversion will be rejected with NO_COOKIE_MATCH_FOUND error.
  2628. // When set, encryptionInfo should also be specified. This field may
  2629. // only be used when calling batchinsert; it is not supported by
  2630. // batchupdate. This field is mutually exclusive with encryptedUserId,
  2631. // mobileDeviceId and gclid. This or encryptedUserId or mobileDeviceId
  2632. // or gclid is a required field.
  2633. EncryptedUserIdCandidates []string `json:"encryptedUserIdCandidates,omitempty"`
  2634. // FloodlightActivityId: Floodlight Activity ID of this conversion. This
  2635. // is a required field.
  2636. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  2637. // FloodlightConfigurationId: Floodlight Configuration ID of this
  2638. // conversion. This is a required field.
  2639. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  2640. // Gclid: The Google click ID. This field is mutually exclusive with
  2641. // encryptedUserId, encryptedUserIdCandidates[] and mobileDeviceId. This
  2642. // or encryptedUserId or encryptedUserIdCandidates[] or mobileDeviceId
  2643. // is a required field.
  2644. Gclid string `json:"gclid,omitempty"`
  2645. // Kind: Identifies what kind of resource this is. Value: the fixed
  2646. // string "dfareporting#conversion".
  2647. Kind string `json:"kind,omitempty"`
  2648. // LimitAdTracking: Whether Limit Ad Tracking is enabled. When set to
  2649. // true, the conversion will be used for reporting but not targeting.
  2650. // This will prevent remarketing.
  2651. LimitAdTracking bool `json:"limitAdTracking,omitempty"`
  2652. // MobileDeviceId: The mobile device ID. This field is mutually
  2653. // exclusive with encryptedUserId, encryptedUserIdCandidates[] and
  2654. // gclid. This or encryptedUserId or encryptedUserIdCandidates[] or
  2655. // gclid is a required field.
  2656. MobileDeviceId string `json:"mobileDeviceId,omitempty"`
  2657. // Ordinal: The ordinal of the conversion. Use this field to control how
  2658. // conversions of the same user and day are de-duplicated. This is a
  2659. // required field.
  2660. Ordinal string `json:"ordinal,omitempty"`
  2661. // Quantity: The quantity of the conversion.
  2662. Quantity int64 `json:"quantity,omitempty,string"`
  2663. // TimestampMicros: The timestamp of conversion, in Unix epoch micros.
  2664. // This is a required field.
  2665. TimestampMicros int64 `json:"timestampMicros,omitempty,string"`
  2666. // Value: The value of the conversion.
  2667. Value float64 `json:"value,omitempty"`
  2668. // ForceSendFields is a list of field names (e.g.
  2669. // "ChildDirectedTreatment") to unconditionally include in API requests.
  2670. // By default, fields with empty values are omitted from API requests.
  2671. // However, any non-pointer, non-interface field appearing in
  2672. // ForceSendFields will be sent to the server regardless of whether the
  2673. // field is empty or not. This may be used to include empty fields in
  2674. // Patch requests.
  2675. ForceSendFields []string `json:"-"`
  2676. // NullFields is a list of field names (e.g. "ChildDirectedTreatment")
  2677. // to include in API requests with the JSON null value. By default,
  2678. // fields with empty values are omitted from API requests. However, any
  2679. // field with an empty value appearing in NullFields will be sent to the
  2680. // server as null. It is an error if a field in this list has a
  2681. // non-empty value. This may be used to include null fields in Patch
  2682. // requests.
  2683. NullFields []string `json:"-"`
  2684. }
  2685. func (s *Conversion) MarshalJSON() ([]byte, error) {
  2686. type NoMethod Conversion
  2687. raw := NoMethod(*s)
  2688. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2689. }
  2690. func (s *Conversion) UnmarshalJSON(data []byte) error {
  2691. type NoMethod Conversion
  2692. var s1 struct {
  2693. Value gensupport.JSONFloat64 `json:"value"`
  2694. *NoMethod
  2695. }
  2696. s1.NoMethod = (*NoMethod)(s)
  2697. if err := json.Unmarshal(data, &s1); err != nil {
  2698. return err
  2699. }
  2700. s.Value = float64(s1.Value)
  2701. return nil
  2702. }
  2703. // ConversionError: The error code and description for a conversion that
  2704. // failed to insert or update.
  2705. type ConversionError struct {
  2706. // Code: The error code.
  2707. //
  2708. // Possible values:
  2709. // "INTERNAL"
  2710. // "INVALID_ARGUMENT"
  2711. // "NOT_FOUND"
  2712. // "PERMISSION_DENIED"
  2713. Code string `json:"code,omitempty"`
  2714. // Kind: Identifies what kind of resource this is. Value: the fixed
  2715. // string "dfareporting#conversionError".
  2716. Kind string `json:"kind,omitempty"`
  2717. // Message: A description of the error.
  2718. Message string `json:"message,omitempty"`
  2719. // ForceSendFields is a list of field names (e.g. "Code") to
  2720. // unconditionally include in API requests. By default, fields with
  2721. // empty values are omitted from API requests. However, any non-pointer,
  2722. // non-interface field appearing in ForceSendFields will be sent to the
  2723. // server regardless of whether the field is empty or not. This may be
  2724. // used to include empty fields in Patch requests.
  2725. ForceSendFields []string `json:"-"`
  2726. // NullFields is a list of field names (e.g. "Code") to include in API
  2727. // requests with the JSON null value. By default, fields with empty
  2728. // values are omitted from API requests. However, any field with an
  2729. // empty value appearing in NullFields will be sent to the server as
  2730. // null. It is an error if a field in this list has a non-empty value.
  2731. // This may be used to include null fields in Patch requests.
  2732. NullFields []string `json:"-"`
  2733. }
  2734. func (s *ConversionError) MarshalJSON() ([]byte, error) {
  2735. type NoMethod ConversionError
  2736. raw := NoMethod(*s)
  2737. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2738. }
  2739. // ConversionStatus: The original conversion that was inserted or
  2740. // updated and whether there were any errors.
  2741. type ConversionStatus struct {
  2742. // Conversion: The original conversion that was inserted or updated.
  2743. Conversion *Conversion `json:"conversion,omitempty"`
  2744. // Errors: A list of errors related to this conversion.
  2745. Errors []*ConversionError `json:"errors,omitempty"`
  2746. // Kind: Identifies what kind of resource this is. Value: the fixed
  2747. // string "dfareporting#conversionStatus".
  2748. Kind string `json:"kind,omitempty"`
  2749. // ForceSendFields is a list of field names (e.g. "Conversion") to
  2750. // unconditionally include in API requests. By default, fields with
  2751. // empty values are omitted from API requests. However, any non-pointer,
  2752. // non-interface field appearing in ForceSendFields will be sent to the
  2753. // server regardless of whether the field is empty or not. This may be
  2754. // used to include empty fields in Patch requests.
  2755. ForceSendFields []string `json:"-"`
  2756. // NullFields is a list of field names (e.g. "Conversion") to include in
  2757. // API requests with the JSON null value. By default, fields with empty
  2758. // values are omitted from API requests. However, any field with an
  2759. // empty value appearing in NullFields will be sent to the server as
  2760. // null. It is an error if a field in this list has a non-empty value.
  2761. // This may be used to include null fields in Patch requests.
  2762. NullFields []string `json:"-"`
  2763. }
  2764. func (s *ConversionStatus) MarshalJSON() ([]byte, error) {
  2765. type NoMethod ConversionStatus
  2766. raw := NoMethod(*s)
  2767. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2768. }
  2769. // ConversionsBatchInsertRequest: Insert Conversions Request.
  2770. type ConversionsBatchInsertRequest struct {
  2771. // Conversions: The set of conversions to insert.
  2772. Conversions []*Conversion `json:"conversions,omitempty"`
  2773. // EncryptionInfo: Describes how encryptedUserId or
  2774. // encryptedUserIdCandidates[] is encrypted. This is a required field if
  2775. // encryptedUserId or encryptedUserIdCandidates[] is used.
  2776. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2777. // Kind: Identifies what kind of resource this is. Value: the fixed
  2778. // string "dfareporting#conversionsBatchInsertRequest".
  2779. Kind string `json:"kind,omitempty"`
  2780. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2781. // unconditionally include in API requests. By default, fields with
  2782. // empty values are omitted from API requests. However, any non-pointer,
  2783. // non-interface field appearing in ForceSendFields will be sent to the
  2784. // server regardless of whether the field is empty or not. This may be
  2785. // used to include empty fields in Patch requests.
  2786. ForceSendFields []string `json:"-"`
  2787. // NullFields is a list of field names (e.g. "Conversions") to include
  2788. // in API requests with the JSON null value. By default, fields with
  2789. // empty values are omitted from API requests. However, any field with
  2790. // an empty value appearing in NullFields will be sent to the server as
  2791. // null. It is an error if a field in this list has a non-empty value.
  2792. // This may be used to include null fields in Patch requests.
  2793. NullFields []string `json:"-"`
  2794. }
  2795. func (s *ConversionsBatchInsertRequest) MarshalJSON() ([]byte, error) {
  2796. type NoMethod ConversionsBatchInsertRequest
  2797. raw := NoMethod(*s)
  2798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2799. }
  2800. // ConversionsBatchInsertResponse: Insert Conversions Response.
  2801. type ConversionsBatchInsertResponse struct {
  2802. // HasFailures: Indicates that some or all conversions failed to insert.
  2803. HasFailures bool `json:"hasFailures,omitempty"`
  2804. // Kind: Identifies what kind of resource this is. Value: the fixed
  2805. // string "dfareporting#conversionsBatchInsertResponse".
  2806. Kind string `json:"kind,omitempty"`
  2807. // Status: The insert status of each conversion. Statuses are returned
  2808. // in the same order that conversions are inserted.
  2809. Status []*ConversionStatus `json:"status,omitempty"`
  2810. // ServerResponse contains the HTTP response code and headers from the
  2811. // server.
  2812. googleapi.ServerResponse `json:"-"`
  2813. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2814. // unconditionally include in API requests. By default, fields with
  2815. // empty values are omitted from API requests. However, any non-pointer,
  2816. // non-interface field appearing in ForceSendFields will be sent to the
  2817. // server regardless of whether the field is empty or not. This may be
  2818. // used to include empty fields in Patch requests.
  2819. ForceSendFields []string `json:"-"`
  2820. // NullFields is a list of field names (e.g. "HasFailures") to include
  2821. // in API requests with the JSON null value. By default, fields with
  2822. // empty values are omitted from API requests. However, any field with
  2823. // an empty value appearing in NullFields will be sent to the server as
  2824. // null. It is an error if a field in this list has a non-empty value.
  2825. // This may be used to include null fields in Patch requests.
  2826. NullFields []string `json:"-"`
  2827. }
  2828. func (s *ConversionsBatchInsertResponse) MarshalJSON() ([]byte, error) {
  2829. type NoMethod ConversionsBatchInsertResponse
  2830. raw := NoMethod(*s)
  2831. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2832. }
  2833. // ConversionsBatchUpdateRequest: Update Conversions Request.
  2834. type ConversionsBatchUpdateRequest struct {
  2835. // Conversions: The set of conversions to update.
  2836. Conversions []*Conversion `json:"conversions,omitempty"`
  2837. // EncryptionInfo: Describes how encryptedUserId is encrypted. This is a
  2838. // required field if encryptedUserId is used.
  2839. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2840. // Kind: Identifies what kind of resource this is. Value: the fixed
  2841. // string "dfareporting#conversionsBatchUpdateRequest".
  2842. Kind string `json:"kind,omitempty"`
  2843. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2844. // unconditionally include in API requests. By default, fields with
  2845. // empty values are omitted from API requests. However, any non-pointer,
  2846. // non-interface field appearing in ForceSendFields will be sent to the
  2847. // server regardless of whether the field is empty or not. This may be
  2848. // used to include empty fields in Patch requests.
  2849. ForceSendFields []string `json:"-"`
  2850. // NullFields is a list of field names (e.g. "Conversions") to include
  2851. // in API requests with the JSON null value. By default, fields with
  2852. // empty values are omitted from API requests. However, any field with
  2853. // an empty value appearing in NullFields will be sent to the server as
  2854. // null. It is an error if a field in this list has a non-empty value.
  2855. // This may be used to include null fields in Patch requests.
  2856. NullFields []string `json:"-"`
  2857. }
  2858. func (s *ConversionsBatchUpdateRequest) MarshalJSON() ([]byte, error) {
  2859. type NoMethod ConversionsBatchUpdateRequest
  2860. raw := NoMethod(*s)
  2861. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2862. }
  2863. // ConversionsBatchUpdateResponse: Update Conversions Response.
  2864. type ConversionsBatchUpdateResponse struct {
  2865. // HasFailures: Indicates that some or all conversions failed to update.
  2866. HasFailures bool `json:"hasFailures,omitempty"`
  2867. // Kind: Identifies what kind of resource this is. Value: the fixed
  2868. // string "dfareporting#conversionsBatchUpdateResponse".
  2869. Kind string `json:"kind,omitempty"`
  2870. // Status: The update status of each conversion. Statuses are returned
  2871. // in the same order that conversions are updated.
  2872. Status []*ConversionStatus `json:"status,omitempty"`
  2873. // ServerResponse contains the HTTP response code and headers from the
  2874. // server.
  2875. googleapi.ServerResponse `json:"-"`
  2876. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2877. // unconditionally include in API requests. By default, fields with
  2878. // empty values are omitted from API requests. However, any non-pointer,
  2879. // non-interface field appearing in ForceSendFields will be sent to the
  2880. // server regardless of whether the field is empty or not. This may be
  2881. // used to include empty fields in Patch requests.
  2882. ForceSendFields []string `json:"-"`
  2883. // NullFields is a list of field names (e.g. "HasFailures") to include
  2884. // in API requests with the JSON null value. By default, fields with
  2885. // empty values are omitted from API requests. However, any field with
  2886. // an empty value appearing in NullFields will be sent to the server as
  2887. // null. It is an error if a field in this list has a non-empty value.
  2888. // This may be used to include null fields in Patch requests.
  2889. NullFields []string `json:"-"`
  2890. }
  2891. func (s *ConversionsBatchUpdateResponse) MarshalJSON() ([]byte, error) {
  2892. type NoMethod ConversionsBatchUpdateResponse
  2893. raw := NoMethod(*s)
  2894. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2895. }
  2896. // CountriesListResponse: Country List Response
  2897. type CountriesListResponse struct {
  2898. // Countries: Country collection.
  2899. Countries []*Country `json:"countries,omitempty"`
  2900. // Kind: Identifies what kind of resource this is. Value: the fixed
  2901. // string "dfareporting#countriesListResponse".
  2902. Kind string `json:"kind,omitempty"`
  2903. // ServerResponse contains the HTTP response code and headers from the
  2904. // server.
  2905. googleapi.ServerResponse `json:"-"`
  2906. // ForceSendFields is a list of field names (e.g. "Countries") to
  2907. // unconditionally include in API requests. By default, fields with
  2908. // empty values are omitted from API requests. However, any non-pointer,
  2909. // non-interface field appearing in ForceSendFields will be sent to the
  2910. // server regardless of whether the field is empty or not. This may be
  2911. // used to include empty fields in Patch requests.
  2912. ForceSendFields []string `json:"-"`
  2913. // NullFields is a list of field names (e.g. "Countries") to include in
  2914. // API requests with the JSON null value. By default, fields with empty
  2915. // values are omitted from API requests. However, any field with an
  2916. // empty value appearing in NullFields will be sent to the server as
  2917. // null. It is an error if a field in this list has a non-empty value.
  2918. // This may be used to include null fields in Patch requests.
  2919. NullFields []string `json:"-"`
  2920. }
  2921. func (s *CountriesListResponse) MarshalJSON() ([]byte, error) {
  2922. type NoMethod CountriesListResponse
  2923. raw := NoMethod(*s)
  2924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2925. }
  2926. // Country: Contains information about a country that can be targeted by
  2927. // ads.
  2928. type Country struct {
  2929. // CountryCode: Country code.
  2930. CountryCode string `json:"countryCode,omitempty"`
  2931. // DartId: DART ID of this country. This is the ID used for targeting
  2932. // and generating reports.
  2933. DartId int64 `json:"dartId,omitempty,string"`
  2934. // Kind: Identifies what kind of resource this is. Value: the fixed
  2935. // string "dfareporting#country".
  2936. Kind string `json:"kind,omitempty"`
  2937. // Name: Name of this country.
  2938. Name string `json:"name,omitempty"`
  2939. // SslEnabled: Whether ad serving supports secure servers in this
  2940. // country.
  2941. SslEnabled bool `json:"sslEnabled,omitempty"`
  2942. // ServerResponse contains the HTTP response code and headers from the
  2943. // server.
  2944. googleapi.ServerResponse `json:"-"`
  2945. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2946. // unconditionally include in API requests. By default, fields with
  2947. // empty values are omitted from API requests. However, any non-pointer,
  2948. // non-interface field appearing in ForceSendFields will be sent to the
  2949. // server regardless of whether the field is empty or not. This may be
  2950. // used to include empty fields in Patch requests.
  2951. ForceSendFields []string `json:"-"`
  2952. // NullFields is a list of field names (e.g. "CountryCode") to include
  2953. // in API requests with the JSON null value. By default, fields with
  2954. // empty values are omitted from API requests. However, any field with
  2955. // an empty value appearing in NullFields will be sent to the server as
  2956. // null. It is an error if a field in this list has a non-empty value.
  2957. // This may be used to include null fields in Patch requests.
  2958. NullFields []string `json:"-"`
  2959. }
  2960. func (s *Country) MarshalJSON() ([]byte, error) {
  2961. type NoMethod Country
  2962. raw := NoMethod(*s)
  2963. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2964. }
  2965. // Creative: Contains properties of a Creative.
  2966. type Creative struct {
  2967. // AccountId: Account ID of this creative. This field, if left unset,
  2968. // will be auto-generated for both insert and update operations.
  2969. // Applicable to all creative types.
  2970. AccountId int64 `json:"accountId,omitempty,string"`
  2971. // Active: Whether the creative is active. Applicable to all creative
  2972. // types.
  2973. Active bool `json:"active,omitempty"`
  2974. // AdParameters: Ad parameters user for VPAID creative. This is a
  2975. // read-only field. Applicable to the following creative types: all
  2976. // VPAID.
  2977. AdParameters string `json:"adParameters,omitempty"`
  2978. // AdTagKeys: Keywords for a Rich Media creative. Keywords let you
  2979. // customize the creative settings of a Rich Media ad running on your
  2980. // site without having to contact the advertiser. You can use keywords
  2981. // to dynamically change the look or functionality of a creative.
  2982. // Applicable to the following creative types: all RICH_MEDIA, and all
  2983. // VPAID.
  2984. AdTagKeys []string `json:"adTagKeys,omitempty"`
  2985. // AdvertiserId: Advertiser ID of this creative. This is a required
  2986. // field. Applicable to all creative types.
  2987. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  2988. // AllowScriptAccess: Whether script access is allowed for this
  2989. // creative. This is a read-only and deprecated field which will
  2990. // automatically be set to true on update. Applicable to the following
  2991. // creative types: FLASH_INPAGE.
  2992. AllowScriptAccess bool `json:"allowScriptAccess,omitempty"`
  2993. // Archived: Whether the creative is archived. Applicable to all
  2994. // creative types.
  2995. Archived bool `json:"archived,omitempty"`
  2996. // ArtworkType: Type of artwork used for the creative. This is a
  2997. // read-only field. Applicable to the following creative types: all
  2998. // RICH_MEDIA, and all VPAID.
  2999. //
  3000. // Possible values:
  3001. // "ARTWORK_TYPE_FLASH"
  3002. // "ARTWORK_TYPE_HTML5"
  3003. // "ARTWORK_TYPE_IMAGE"
  3004. // "ARTWORK_TYPE_MIXED"
  3005. ArtworkType string `json:"artworkType,omitempty"`
  3006. // AuthoringSource: Source application where creative was authored.
  3007. // Presently, only DBM authored creatives will have this field set.
  3008. // Applicable to all creative types.
  3009. //
  3010. // Possible values:
  3011. // "CREATIVE_AUTHORING_SOURCE_DBM"
  3012. // "CREATIVE_AUTHORING_SOURCE_DCM"
  3013. // "CREATIVE_AUTHORING_SOURCE_STUDIO"
  3014. AuthoringSource string `json:"authoringSource,omitempty"`
  3015. // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a
  3016. // read-only field. Applicable to the following creative types:
  3017. // HTML5_BANNER.
  3018. //
  3019. // Possible values:
  3020. // "NINJA"
  3021. // "SWIFFY"
  3022. AuthoringTool string `json:"authoringTool,omitempty"`
  3023. // AutoAdvanceImages: Whether images are automatically advanced for
  3024. // image gallery creatives. Applicable to the following creative types:
  3025. // DISPLAY_IMAGE_GALLERY.
  3026. AutoAdvanceImages bool `json:"autoAdvanceImages,omitempty"`
  3027. // BackgroundColor: The 6-character HTML color code, beginning with #,
  3028. // for the background of the window area where the Flash file is
  3029. // displayed. Default is white. Applicable to the following creative
  3030. // types: FLASH_INPAGE.
  3031. BackgroundColor string `json:"backgroundColor,omitempty"`
  3032. // BackupImageClickThroughUrl: Click-through URL for backup image.
  3033. // Applicable to ENHANCED_BANNER when the primary asset type is not
  3034. // HTML_IMAGE.
  3035. BackupImageClickThroughUrl *CreativeClickThroughUrl `json:"backupImageClickThroughUrl,omitempty"`
  3036. // BackupImageFeatures: List of feature dependencies that will cause a
  3037. // backup image to be served if the browser that serves the ad does not
  3038. // support them. Feature dependencies are features that a browser must
  3039. // be able to support in order to render your HTML5 creative asset
  3040. // correctly. This field is initially auto-generated to contain all
  3041. // features detected by DCM for all the assets of this creative and can
  3042. // then be modified by the client. To reset this field, copy over all
  3043. // the creativeAssets' detected features. Applicable to the following
  3044. // creative types: HTML5_BANNER. Applicable to DISPLAY when the primary
  3045. // asset type is not HTML_IMAGE.
  3046. //
  3047. // Possible values:
  3048. // "APPLICATION_CACHE"
  3049. // "AUDIO"
  3050. // "CANVAS"
  3051. // "CANVAS_TEXT"
  3052. // "CSS_ANIMATIONS"
  3053. // "CSS_BACKGROUND_SIZE"
  3054. // "CSS_BORDER_IMAGE"
  3055. // "CSS_BORDER_RADIUS"
  3056. // "CSS_BOX_SHADOW"
  3057. // "CSS_COLUMNS"
  3058. // "CSS_FLEX_BOX"
  3059. // "CSS_FONT_FACE"
  3060. // "CSS_GENERATED_CONTENT"
  3061. // "CSS_GRADIENTS"
  3062. // "CSS_HSLA"
  3063. // "CSS_MULTIPLE_BGS"
  3064. // "CSS_OPACITY"
  3065. // "CSS_REFLECTIONS"
  3066. // "CSS_RGBA"
  3067. // "CSS_TEXT_SHADOW"
  3068. // "CSS_TRANSFORMS"
  3069. // "CSS_TRANSFORMS3D"
  3070. // "CSS_TRANSITIONS"
  3071. // "DRAG_AND_DROP"
  3072. // "GEO_LOCATION"
  3073. // "HASH_CHANGE"
  3074. // "HISTORY"
  3075. // "INDEXED_DB"
  3076. // "INLINE_SVG"
  3077. // "INPUT_ATTR_AUTOCOMPLETE"
  3078. // "INPUT_ATTR_AUTOFOCUS"
  3079. // "INPUT_ATTR_LIST"
  3080. // "INPUT_ATTR_MAX"
  3081. // "INPUT_ATTR_MIN"
  3082. // "INPUT_ATTR_MULTIPLE"
  3083. // "INPUT_ATTR_PATTERN"
  3084. // "INPUT_ATTR_PLACEHOLDER"
  3085. // "INPUT_ATTR_REQUIRED"
  3086. // "INPUT_ATTR_STEP"
  3087. // "INPUT_TYPE_COLOR"
  3088. // "INPUT_TYPE_DATE"
  3089. // "INPUT_TYPE_DATETIME"
  3090. // "INPUT_TYPE_DATETIME_LOCAL"
  3091. // "INPUT_TYPE_EMAIL"
  3092. // "INPUT_TYPE_MONTH"
  3093. // "INPUT_TYPE_NUMBER"
  3094. // "INPUT_TYPE_RANGE"
  3095. // "INPUT_TYPE_SEARCH"
  3096. // "INPUT_TYPE_TEL"
  3097. // "INPUT_TYPE_TIME"
  3098. // "INPUT_TYPE_URL"
  3099. // "INPUT_TYPE_WEEK"
  3100. // "LOCAL_STORAGE"
  3101. // "POST_MESSAGE"
  3102. // "SESSION_STORAGE"
  3103. // "SMIL"
  3104. // "SVG_CLIP_PATHS"
  3105. // "SVG_FE_IMAGE"
  3106. // "SVG_FILTERS"
  3107. // "SVG_HREF"
  3108. // "TOUCH"
  3109. // "VIDEO"
  3110. // "WEBGL"
  3111. // "WEB_SOCKETS"
  3112. // "WEB_SQL_DATABASE"
  3113. // "WEB_WORKERS"
  3114. BackupImageFeatures []string `json:"backupImageFeatures,omitempty"`
  3115. // BackupImageReportingLabel: Reporting label used for HTML5 banner
  3116. // backup image. Applicable to the following creative types: DISPLAY
  3117. // when the primary asset type is not HTML_IMAGE.
  3118. BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"`
  3119. // BackupImageTargetWindow: Target window for backup image. Applicable
  3120. // to the following creative types: FLASH_INPAGE and HTML5_BANNER.
  3121. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  3122. BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"`
  3123. // ClickTags: Click tags of the creative. For DISPLAY, FLASH_INPAGE, and
  3124. // HTML5_BANNER creatives, this is a subset of detected click tags for
  3125. // the assets associated with this creative. After creating a flash
  3126. // asset, detected click tags will be returned in the
  3127. // creativeAssetMetadata. When inserting the creative, populate the
  3128. // creative clickTags field using the creativeAssetMetadata.clickTags
  3129. // field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly
  3130. // one entry in this list for each image creative asset. A click tag is
  3131. // matched with a corresponding creative asset by matching the
  3132. // clickTag.name field with the creativeAsset.assetIdentifier.name
  3133. // field. Applicable to the following creative types:
  3134. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable to
  3135. // DISPLAY when the primary asset type is not HTML_IMAGE.
  3136. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3137. // CommercialId: Industry standard ID assigned to creative for reach and
  3138. // frequency. Applicable to INSTREAM_VIDEO_REDIRECT creatives.
  3139. CommercialId string `json:"commercialId,omitempty"`
  3140. // CompanionCreatives: List of companion creatives assigned to an
  3141. // in-Stream video creative. Acceptable values include IDs of existing
  3142. // flash and image creatives. Applicable to the following creative
  3143. // types: all VPAID and all INSTREAM_VIDEO with dynamicAssetSelection
  3144. // set to false.
  3145. CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"`
  3146. // Compatibility: Compatibilities associated with this creative. This is
  3147. // a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to
  3148. // rendering either on desktop or on mobile devices or in mobile apps
  3149. // for regular or interstitial ads, respectively. APP and
  3150. // APP_INTERSTITIAL are for rendering in mobile apps. Only pre-existing
  3151. // creatives may have these compatibilities since new creatives will
  3152. // either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead.
  3153. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  3154. // with the VAST standard. Applicable to all creative types.
  3155. //
  3156. // Acceptable values are:
  3157. // - "APP"
  3158. // - "APP_INTERSTITIAL"
  3159. // - "IN_STREAM_VIDEO"
  3160. // - "DISPLAY"
  3161. // - "DISPLAY_INTERSTITIAL"
  3162. //
  3163. // Possible values:
  3164. // "APP"
  3165. // "APP_INTERSTITIAL"
  3166. // "DISPLAY"
  3167. // "DISPLAY_INTERSTITIAL"
  3168. // "IN_STREAM_AUDIO"
  3169. // "IN_STREAM_VIDEO"
  3170. Compatibility []string `json:"compatibility,omitempty"`
  3171. // ConvertFlashToHtml5: Whether Flash assets associated with the
  3172. // creative need to be automatically converted to HTML5. This flag is
  3173. // enabled by default and users can choose to disable it if they don't
  3174. // want the system to generate and use HTML5 asset for this creative.
  3175. // Applicable to the following creative type: FLASH_INPAGE. Applicable
  3176. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3177. ConvertFlashToHtml5 bool `json:"convertFlashToHtml5,omitempty"`
  3178. // CounterCustomEvents: List of counter events configured for the
  3179. // creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3180. // and auto-generated from clickTags. Applicable to the following
  3181. // creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3182. CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"`
  3183. // CreativeAssetSelection: Required if dynamicAssetSelection is true.
  3184. CreativeAssetSelection *CreativeAssetSelection `json:"creativeAssetSelection,omitempty"`
  3185. // CreativeAssets: Assets associated with a creative. Applicable to all
  3186. // but the following creative types: INTERNAL_REDIRECT,
  3187. // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT
  3188. CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"`
  3189. // CreativeFieldAssignments: Creative field assignments for this
  3190. // creative. Applicable to all creative types.
  3191. CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"`
  3192. // CustomKeyValues: Custom key-values for a Rich Media creative.
  3193. // Key-values let you customize the creative settings of a Rich Media ad
  3194. // running on your site without having to contact the advertiser. You
  3195. // can use key-values to dynamically change the look or functionality of
  3196. // a creative. Applicable to the following creative types: all
  3197. // RICH_MEDIA, and all VPAID.
  3198. CustomKeyValues []string `json:"customKeyValues,omitempty"`
  3199. // DynamicAssetSelection: Set this to true to enable the use of rules to
  3200. // target individual assets in this creative. When set to true
  3201. // creativeAssetSelection must be set. This also controls asset-level
  3202. // companions. When this is true, companion creatives should be assigned
  3203. // to creative assets. Learn more. Applicable to INSTREAM_VIDEO
  3204. // creatives.
  3205. DynamicAssetSelection bool `json:"dynamicAssetSelection,omitempty"`
  3206. // ExitCustomEvents: List of exit events configured for the creative.
  3207. // For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3208. // and auto-generated from clickTags, For DISPLAY, an event is also
  3209. // created from the backupImageReportingLabel. Applicable to the
  3210. // following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and
  3211. // all VPAID. Applicable to DISPLAY when the primary asset type is not
  3212. // HTML_IMAGE.
  3213. ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"`
  3214. // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF
  3215. // file communicate with either Flash Player or the program hosting
  3216. // Flash Player, such as a web browser. This is only triggered if
  3217. // allowScriptAccess field is true. Applicable to the following creative
  3218. // types: FLASH_INPAGE.
  3219. FsCommand *FsCommand `json:"fsCommand,omitempty"`
  3220. // HtmlCode: HTML code for the creative. This is a required field when
  3221. // applicable. This field is ignored if htmlCodeLocked is true.
  3222. // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE,
  3223. // and HTML5_BANNER, and all RICH_MEDIA.
  3224. HtmlCode string `json:"htmlCode,omitempty"`
  3225. // HtmlCodeLocked: Whether HTML code is DCM-generated or manually
  3226. // entered. Set to true to ignore changes to htmlCode. Applicable to the
  3227. // following creative types: FLASH_INPAGE and HTML5_BANNER.
  3228. HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"`
  3229. // Id: ID of this creative. This is a read-only, auto-generated field.
  3230. // Applicable to all creative types.
  3231. Id int64 `json:"id,omitempty,string"`
  3232. // IdDimensionValue: Dimension value for the ID of this creative. This
  3233. // is a read-only field. Applicable to all creative types.
  3234. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3235. // Kind: Identifies what kind of resource this is. Value: the fixed
  3236. // string "dfareporting#creative".
  3237. Kind string `json:"kind,omitempty"`
  3238. // LastModifiedInfo: Creative last modification information. This is a
  3239. // read-only field. Applicable to all creative types.
  3240. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  3241. // LatestTraffickedCreativeId: Latest Studio trafficked creative ID
  3242. // associated with rich media and VPAID creatives. This is a read-only
  3243. // field. Applicable to the following creative types: all RICH_MEDIA,
  3244. // and all VPAID.
  3245. LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"`
  3246. // Name: Name of the creative. This is a required field and must be less
  3247. // than 256 characters long. Applicable to all creative types.
  3248. Name string `json:"name,omitempty"`
  3249. // OverrideCss: Override CSS value for rich media creatives. Applicable
  3250. // to the following creative types: all RICH_MEDIA.
  3251. OverrideCss string `json:"overrideCss,omitempty"`
  3252. // PoliteLoadAssetId: The asset ID of the polite load image asset.
  3253. // Applicable to the creative type: DISPLAY.
  3254. PoliteLoadAssetId int64 `json:"politeLoadAssetId,omitempty,string"`
  3255. // ProgressOffset: Amount of time to play the video before counting a
  3256. // view. Applicable to the following creative types: all INSTREAM_VIDEO.
  3257. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  3258. // RedirectUrl: URL of hosted image or hosted video or another ad tag.
  3259. // For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video
  3260. // redirect URL. The standard for a VAST (Video Ad Serving Template) ad
  3261. // response allows for a redirect link to another VAST 2.0 or 3.0 call.
  3262. // This is a required field when applicable. Applicable to the following
  3263. // creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT,
  3264. // INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT
  3265. RedirectUrl string `json:"redirectUrl,omitempty"`
  3266. // RenderingId: ID of current rendering version. This is a read-only
  3267. // field. Applicable to all creative types.
  3268. RenderingId int64 `json:"renderingId,omitempty,string"`
  3269. // RenderingIdDimensionValue: Dimension value for the rendering ID of
  3270. // this creative. This is a read-only field. Applicable to all creative
  3271. // types.
  3272. RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"`
  3273. // RequiredFlashPluginVersion: The minimum required Flash plugin version
  3274. // for this creative. For example, 11.2.202.235. This is a read-only
  3275. // field. Applicable to the following creative types: all RICH_MEDIA,
  3276. // and all VPAID.
  3277. RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"`
  3278. // RequiredFlashVersion: The internal Flash version for this creative as
  3279. // calculated by DoubleClick Studio. This is a read-only field.
  3280. // Applicable to the following creative types: FLASH_INPAGE all
  3281. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3282. // asset type is not HTML_IMAGE.
  3283. RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"`
  3284. // Size: Size associated with this creative. When inserting or updating
  3285. // a creative either the size ID field or size width and height fields
  3286. // can be used. This is a required field when applicable; however for
  3287. // IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a
  3288. // primary asset of type HTML_IMAGE, if left blank, this field will be
  3289. // automatically set using the actual size of the associated image
  3290. // assets. Applicable to the following creative types: DISPLAY,
  3291. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all
  3292. // RICH_MEDIA.
  3293. Size *Size `json:"size,omitempty"`
  3294. // SkipOffset: Amount of time to play the video before the skip button
  3295. // appears. Applicable to the following creative types: all
  3296. // INSTREAM_VIDEO.
  3297. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  3298. // Skippable: Whether the user can choose to skip the creative.
  3299. // Applicable to the following creative types: all INSTREAM_VIDEO and
  3300. // all VPAID.
  3301. Skippable bool `json:"skippable,omitempty"`
  3302. // SslCompliant: Whether the creative is SSL-compliant. This is a
  3303. // read-only field. Applicable to all creative types.
  3304. SslCompliant bool `json:"sslCompliant,omitempty"`
  3305. // SslOverride: Whether creative should be treated as SSL compliant even
  3306. // if the system scan shows it's not. Applicable to all creative types.
  3307. SslOverride bool `json:"sslOverride,omitempty"`
  3308. // StudioAdvertiserId: Studio advertiser ID associated with rich media
  3309. // and VPAID creatives. This is a read-only field. Applicable to the
  3310. // following creative types: all RICH_MEDIA, and all VPAID.
  3311. StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"`
  3312. // StudioCreativeId: Studio creative ID associated with rich media and
  3313. // VPAID creatives. This is a read-only field. Applicable to the
  3314. // following creative types: all RICH_MEDIA, and all VPAID.
  3315. StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"`
  3316. // StudioTraffickedCreativeId: Studio trafficked creative ID associated
  3317. // with rich media and VPAID creatives. This is a read-only field.
  3318. // Applicable to the following creative types: all RICH_MEDIA, and all
  3319. // VPAID.
  3320. StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"`
  3321. // SubaccountId: Subaccount ID of this creative. This field, if left
  3322. // unset, will be auto-generated for both insert and update operations.
  3323. // Applicable to all creative types.
  3324. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  3325. // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record
  3326. // backup image impressions. Applicable to the following creative types:
  3327. // all RICH_MEDIA.
  3328. ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"`
  3329. // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record
  3330. // rich media impressions. Applicable to the following creative types:
  3331. // all RICH_MEDIA.
  3332. ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"`
  3333. // ThirdPartyUrls: Third-party URLs for tracking in-stream video
  3334. // creative events. Applicable to the following creative types: all
  3335. // INSTREAM_VIDEO and all VPAID.
  3336. ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"`
  3337. // TimerCustomEvents: List of timer events configured for the creative.
  3338. // For DISPLAY_IMAGE_GALLERY creatives, these are read-only and
  3339. // auto-generated from clickTags. Applicable to the following creative
  3340. // types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3341. // Applicable to DISPLAY when the primary asset is not HTML_IMAGE.
  3342. TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"`
  3343. // TotalFileSize: Combined size of all creative assets. This is a
  3344. // read-only field. Applicable to the following creative types: all
  3345. // RICH_MEDIA, and all VPAID.
  3346. TotalFileSize int64 `json:"totalFileSize,omitempty,string"`
  3347. // Type: Type of this creative. This is a required field. Applicable to
  3348. // all creative types.
  3349. //
  3350. // Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for
  3351. // existing creatives. New creatives should use DISPLAY as a replacement
  3352. // for these types.
  3353. //
  3354. // Possible values:
  3355. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  3356. // "CUSTOM_DISPLAY"
  3357. // "CUSTOM_DISPLAY_INTERSTITIAL"
  3358. // "DISPLAY"
  3359. // "DISPLAY_IMAGE_GALLERY"
  3360. // "DISPLAY_REDIRECT"
  3361. // "FLASH_INPAGE"
  3362. // "HTML5_BANNER"
  3363. // "IMAGE"
  3364. // "INSTREAM_AUDIO"
  3365. // "INSTREAM_VIDEO"
  3366. // "INSTREAM_VIDEO_REDIRECT"
  3367. // "INTERNAL_REDIRECT"
  3368. // "INTERSTITIAL_INTERNAL_REDIRECT"
  3369. // "RICH_MEDIA_DISPLAY_BANNER"
  3370. // "RICH_MEDIA_DISPLAY_EXPANDING"
  3371. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  3372. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  3373. // "RICH_MEDIA_IM_EXPAND"
  3374. // "RICH_MEDIA_INPAGE_FLOATING"
  3375. // "RICH_MEDIA_MOBILE_IN_APP"
  3376. // "RICH_MEDIA_PEEL_DOWN"
  3377. // "TRACKING_TEXT"
  3378. // "VPAID_LINEAR_VIDEO"
  3379. // "VPAID_NON_LINEAR_VIDEO"
  3380. Type string `json:"type,omitempty"`
  3381. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  3382. // to the following creative types: INSTREAM_VIDEO and VPAID.
  3383. UniversalAdId *UniversalAdId `json:"universalAdId,omitempty"`
  3384. // Version: The version number helps you keep track of multiple versions
  3385. // of your creative in your reports. The version number will always be
  3386. // auto-generated during insert operations to start at 1. For tracking
  3387. // creatives the version cannot be incremented and will always remain at
  3388. // 1. For all other creative types the version can be incremented only
  3389. // by 1 during update operations. In addition, the version will be
  3390. // automatically incremented by 1 when undergoing Rich Media creative
  3391. // merging. Applicable to all creative types.
  3392. Version int64 `json:"version,omitempty"`
  3393. // VideoDescription: Description of the video ad. Applicable to the
  3394. // following creative types: all INSTREAM_VIDEO and all VPAID.
  3395. VideoDescription string `json:"videoDescription,omitempty"`
  3396. // VideoDuration: Creative video duration in seconds. This is a
  3397. // read-only field. Applicable to the following creative types:
  3398. // INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID.
  3399. VideoDuration float64 `json:"videoDuration,omitempty"`
  3400. // ServerResponse contains the HTTP response code and headers from the
  3401. // server.
  3402. googleapi.ServerResponse `json:"-"`
  3403. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3404. // unconditionally include in API requests. By default, fields with
  3405. // empty values are omitted from API requests. However, any non-pointer,
  3406. // non-interface field appearing in ForceSendFields will be sent to the
  3407. // server regardless of whether the field is empty or not. This may be
  3408. // used to include empty fields in Patch requests.
  3409. ForceSendFields []string `json:"-"`
  3410. // NullFields is a list of field names (e.g. "AccountId") to include in
  3411. // API requests with the JSON null value. By default, fields with empty
  3412. // values are omitted from API requests. However, any field with an
  3413. // empty value appearing in NullFields will be sent to the server as
  3414. // null. It is an error if a field in this list has a non-empty value.
  3415. // This may be used to include null fields in Patch requests.
  3416. NullFields []string `json:"-"`
  3417. }
  3418. func (s *Creative) MarshalJSON() ([]byte, error) {
  3419. type NoMethod Creative
  3420. raw := NoMethod(*s)
  3421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3422. }
  3423. func (s *Creative) UnmarshalJSON(data []byte) error {
  3424. type NoMethod Creative
  3425. var s1 struct {
  3426. VideoDuration gensupport.JSONFloat64 `json:"videoDuration"`
  3427. *NoMethod
  3428. }
  3429. s1.NoMethod = (*NoMethod)(s)
  3430. if err := json.Unmarshal(data, &s1); err != nil {
  3431. return err
  3432. }
  3433. s.VideoDuration = float64(s1.VideoDuration)
  3434. return nil
  3435. }
  3436. // CreativeAsset: Creative Asset.
  3437. type CreativeAsset struct {
  3438. // ActionScript3: Whether ActionScript3 is enabled for the flash asset.
  3439. // This is a read-only field. Applicable to the following creative type:
  3440. // FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is
  3441. // not HTML_IMAGE.
  3442. ActionScript3 bool `json:"actionScript3,omitempty"`
  3443. // Active: Whether the video asset is active. This is a read-only field
  3444. // for VPAID_NON_LINEAR_VIDEO assets. Applicable to the following
  3445. // creative types: INSTREAM_VIDEO and all VPAID.
  3446. Active bool `json:"active,omitempty"`
  3447. // Alignment: Possible alignments for an asset. This is a read-only
  3448. // field. Applicable to the following creative types:
  3449. // RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL.
  3450. //
  3451. // Possible values:
  3452. // "ALIGNMENT_BOTTOM"
  3453. // "ALIGNMENT_LEFT"
  3454. // "ALIGNMENT_RIGHT"
  3455. // "ALIGNMENT_TOP"
  3456. Alignment string `json:"alignment,omitempty"`
  3457. // ArtworkType: Artwork type of rich media creative. This is a read-only
  3458. // field. Applicable to the following creative types: all RICH_MEDIA.
  3459. //
  3460. // Possible values:
  3461. // "ARTWORK_TYPE_FLASH"
  3462. // "ARTWORK_TYPE_HTML5"
  3463. // "ARTWORK_TYPE_IMAGE"
  3464. // "ARTWORK_TYPE_MIXED"
  3465. ArtworkType string `json:"artworkType,omitempty"`
  3466. // AssetIdentifier: Identifier of this asset. This is the same
  3467. // identifier returned during creative asset insert operation. This is a
  3468. // required field. Applicable to all but the following creative types:
  3469. // all REDIRECT and TRACKING_TEXT.
  3470. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3471. // BackupImageExit: Exit event configured for the backup image.
  3472. // Applicable to the following creative types: all RICH_MEDIA.
  3473. BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"`
  3474. // BitRate: Detected bit-rate for video asset. This is a read-only
  3475. // field. Applicable to the following creative types: INSTREAM_VIDEO and
  3476. // all VPAID.
  3477. BitRate int64 `json:"bitRate,omitempty"`
  3478. // ChildAssetType: Rich media child asset type. This is a read-only
  3479. // field. Applicable to the following creative types: all VPAID.
  3480. //
  3481. // Possible values:
  3482. // "CHILD_ASSET_TYPE_DATA"
  3483. // "CHILD_ASSET_TYPE_FLASH"
  3484. // "CHILD_ASSET_TYPE_IMAGE"
  3485. // "CHILD_ASSET_TYPE_VIDEO"
  3486. ChildAssetType string `json:"childAssetType,omitempty"`
  3487. // CollapsedSize: Size of an asset when collapsed. This is a read-only
  3488. // field. Applicable to the following creative types: all RICH_MEDIA and
  3489. // all VPAID. Additionally, applicable to assets whose displayType is
  3490. // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3491. CollapsedSize *Size `json:"collapsedSize,omitempty"`
  3492. // CompanionCreativeIds: List of companion creatives assigned to an
  3493. // in-stream video creative asset. Acceptable values include IDs of
  3494. // existing flash and image creatives. Applicable to INSTREAM_VIDEO
  3495. // creative type with dynamicAssetSelection set to true.
  3496. CompanionCreativeIds googleapi.Int64s `json:"companionCreativeIds,omitempty"`
  3497. // CustomStartTimeValue: Custom start time in seconds for making the
  3498. // asset visible. Applicable to the following creative types: all
  3499. // RICH_MEDIA. Value must be greater than or equal to 0.
  3500. CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"`
  3501. // DetectedFeatures: List of feature dependencies for the creative asset
  3502. // that are detected by DCM. Feature dependencies are features that a
  3503. // browser must be able to support in order to render your HTML5
  3504. // creative correctly. This is a read-only, auto-generated field.
  3505. // Applicable to the following creative types: HTML5_BANNER. Applicable
  3506. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3507. //
  3508. // Possible values:
  3509. // "APPLICATION_CACHE"
  3510. // "AUDIO"
  3511. // "CANVAS"
  3512. // "CANVAS_TEXT"
  3513. // "CSS_ANIMATIONS"
  3514. // "CSS_BACKGROUND_SIZE"
  3515. // "CSS_BORDER_IMAGE"
  3516. // "CSS_BORDER_RADIUS"
  3517. // "CSS_BOX_SHADOW"
  3518. // "CSS_COLUMNS"
  3519. // "CSS_FLEX_BOX"
  3520. // "CSS_FONT_FACE"
  3521. // "CSS_GENERATED_CONTENT"
  3522. // "CSS_GRADIENTS"
  3523. // "CSS_HSLA"
  3524. // "CSS_MULTIPLE_BGS"
  3525. // "CSS_OPACITY"
  3526. // "CSS_REFLECTIONS"
  3527. // "CSS_RGBA"
  3528. // "CSS_TEXT_SHADOW"
  3529. // "CSS_TRANSFORMS"
  3530. // "CSS_TRANSFORMS3D"
  3531. // "CSS_TRANSITIONS"
  3532. // "DRAG_AND_DROP"
  3533. // "GEO_LOCATION"
  3534. // "HASH_CHANGE"
  3535. // "HISTORY"
  3536. // "INDEXED_DB"
  3537. // "INLINE_SVG"
  3538. // "INPUT_ATTR_AUTOCOMPLETE"
  3539. // "INPUT_ATTR_AUTOFOCUS"
  3540. // "INPUT_ATTR_LIST"
  3541. // "INPUT_ATTR_MAX"
  3542. // "INPUT_ATTR_MIN"
  3543. // "INPUT_ATTR_MULTIPLE"
  3544. // "INPUT_ATTR_PATTERN"
  3545. // "INPUT_ATTR_PLACEHOLDER"
  3546. // "INPUT_ATTR_REQUIRED"
  3547. // "INPUT_ATTR_STEP"
  3548. // "INPUT_TYPE_COLOR"
  3549. // "INPUT_TYPE_DATE"
  3550. // "INPUT_TYPE_DATETIME"
  3551. // "INPUT_TYPE_DATETIME_LOCAL"
  3552. // "INPUT_TYPE_EMAIL"
  3553. // "INPUT_TYPE_MONTH"
  3554. // "INPUT_TYPE_NUMBER"
  3555. // "INPUT_TYPE_RANGE"
  3556. // "INPUT_TYPE_SEARCH"
  3557. // "INPUT_TYPE_TEL"
  3558. // "INPUT_TYPE_TIME"
  3559. // "INPUT_TYPE_URL"
  3560. // "INPUT_TYPE_WEEK"
  3561. // "LOCAL_STORAGE"
  3562. // "POST_MESSAGE"
  3563. // "SESSION_STORAGE"
  3564. // "SMIL"
  3565. // "SVG_CLIP_PATHS"
  3566. // "SVG_FE_IMAGE"
  3567. // "SVG_FILTERS"
  3568. // "SVG_HREF"
  3569. // "TOUCH"
  3570. // "VIDEO"
  3571. // "WEBGL"
  3572. // "WEB_SOCKETS"
  3573. // "WEB_SQL_DATABASE"
  3574. // "WEB_WORKERS"
  3575. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3576. // DisplayType: Type of rich media asset. This is a read-only field.
  3577. // Applicable to the following creative types: all RICH_MEDIA.
  3578. //
  3579. // Possible values:
  3580. // "ASSET_DISPLAY_TYPE_BACKDROP"
  3581. // "ASSET_DISPLAY_TYPE_EXPANDING"
  3582. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH"
  3583. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING"
  3584. // "ASSET_DISPLAY_TYPE_FLOATING"
  3585. // "ASSET_DISPLAY_TYPE_INPAGE"
  3586. // "ASSET_DISPLAY_TYPE_OVERLAY"
  3587. // "ASSET_DISPLAY_TYPE_PEEL_DOWN"
  3588. // "ASSET_DISPLAY_TYPE_VPAID_LINEAR"
  3589. // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR"
  3590. DisplayType string `json:"displayType,omitempty"`
  3591. // Duration: Duration in seconds for which an asset will be displayed.
  3592. // Applicable to the following creative types: INSTREAM_VIDEO and
  3593. // VPAID_LINEAR_VIDEO. Value must be greater than or equal to 1.
  3594. Duration int64 `json:"duration,omitempty"`
  3595. // DurationType: Duration type for which an asset will be displayed.
  3596. // Applicable to the following creative types: all RICH_MEDIA.
  3597. //
  3598. // Possible values:
  3599. // "ASSET_DURATION_TYPE_AUTO"
  3600. // "ASSET_DURATION_TYPE_CUSTOM"
  3601. // "ASSET_DURATION_TYPE_NONE"
  3602. DurationType string `json:"durationType,omitempty"`
  3603. // ExpandedDimension: Detected expanded dimension for video asset. This
  3604. // is a read-only field. Applicable to the following creative types:
  3605. // INSTREAM_VIDEO and all VPAID.
  3606. ExpandedDimension *Size `json:"expandedDimension,omitempty"`
  3607. // FileSize: File size associated with this creative asset. This is a
  3608. // read-only field. Applicable to all but the following creative types:
  3609. // all REDIRECT and TRACKING_TEXT.
  3610. FileSize int64 `json:"fileSize,omitempty,string"`
  3611. // FlashVersion: Flash version of the asset. This is a read-only field.
  3612. // Applicable to the following creative types: FLASH_INPAGE, all
  3613. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3614. // asset type is not HTML_IMAGE.
  3615. FlashVersion int64 `json:"flashVersion,omitempty"`
  3616. // HideFlashObjects: Whether to hide Flash objects flag for an asset.
  3617. // Applicable to the following creative types: all RICH_MEDIA.
  3618. HideFlashObjects bool `json:"hideFlashObjects,omitempty"`
  3619. // HideSelectionBoxes: Whether to hide selection boxes flag for an
  3620. // asset. Applicable to the following creative types: all RICH_MEDIA.
  3621. HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"`
  3622. // HorizontallyLocked: Whether the asset is horizontally locked. This is
  3623. // a read-only field. Applicable to the following creative types: all
  3624. // RICH_MEDIA.
  3625. HorizontallyLocked bool `json:"horizontallyLocked,omitempty"`
  3626. // Id: Numeric ID of this creative asset. This is a required field and
  3627. // should not be modified. Applicable to all but the following creative
  3628. // types: all REDIRECT and TRACKING_TEXT.
  3629. Id int64 `json:"id,omitempty,string"`
  3630. // IdDimensionValue: Dimension value for the ID of the asset. This is a
  3631. // read-only, auto-generated field.
  3632. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3633. // MimeType: Detected MIME type for video asset. This is a read-only
  3634. // field. Applicable to the following creative types: INSTREAM_VIDEO and
  3635. // all VPAID.
  3636. MimeType string `json:"mimeType,omitempty"`
  3637. // Offset: Offset position for an asset in collapsed mode. This is a
  3638. // read-only field. Applicable to the following creative types: all
  3639. // RICH_MEDIA and all VPAID. Additionally, only applicable to assets
  3640. // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or
  3641. // ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3642. Offset *OffsetPosition `json:"offset,omitempty"`
  3643. // Orientation: Orientation of video asset. This is a read-only,
  3644. // auto-generated field.
  3645. //
  3646. // Possible values:
  3647. // "LANDSCAPE"
  3648. // "PORTRAIT"
  3649. // "SQUARE"
  3650. Orientation string `json:"orientation,omitempty"`
  3651. // OriginalBackup: Whether the backup asset is original or changed by
  3652. // the user in DCM. Applicable to the following creative types: all
  3653. // RICH_MEDIA.
  3654. OriginalBackup bool `json:"originalBackup,omitempty"`
  3655. // Position: Offset position for an asset. Applicable to the following
  3656. // creative types: all RICH_MEDIA.
  3657. Position *OffsetPosition `json:"position,omitempty"`
  3658. // PositionLeftUnit: Offset left unit for an asset. This is a read-only
  3659. // field. Applicable to the following creative types: all RICH_MEDIA.
  3660. //
  3661. // Possible values:
  3662. // "OFFSET_UNIT_PERCENT"
  3663. // "OFFSET_UNIT_PIXEL"
  3664. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3665. PositionLeftUnit string `json:"positionLeftUnit,omitempty"`
  3666. // PositionTopUnit: Offset top unit for an asset. This is a read-only
  3667. // field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY.
  3668. // Applicable to the following creative types: all RICH_MEDIA.
  3669. //
  3670. // Possible values:
  3671. // "OFFSET_UNIT_PERCENT"
  3672. // "OFFSET_UNIT_PIXEL"
  3673. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3674. PositionTopUnit string `json:"positionTopUnit,omitempty"`
  3675. // ProgressiveServingUrl: Progressive URL for video asset. This is a
  3676. // read-only field. Applicable to the following creative types:
  3677. // INSTREAM_VIDEO and all VPAID.
  3678. ProgressiveServingUrl string `json:"progressiveServingUrl,omitempty"`
  3679. // Pushdown: Whether the asset pushes down other content. Applicable to
  3680. // the following creative types: all RICH_MEDIA. Additionally, only
  3681. // applicable when the asset offsets are 0, the collapsedSize.width
  3682. // matches size.width, and the collapsedSize.height is less than
  3683. // size.height.
  3684. Pushdown bool `json:"pushdown,omitempty"`
  3685. // PushdownDuration: Pushdown duration in seconds for an asset.
  3686. // Applicable to the following creative types: all
  3687. // RICH_MEDIA.Additionally, only applicable when the asset pushdown
  3688. // field is true, the offsets are 0, the collapsedSize.width matches
  3689. // size.width, and the collapsedSize.height is less than size.height.
  3690. // Acceptable values are 0 to 9.99, inclusive.
  3691. PushdownDuration float64 `json:"pushdownDuration,omitempty"`
  3692. // Role: Role of the asset in relation to creative. Applicable to all
  3693. // but the following creative types: all REDIRECT and TRACKING_TEXT.
  3694. // This is a required field.
  3695. // PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE,
  3696. // DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple
  3697. // primary assets), and all VPAID creatives.
  3698. // BACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA,
  3699. // and all VPAID creatives. Applicable to DISPLAY when the primary asset
  3700. // type is not HTML_IMAGE.
  3701. // ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE
  3702. // creatives.
  3703. // OTHER refers to assets from sources other than DCM, such as Studio
  3704. // uploaded assets, applicable to all RICH_MEDIA and all VPAID
  3705. // creatives.
  3706. // PARENT_VIDEO refers to videos uploaded by the user in DCM and is
  3707. // applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3708. // creatives.
  3709. // TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO
  3710. // assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3711. // creatives.
  3712. // ALTERNATE_VIDEO refers to the DCM representation of child asset
  3713. // videos from Studio, and is applicable to VPAID_LINEAR_VIDEO
  3714. // creatives. These cannot be added or removed within DCM.
  3715. // For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and
  3716. // ALTERNATE_VIDEO assets that are marked active serve as backup in case
  3717. // the VPAID creative cannot be served. Only PARENT_VIDEO assets can be
  3718. // added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO
  3719. // creative.
  3720. //
  3721. // Possible values:
  3722. // "ADDITIONAL_FLASH"
  3723. // "ADDITIONAL_IMAGE"
  3724. // "ALTERNATE_VIDEO"
  3725. // "BACKUP_IMAGE"
  3726. // "OTHER"
  3727. // "PARENT_VIDEO"
  3728. // "PRIMARY"
  3729. // "TRANSCODED_VIDEO"
  3730. Role string `json:"role,omitempty"`
  3731. // Size: Size associated with this creative asset. This is a required
  3732. // field when applicable; however for IMAGE and FLASH_INPAGE, creatives
  3733. // if left blank, this field will be automatically set using the actual
  3734. // size of the associated image asset. Applicable to the following
  3735. // creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER,
  3736. // IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary
  3737. // asset type is not HTML_IMAGE.
  3738. Size *Size `json:"size,omitempty"`
  3739. // SslCompliant: Whether the asset is SSL-compliant. This is a read-only
  3740. // field. Applicable to all but the following creative types: all
  3741. // REDIRECT and TRACKING_TEXT.
  3742. SslCompliant bool `json:"sslCompliant,omitempty"`
  3743. // StartTimeType: Initial wait time type before making the asset
  3744. // visible. Applicable to the following creative types: all RICH_MEDIA.
  3745. //
  3746. // Possible values:
  3747. // "ASSET_START_TIME_TYPE_CUSTOM"
  3748. // "ASSET_START_TIME_TYPE_NONE"
  3749. StartTimeType string `json:"startTimeType,omitempty"`
  3750. // StreamingServingUrl: Streaming URL for video asset. This is a
  3751. // read-only field. Applicable to the following creative types:
  3752. // INSTREAM_VIDEO and all VPAID.
  3753. StreamingServingUrl string `json:"streamingServingUrl,omitempty"`
  3754. // Transparency: Whether the asset is transparent. Applicable to the
  3755. // following creative types: all RICH_MEDIA. Additionally, only
  3756. // applicable to HTML5 assets.
  3757. Transparency bool `json:"transparency,omitempty"`
  3758. // VerticallyLocked: Whether the asset is vertically locked. This is a
  3759. // read-only field. Applicable to the following creative types: all
  3760. // RICH_MEDIA.
  3761. VerticallyLocked bool `json:"verticallyLocked,omitempty"`
  3762. // VideoDuration: Detected video duration for video asset. This is a
  3763. // read-only field. Applicable to the following creative types:
  3764. // INSTREAM_VIDEO and all VPAID.
  3765. VideoDuration float64 `json:"videoDuration,omitempty"`
  3766. // WindowMode: Window mode options for flash assets. Applicable to the
  3767. // following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING,
  3768. // RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and
  3769. // RICH_MEDIA_INPAGE_FLOATING.
  3770. //
  3771. // Possible values:
  3772. // "OPAQUE"
  3773. // "TRANSPARENT"
  3774. // "WINDOW"
  3775. WindowMode string `json:"windowMode,omitempty"`
  3776. // ZIndex: zIndex value of an asset. Applicable to the following
  3777. // creative types: all RICH_MEDIA.Additionally, only applicable to
  3778. // assets whose displayType is NOT one of the following types:
  3779. // ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable
  3780. // values are -999999999 to 999999999, inclusive.
  3781. ZIndex int64 `json:"zIndex,omitempty"`
  3782. // ZipFilename: File name of zip file. This is a read-only field.
  3783. // Applicable to the following creative types: HTML5_BANNER.
  3784. ZipFilename string `json:"zipFilename,omitempty"`
  3785. // ZipFilesize: Size of zip file. This is a read-only field. Applicable
  3786. // to the following creative types: HTML5_BANNER.
  3787. ZipFilesize string `json:"zipFilesize,omitempty"`
  3788. // ForceSendFields is a list of field names (e.g. "ActionScript3") to
  3789. // unconditionally include in API requests. By default, fields with
  3790. // empty values are omitted from API requests. However, any non-pointer,
  3791. // non-interface field appearing in ForceSendFields will be sent to the
  3792. // server regardless of whether the field is empty or not. This may be
  3793. // used to include empty fields in Patch requests.
  3794. ForceSendFields []string `json:"-"`
  3795. // NullFields is a list of field names (e.g. "ActionScript3") to include
  3796. // in API requests with the JSON null value. By default, fields with
  3797. // empty values are omitted from API requests. However, any field with
  3798. // an empty value appearing in NullFields will be sent to the server as
  3799. // null. It is an error if a field in this list has a non-empty value.
  3800. // This may be used to include null fields in Patch requests.
  3801. NullFields []string `json:"-"`
  3802. }
  3803. func (s *CreativeAsset) MarshalJSON() ([]byte, error) {
  3804. type NoMethod CreativeAsset
  3805. raw := NoMethod(*s)
  3806. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3807. }
  3808. func (s *CreativeAsset) UnmarshalJSON(data []byte) error {
  3809. type NoMethod CreativeAsset
  3810. var s1 struct {
  3811. PushdownDuration gensupport.JSONFloat64 `json:"pushdownDuration"`
  3812. VideoDuration gensupport.JSONFloat64 `json:"videoDuration"`
  3813. *NoMethod
  3814. }
  3815. s1.NoMethod = (*NoMethod)(s)
  3816. if err := json.Unmarshal(data, &s1); err != nil {
  3817. return err
  3818. }
  3819. s.PushdownDuration = float64(s1.PushdownDuration)
  3820. s.VideoDuration = float64(s1.VideoDuration)
  3821. return nil
  3822. }
  3823. // CreativeAssetId: Creative Asset ID.
  3824. type CreativeAssetId struct {
  3825. // Name: Name of the creative asset. This is a required field while
  3826. // inserting an asset. After insertion, this assetIdentifier is used to
  3827. // identify the uploaded asset. Characters in the name must be
  3828. // alphanumeric or one of the following: ".-_ ". Spaces are allowed.
  3829. Name string `json:"name,omitempty"`
  3830. // Type: Type of asset to upload. This is a required field. FLASH and
  3831. // IMAGE are no longer supported for new uploads. All image assets
  3832. // should use HTML_IMAGE.
  3833. //
  3834. // Possible values:
  3835. // "FLASH"
  3836. // "HTML"
  3837. // "HTML_IMAGE"
  3838. // "IMAGE"
  3839. // "VIDEO"
  3840. Type string `json:"type,omitempty"`
  3841. // ForceSendFields is a list of field names (e.g. "Name") to
  3842. // unconditionally include in API requests. By default, fields with
  3843. // empty values are omitted from API requests. However, any non-pointer,
  3844. // non-interface field appearing in ForceSendFields will be sent to the
  3845. // server regardless of whether the field is empty or not. This may be
  3846. // used to include empty fields in Patch requests.
  3847. ForceSendFields []string `json:"-"`
  3848. // NullFields is a list of field names (e.g. "Name") to include in API
  3849. // requests with the JSON null value. By default, fields with empty
  3850. // values are omitted from API requests. However, any field with an
  3851. // empty value appearing in NullFields will be sent to the server as
  3852. // null. It is an error if a field in this list has a non-empty value.
  3853. // This may be used to include null fields in Patch requests.
  3854. NullFields []string `json:"-"`
  3855. }
  3856. func (s *CreativeAssetId) MarshalJSON() ([]byte, error) {
  3857. type NoMethod CreativeAssetId
  3858. raw := NoMethod(*s)
  3859. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3860. }
  3861. // CreativeAssetMetadata: CreativeAssets contains properties of a
  3862. // creative asset file which will be uploaded or has already been
  3863. // uploaded. Refer to the creative sample code for how to upload assets
  3864. // and insert a creative.
  3865. type CreativeAssetMetadata struct {
  3866. // AssetIdentifier: ID of the creative asset. This is a required field.
  3867. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3868. // ClickTags: List of detected click tags for assets. This is a
  3869. // read-only auto-generated field.
  3870. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3871. // DetectedFeatures: List of feature dependencies for the creative asset
  3872. // that are detected by DCM. Feature dependencies are features that a
  3873. // browser must be able to support in order to render your HTML5
  3874. // creative correctly. This is a read-only, auto-generated field.
  3875. //
  3876. // Possible values:
  3877. // "APPLICATION_CACHE"
  3878. // "AUDIO"
  3879. // "CANVAS"
  3880. // "CANVAS_TEXT"
  3881. // "CSS_ANIMATIONS"
  3882. // "CSS_BACKGROUND_SIZE"
  3883. // "CSS_BORDER_IMAGE"
  3884. // "CSS_BORDER_RADIUS"
  3885. // "CSS_BOX_SHADOW"
  3886. // "CSS_COLUMNS"
  3887. // "CSS_FLEX_BOX"
  3888. // "CSS_FONT_FACE"
  3889. // "CSS_GENERATED_CONTENT"
  3890. // "CSS_GRADIENTS"
  3891. // "CSS_HSLA"
  3892. // "CSS_MULTIPLE_BGS"
  3893. // "CSS_OPACITY"
  3894. // "CSS_REFLECTIONS"
  3895. // "CSS_RGBA"
  3896. // "CSS_TEXT_SHADOW"
  3897. // "CSS_TRANSFORMS"
  3898. // "CSS_TRANSFORMS3D"
  3899. // "CSS_TRANSITIONS"
  3900. // "DRAG_AND_DROP"
  3901. // "GEO_LOCATION"
  3902. // "HASH_CHANGE"
  3903. // "HISTORY"
  3904. // "INDEXED_DB"
  3905. // "INLINE_SVG"
  3906. // "INPUT_ATTR_AUTOCOMPLETE"
  3907. // "INPUT_ATTR_AUTOFOCUS"
  3908. // "INPUT_ATTR_LIST"
  3909. // "INPUT_ATTR_MAX"
  3910. // "INPUT_ATTR_MIN"
  3911. // "INPUT_ATTR_MULTIPLE"
  3912. // "INPUT_ATTR_PATTERN"
  3913. // "INPUT_ATTR_PLACEHOLDER"
  3914. // "INPUT_ATTR_REQUIRED"
  3915. // "INPUT_ATTR_STEP"
  3916. // "INPUT_TYPE_COLOR"
  3917. // "INPUT_TYPE_DATE"
  3918. // "INPUT_TYPE_DATETIME"
  3919. // "INPUT_TYPE_DATETIME_LOCAL"
  3920. // "INPUT_TYPE_EMAIL"
  3921. // "INPUT_TYPE_MONTH"
  3922. // "INPUT_TYPE_NUMBER"
  3923. // "INPUT_TYPE_RANGE"
  3924. // "INPUT_TYPE_SEARCH"
  3925. // "INPUT_TYPE_TEL"
  3926. // "INPUT_TYPE_TIME"
  3927. // "INPUT_TYPE_URL"
  3928. // "INPUT_TYPE_WEEK"
  3929. // "LOCAL_STORAGE"
  3930. // "POST_MESSAGE"
  3931. // "SESSION_STORAGE"
  3932. // "SMIL"
  3933. // "SVG_CLIP_PATHS"
  3934. // "SVG_FE_IMAGE"
  3935. // "SVG_FILTERS"
  3936. // "SVG_HREF"
  3937. // "TOUCH"
  3938. // "VIDEO"
  3939. // "WEBGL"
  3940. // "WEB_SOCKETS"
  3941. // "WEB_SQL_DATABASE"
  3942. // "WEB_WORKERS"
  3943. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3944. // Id: Numeric ID of the asset. This is a read-only, auto-generated
  3945. // field.
  3946. Id int64 `json:"id,omitempty,string"`
  3947. // IdDimensionValue: Dimension value for the numeric ID of the asset.
  3948. // This is a read-only, auto-generated field.
  3949. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3950. // Kind: Identifies what kind of resource this is. Value: the fixed
  3951. // string "dfareporting#creativeAssetMetadata".
  3952. Kind string `json:"kind,omitempty"`
  3953. // WarnedValidationRules: Rules validated during code generation that
  3954. // generated a warning. This is a read-only, auto-generated
  3955. // field.
  3956. //
  3957. // Possible values are:
  3958. // - "ADMOB_REFERENCED"
  3959. // - "ASSET_FORMAT_UNSUPPORTED_DCM"
  3960. // - "ASSET_INVALID"
  3961. // - "CLICK_TAG_HARD_CODED"
  3962. // - "CLICK_TAG_INVALID"
  3963. // - "CLICK_TAG_IN_GWD"
  3964. // - "CLICK_TAG_MISSING"
  3965. // - "CLICK_TAG_MORE_THAN_ONE"
  3966. // - "CLICK_TAG_NON_TOP_LEVEL"
  3967. // - "COMPONENT_UNSUPPORTED_DCM"
  3968. // - "ENABLER_UNSUPPORTED_METHOD_DCM"
  3969. // - "EXTERNAL_FILE_REFERENCED"
  3970. // - "FILE_DETAIL_EMPTY"
  3971. // - "FILE_TYPE_INVALID"
  3972. // - "GWD_PROPERTIES_INVALID"
  3973. // - "HTML5_FEATURE_UNSUPPORTED"
  3974. // - "LINKED_FILE_NOT_FOUND"
  3975. // - "MAX_FLASH_VERSION_11"
  3976. // - "MRAID_REFERENCED"
  3977. // - "NOT_SSL_COMPLIANT"
  3978. // - "ORPHANED_ASSET"
  3979. // - "PRIMARY_HTML_MISSING"
  3980. // - "SVG_INVALID"
  3981. // - "ZIP_INVALID"
  3982. //
  3983. // Possible values:
  3984. // "ADMOB_REFERENCED"
  3985. // "ASSET_FORMAT_UNSUPPORTED_DCM"
  3986. // "ASSET_INVALID"
  3987. // "CLICK_TAG_HARD_CODED"
  3988. // "CLICK_TAG_INVALID"
  3989. // "CLICK_TAG_IN_GWD"
  3990. // "CLICK_TAG_MISSING"
  3991. // "CLICK_TAG_MORE_THAN_ONE"
  3992. // "CLICK_TAG_NON_TOP_LEVEL"
  3993. // "COMPONENT_UNSUPPORTED_DCM"
  3994. // "ENABLER_UNSUPPORTED_METHOD_DCM"
  3995. // "EXTERNAL_FILE_REFERENCED"
  3996. // "FILE_DETAIL_EMPTY"
  3997. // "FILE_TYPE_INVALID"
  3998. // "GWD_PROPERTIES_INVALID"
  3999. // "HTML5_FEATURE_UNSUPPORTED"
  4000. // "LINKED_FILE_NOT_FOUND"
  4001. // "MAX_FLASH_VERSION_11"
  4002. // "MRAID_REFERENCED"
  4003. // "NOT_SSL_COMPLIANT"
  4004. // "ORPHANED_ASSET"
  4005. // "PRIMARY_HTML_MISSING"
  4006. // "SVG_INVALID"
  4007. // "ZIP_INVALID"
  4008. WarnedValidationRules []string `json:"warnedValidationRules,omitempty"`
  4009. // ServerResponse contains the HTTP response code and headers from the
  4010. // server.
  4011. googleapi.ServerResponse `json:"-"`
  4012. // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to
  4013. // unconditionally include in API requests. By default, fields with
  4014. // empty values are omitted from API requests. However, any non-pointer,
  4015. // non-interface field appearing in ForceSendFields will be sent to the
  4016. // server regardless of whether the field is empty or not. This may be
  4017. // used to include empty fields in Patch requests.
  4018. ForceSendFields []string `json:"-"`
  4019. // NullFields is a list of field names (e.g. "AssetIdentifier") to
  4020. // include in API requests with the JSON null value. By default, fields
  4021. // with empty values are omitted from API requests. However, any field
  4022. // with an empty value appearing in NullFields will be sent to the
  4023. // server as null. It is an error if a field in this list has a
  4024. // non-empty value. This may be used to include null fields in Patch
  4025. // requests.
  4026. NullFields []string `json:"-"`
  4027. }
  4028. func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) {
  4029. type NoMethod CreativeAssetMetadata
  4030. raw := NoMethod(*s)
  4031. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4032. }
  4033. // CreativeAssetSelection: Encapsulates the list of rules for asset
  4034. // selection and a default asset in case none of the rules match.
  4035. // Applicable to INSTREAM_VIDEO creatives.
  4036. type CreativeAssetSelection struct {
  4037. // DefaultAssetId: A creativeAssets[].id. This should refer to one of
  4038. // the parent assets in this creative, and will be served if none of the
  4039. // rules match. This is a required field.
  4040. DefaultAssetId int64 `json:"defaultAssetId,omitempty,string"`
  4041. // Rules: Rules determine which asset will be served to a viewer. Rules
  4042. // will be evaluated in the order in which they are stored in this list.
  4043. // This list must contain at least one rule. Applicable to
  4044. // INSTREAM_VIDEO creatives.
  4045. Rules []*Rule `json:"rules,omitempty"`
  4046. // ForceSendFields is a list of field names (e.g. "DefaultAssetId") to
  4047. // unconditionally include in API requests. By default, fields with
  4048. // empty values are omitted from API requests. However, any non-pointer,
  4049. // non-interface field appearing in ForceSendFields will be sent to the
  4050. // server regardless of whether the field is empty or not. This may be
  4051. // used to include empty fields in Patch requests.
  4052. ForceSendFields []string `json:"-"`
  4053. // NullFields is a list of field names (e.g. "DefaultAssetId") to
  4054. // include in API requests with the JSON null value. By default, fields
  4055. // with empty values are omitted from API requests. However, any field
  4056. // with an empty value appearing in NullFields will be sent to the
  4057. // server as null. It is an error if a field in this list has a
  4058. // non-empty value. This may be used to include null fields in Patch
  4059. // requests.
  4060. NullFields []string `json:"-"`
  4061. }
  4062. func (s *CreativeAssetSelection) MarshalJSON() ([]byte, error) {
  4063. type NoMethod CreativeAssetSelection
  4064. raw := NoMethod(*s)
  4065. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4066. }
  4067. // CreativeAssignment: Creative Assignment.
  4068. type CreativeAssignment struct {
  4069. // Active: Whether this creative assignment is active. When true, the
  4070. // creative will be included in the ad's rotation.
  4071. Active bool `json:"active,omitempty"`
  4072. // ApplyEventTags: Whether applicable event tags should fire when this
  4073. // creative assignment is rendered. If this value is unset when the ad
  4074. // is inserted or updated, it will default to true for all creative
  4075. // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT,
  4076. // and INSTREAM_VIDEO.
  4077. ApplyEventTags bool `json:"applyEventTags,omitempty"`
  4078. // ClickThroughUrl: Click-through URL of the creative assignment.
  4079. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  4080. // CompanionCreativeOverrides: Companion creative overrides for this
  4081. // creative assignment. Applicable to video ads.
  4082. CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"`
  4083. // CreativeGroupAssignments: Creative group assignments for this
  4084. // creative assignment. Only one assignment per creative group number is
  4085. // allowed for a maximum of two assignments.
  4086. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  4087. // CreativeId: ID of the creative to be assigned. This is a required
  4088. // field.
  4089. CreativeId int64 `json:"creativeId,omitempty,string"`
  4090. // CreativeIdDimensionValue: Dimension value for the ID of the creative.
  4091. // This is a read-only, auto-generated field.
  4092. CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"`
  4093. // EndTime: Date and time that the assigned creative should stop
  4094. // serving. Must be later than the start time.
  4095. EndTime string `json:"endTime,omitempty"`
  4096. // RichMediaExitOverrides: Rich media exit overrides for this creative
  4097. // assignment.
  4098. // Applicable when the creative type is any of the following:
  4099. // - DISPLAY
  4100. // - RICH_MEDIA_INPAGE
  4101. // - RICH_MEDIA_INPAGE_FLOATING
  4102. // - RICH_MEDIA_IM_EXPAND
  4103. // - RICH_MEDIA_EXPANDING
  4104. // - RICH_MEDIA_INTERSTITIAL_FLOAT
  4105. // - RICH_MEDIA_MOBILE_IN_APP
  4106. // - RICH_MEDIA_MULTI_FLOATING
  4107. // - RICH_MEDIA_PEEL_DOWN
  4108. // - VPAID_LINEAR
  4109. // - VPAID_NON_LINEAR
  4110. RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"`
  4111. // Sequence: Sequence number of the creative assignment, applicable when
  4112. // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable
  4113. // values are 1 to 65535, inclusive.
  4114. Sequence int64 `json:"sequence,omitempty"`
  4115. // SslCompliant: Whether the creative to be assigned is SSL-compliant.
  4116. // This is a read-only field that is auto-generated when the ad is
  4117. // inserted or updated.
  4118. SslCompliant bool `json:"sslCompliant,omitempty"`
  4119. // StartTime: Date and time that the assigned creative should start
  4120. // serving.
  4121. StartTime string `json:"startTime,omitempty"`
  4122. // Weight: Weight of the creative assignment, applicable when the
  4123. // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater
  4124. // than or equal to 1.
  4125. Weight int64 `json:"weight,omitempty"`
  4126. // ForceSendFields is a list of field names (e.g. "Active") to
  4127. // unconditionally include in API requests. By default, fields with
  4128. // empty values are omitted from API requests. However, any non-pointer,
  4129. // non-interface field appearing in ForceSendFields will be sent to the
  4130. // server regardless of whether the field is empty or not. This may be
  4131. // used to include empty fields in Patch requests.
  4132. ForceSendFields []string `json:"-"`
  4133. // NullFields is a list of field names (e.g. "Active") to include in API
  4134. // requests with the JSON null value. By default, fields with empty
  4135. // values are omitted from API requests. However, any field with an
  4136. // empty value appearing in NullFields will be sent to the server as
  4137. // null. It is an error if a field in this list has a non-empty value.
  4138. // This may be used to include null fields in Patch requests.
  4139. NullFields []string `json:"-"`
  4140. }
  4141. func (s *CreativeAssignment) MarshalJSON() ([]byte, error) {
  4142. type NoMethod CreativeAssignment
  4143. raw := NoMethod(*s)
  4144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4145. }
  4146. // CreativeClickThroughUrl: Click-through URL
  4147. type CreativeClickThroughUrl struct {
  4148. // ComputedClickThroughUrl: Read-only convenience field representing the
  4149. // actual URL that will be used for this click-through. The URL is
  4150. // computed as follows:
  4151. // - If landingPageId is specified then that landing page's URL is
  4152. // assigned to this field.
  4153. // - Otherwise, the customClickThroughUrl is assigned to this field.
  4154. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  4155. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  4156. // landingPageId field is left unset.
  4157. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  4158. // LandingPageId: ID of the landing page for the click-through URL.
  4159. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  4160. // ForceSendFields is a list of field names (e.g.
  4161. // "ComputedClickThroughUrl") to unconditionally include in API
  4162. // requests. By default, fields with empty values are omitted from API
  4163. // requests. However, any non-pointer, non-interface field appearing in
  4164. // ForceSendFields will be sent to the server regardless of whether the
  4165. // field is empty or not. This may be used to include empty fields in
  4166. // Patch requests.
  4167. ForceSendFields []string `json:"-"`
  4168. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  4169. // to include in API requests with the JSON null value. By default,
  4170. // fields with empty values are omitted from API requests. However, any
  4171. // field with an empty value appearing in NullFields will be sent to the
  4172. // server as null. It is an error if a field in this list has a
  4173. // non-empty value. This may be used to include null fields in Patch
  4174. // requests.
  4175. NullFields []string `json:"-"`
  4176. }
  4177. func (s *CreativeClickThroughUrl) MarshalJSON() ([]byte, error) {
  4178. type NoMethod CreativeClickThroughUrl
  4179. raw := NoMethod(*s)
  4180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4181. }
  4182. // CreativeCustomEvent: Creative Custom Event.
  4183. type CreativeCustomEvent struct {
  4184. // AdvertiserCustomEventId: Unique ID of this event used by DDM
  4185. // Reporting and Data Transfer. This is a read-only field.
  4186. AdvertiserCustomEventId int64 `json:"advertiserCustomEventId,omitempty,string"`
  4187. // AdvertiserCustomEventName: User-entered name for the event.
  4188. AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"`
  4189. // AdvertiserCustomEventType: Type of the event. This is a read-only
  4190. // field.
  4191. //
  4192. // Possible values:
  4193. // "ADVERTISER_EVENT_COUNTER"
  4194. // "ADVERTISER_EVENT_EXIT"
  4195. // "ADVERTISER_EVENT_TIMER"
  4196. AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"`
  4197. // ArtworkLabel: Artwork label column, used to link events in DCM back
  4198. // to events in Studio. This is a required field and should not be
  4199. // modified after insertion.
  4200. ArtworkLabel string `json:"artworkLabel,omitempty"`
  4201. // ArtworkType: Artwork type used by the creative.This is a read-only
  4202. // field.
  4203. //
  4204. // Possible values:
  4205. // "ARTWORK_TYPE_FLASH"
  4206. // "ARTWORK_TYPE_HTML5"
  4207. // "ARTWORK_TYPE_IMAGE"
  4208. // "ARTWORK_TYPE_MIXED"
  4209. ArtworkType string `json:"artworkType,omitempty"`
  4210. // ExitClickThroughUrl: Exit click-through URL for the event. This field
  4211. // is used only for exit events.
  4212. ExitClickThroughUrl *CreativeClickThroughUrl `json:"exitClickThroughUrl,omitempty"`
  4213. // Id: ID of this event. This is a required field and should not be
  4214. // modified after insertion.
  4215. Id int64 `json:"id,omitempty,string"`
  4216. // PopupWindowProperties: Properties for rich media popup windows. This
  4217. // field is used only for exit events.
  4218. PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"`
  4219. // TargetType: Target type used by the event.
  4220. //
  4221. // Possible values:
  4222. // "TARGET_BLANK"
  4223. // "TARGET_PARENT"
  4224. // "TARGET_POPUP"
  4225. // "TARGET_SELF"
  4226. // "TARGET_TOP"
  4227. TargetType string `json:"targetType,omitempty"`
  4228. // VideoReportingId: Video reporting ID, used to differentiate multiple
  4229. // videos in a single creative. This is a read-only field.
  4230. VideoReportingId string `json:"videoReportingId,omitempty"`
  4231. // ForceSendFields is a list of field names (e.g.
  4232. // "AdvertiserCustomEventId") to unconditionally include in API
  4233. // requests. By default, fields with empty values are omitted from API
  4234. // requests. However, any non-pointer, non-interface field appearing in
  4235. // ForceSendFields will be sent to the server regardless of whether the
  4236. // field is empty or not. This may be used to include empty fields in
  4237. // Patch requests.
  4238. ForceSendFields []string `json:"-"`
  4239. // NullFields is a list of field names (e.g. "AdvertiserCustomEventId")
  4240. // to include in API requests with the JSON null value. By default,
  4241. // fields with empty values are omitted from API requests. However, any
  4242. // field with an empty value appearing in NullFields will be sent to the
  4243. // server as null. It is an error if a field in this list has a
  4244. // non-empty value. This may be used to include null fields in Patch
  4245. // requests.
  4246. NullFields []string `json:"-"`
  4247. }
  4248. func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) {
  4249. type NoMethod CreativeCustomEvent
  4250. raw := NoMethod(*s)
  4251. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4252. }
  4253. // CreativeField: Contains properties of a creative field.
  4254. type CreativeField struct {
  4255. // AccountId: Account ID of this creative field. This is a read-only
  4256. // field that can be left blank.
  4257. AccountId int64 `json:"accountId,omitempty,string"`
  4258. // AdvertiserId: Advertiser ID of this creative field. This is a
  4259. // required field on insertion.
  4260. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4261. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4262. // advertiser. This is a read-only, auto-generated field.
  4263. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4264. // Id: ID of this creative field. This is a read-only, auto-generated
  4265. // field.
  4266. Id int64 `json:"id,omitempty,string"`
  4267. // Kind: Identifies what kind of resource this is. Value: the fixed
  4268. // string "dfareporting#creativeField".
  4269. Kind string `json:"kind,omitempty"`
  4270. // Name: Name of this creative field. This is a required field and must
  4271. // be less than 256 characters long and unique among creative fields of
  4272. // the same advertiser.
  4273. Name string `json:"name,omitempty"`
  4274. // SubaccountId: Subaccount ID of this creative field. This is a
  4275. // read-only field that can be left blank.
  4276. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4277. // ServerResponse contains the HTTP response code and headers from the
  4278. // server.
  4279. googleapi.ServerResponse `json:"-"`
  4280. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4281. // unconditionally include in API requests. By default, fields with
  4282. // empty values are omitted from API requests. However, any non-pointer,
  4283. // non-interface field appearing in ForceSendFields will be sent to the
  4284. // server regardless of whether the field is empty or not. This may be
  4285. // used to include empty fields in Patch requests.
  4286. ForceSendFields []string `json:"-"`
  4287. // NullFields is a list of field names (e.g. "AccountId") to include in
  4288. // API requests with the JSON null value. By default, fields with empty
  4289. // values are omitted from API requests. However, any field with an
  4290. // empty value appearing in NullFields will be sent to the server as
  4291. // null. It is an error if a field in this list has a non-empty value.
  4292. // This may be used to include null fields in Patch requests.
  4293. NullFields []string `json:"-"`
  4294. }
  4295. func (s *CreativeField) MarshalJSON() ([]byte, error) {
  4296. type NoMethod CreativeField
  4297. raw := NoMethod(*s)
  4298. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4299. }
  4300. // CreativeFieldAssignment: Creative Field Assignment.
  4301. type CreativeFieldAssignment struct {
  4302. // CreativeFieldId: ID of the creative field.
  4303. CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"`
  4304. // CreativeFieldValueId: ID of the creative field value.
  4305. CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"`
  4306. // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to
  4307. // unconditionally include in API requests. By default, fields with
  4308. // empty values are omitted from API requests. However, any non-pointer,
  4309. // non-interface field appearing in ForceSendFields will be sent to the
  4310. // server regardless of whether the field is empty or not. This may be
  4311. // used to include empty fields in Patch requests.
  4312. ForceSendFields []string `json:"-"`
  4313. // NullFields is a list of field names (e.g. "CreativeFieldId") to
  4314. // include in API requests with the JSON null value. By default, fields
  4315. // with empty values are omitted from API requests. However, any field
  4316. // with an empty value appearing in NullFields will be sent to the
  4317. // server as null. It is an error if a field in this list has a
  4318. // non-empty value. This may be used to include null fields in Patch
  4319. // requests.
  4320. NullFields []string `json:"-"`
  4321. }
  4322. func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) {
  4323. type NoMethod CreativeFieldAssignment
  4324. raw := NoMethod(*s)
  4325. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4326. }
  4327. // CreativeFieldValue: Contains properties of a creative field value.
  4328. type CreativeFieldValue struct {
  4329. // Id: ID of this creative field value. This is a read-only,
  4330. // auto-generated field.
  4331. Id int64 `json:"id,omitempty,string"`
  4332. // Kind: Identifies what kind of resource this is. Value: the fixed
  4333. // string "dfareporting#creativeFieldValue".
  4334. Kind string `json:"kind,omitempty"`
  4335. // Value: Value of this creative field value. It needs to be less than
  4336. // 256 characters in length and unique per creative field.
  4337. Value string `json:"value,omitempty"`
  4338. // ServerResponse contains the HTTP response code and headers from the
  4339. // server.
  4340. googleapi.ServerResponse `json:"-"`
  4341. // ForceSendFields is a list of field names (e.g. "Id") to
  4342. // unconditionally include in API requests. By default, fields with
  4343. // empty values are omitted from API requests. However, any non-pointer,
  4344. // non-interface field appearing in ForceSendFields will be sent to the
  4345. // server regardless of whether the field is empty or not. This may be
  4346. // used to include empty fields in Patch requests.
  4347. ForceSendFields []string `json:"-"`
  4348. // NullFields is a list of field names (e.g. "Id") to include in API
  4349. // requests with the JSON null value. By default, fields with empty
  4350. // values are omitted from API requests. However, any field with an
  4351. // empty value appearing in NullFields will be sent to the server as
  4352. // null. It is an error if a field in this list has a non-empty value.
  4353. // This may be used to include null fields in Patch requests.
  4354. NullFields []string `json:"-"`
  4355. }
  4356. func (s *CreativeFieldValue) MarshalJSON() ([]byte, error) {
  4357. type NoMethod CreativeFieldValue
  4358. raw := NoMethod(*s)
  4359. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4360. }
  4361. // CreativeFieldValuesListResponse: Creative Field Value List Response
  4362. type CreativeFieldValuesListResponse struct {
  4363. // CreativeFieldValues: Creative field value collection.
  4364. CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"`
  4365. // Kind: Identifies what kind of resource this is. Value: the fixed
  4366. // string "dfareporting#creativeFieldValuesListResponse".
  4367. Kind string `json:"kind,omitempty"`
  4368. // NextPageToken: Pagination token to be used for the next list
  4369. // operation.
  4370. NextPageToken string `json:"nextPageToken,omitempty"`
  4371. // ServerResponse contains the HTTP response code and headers from the
  4372. // server.
  4373. googleapi.ServerResponse `json:"-"`
  4374. // ForceSendFields is a list of field names (e.g. "CreativeFieldValues")
  4375. // to unconditionally include in API requests. By default, fields with
  4376. // empty values are omitted from API requests. However, any non-pointer,
  4377. // non-interface field appearing in ForceSendFields will be sent to the
  4378. // server regardless of whether the field is empty or not. This may be
  4379. // used to include empty fields in Patch requests.
  4380. ForceSendFields []string `json:"-"`
  4381. // NullFields is a list of field names (e.g. "CreativeFieldValues") to
  4382. // include in API requests with the JSON null value. By default, fields
  4383. // with empty values are omitted from API requests. However, any field
  4384. // with an empty value appearing in NullFields will be sent to the
  4385. // server as null. It is an error if a field in this list has a
  4386. // non-empty value. This may be used to include null fields in Patch
  4387. // requests.
  4388. NullFields []string `json:"-"`
  4389. }
  4390. func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) {
  4391. type NoMethod CreativeFieldValuesListResponse
  4392. raw := NoMethod(*s)
  4393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4394. }
  4395. // CreativeFieldsListResponse: Creative Field List Response
  4396. type CreativeFieldsListResponse struct {
  4397. // CreativeFields: Creative field collection.
  4398. CreativeFields []*CreativeField `json:"creativeFields,omitempty"`
  4399. // Kind: Identifies what kind of resource this is. Value: the fixed
  4400. // string "dfareporting#creativeFieldsListResponse".
  4401. Kind string `json:"kind,omitempty"`
  4402. // NextPageToken: Pagination token to be used for the next list
  4403. // operation.
  4404. NextPageToken string `json:"nextPageToken,omitempty"`
  4405. // ServerResponse contains the HTTP response code and headers from the
  4406. // server.
  4407. googleapi.ServerResponse `json:"-"`
  4408. // ForceSendFields is a list of field names (e.g. "CreativeFields") to
  4409. // unconditionally include in API requests. By default, fields with
  4410. // empty values are omitted from API requests. However, any non-pointer,
  4411. // non-interface field appearing in ForceSendFields will be sent to the
  4412. // server regardless of whether the field is empty or not. This may be
  4413. // used to include empty fields in Patch requests.
  4414. ForceSendFields []string `json:"-"`
  4415. // NullFields is a list of field names (e.g. "CreativeFields") to
  4416. // include in API requests with the JSON null value. By default, fields
  4417. // with empty values are omitted from API requests. However, any field
  4418. // with an empty value appearing in NullFields will be sent to the
  4419. // server as null. It is an error if a field in this list has a
  4420. // non-empty value. This may be used to include null fields in Patch
  4421. // requests.
  4422. NullFields []string `json:"-"`
  4423. }
  4424. func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) {
  4425. type NoMethod CreativeFieldsListResponse
  4426. raw := NoMethod(*s)
  4427. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4428. }
  4429. // CreativeGroup: Contains properties of a creative group.
  4430. type CreativeGroup struct {
  4431. // AccountId: Account ID of this creative group. This is a read-only
  4432. // field that can be left blank.
  4433. AccountId int64 `json:"accountId,omitempty,string"`
  4434. // AdvertiserId: Advertiser ID of this creative group. This is a
  4435. // required field on insertion.
  4436. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4437. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4438. // advertiser. This is a read-only, auto-generated field.
  4439. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4440. // GroupNumber: Subgroup of the creative group. Assign your creative
  4441. // groups to a subgroup in order to filter or manage them more easily.
  4442. // This field is required on insertion and is read-only after insertion.
  4443. // Acceptable values are 1 to 2, inclusive.
  4444. GroupNumber int64 `json:"groupNumber,omitempty"`
  4445. // Id: ID of this creative group. This is a read-only, auto-generated
  4446. // field.
  4447. Id int64 `json:"id,omitempty,string"`
  4448. // Kind: Identifies what kind of resource this is. Value: the fixed
  4449. // string "dfareporting#creativeGroup".
  4450. Kind string `json:"kind,omitempty"`
  4451. // Name: Name of this creative group. This is a required field and must
  4452. // be less than 256 characters long and unique among creative groups of
  4453. // the same advertiser.
  4454. Name string `json:"name,omitempty"`
  4455. // SubaccountId: Subaccount ID of this creative group. This is a
  4456. // read-only field that can be left blank.
  4457. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4458. // ServerResponse contains the HTTP response code and headers from the
  4459. // server.
  4460. googleapi.ServerResponse `json:"-"`
  4461. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4462. // unconditionally include in API requests. By default, fields with
  4463. // empty values are omitted from API requests. However, any non-pointer,
  4464. // non-interface field appearing in ForceSendFields will be sent to the
  4465. // server regardless of whether the field is empty or not. This may be
  4466. // used to include empty fields in Patch requests.
  4467. ForceSendFields []string `json:"-"`
  4468. // NullFields is a list of field names (e.g. "AccountId") to include in
  4469. // API requests with the JSON null value. By default, fields with empty
  4470. // values are omitted from API requests. However, any field with an
  4471. // empty value appearing in NullFields will be sent to the server as
  4472. // null. It is an error if a field in this list has a non-empty value.
  4473. // This may be used to include null fields in Patch requests.
  4474. NullFields []string `json:"-"`
  4475. }
  4476. func (s *CreativeGroup) MarshalJSON() ([]byte, error) {
  4477. type NoMethod CreativeGroup
  4478. raw := NoMethod(*s)
  4479. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4480. }
  4481. // CreativeGroupAssignment: Creative Group Assignment.
  4482. type CreativeGroupAssignment struct {
  4483. // CreativeGroupId: ID of the creative group to be assigned.
  4484. CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"`
  4485. // CreativeGroupNumber: Creative group number of the creative group
  4486. // assignment.
  4487. //
  4488. // Possible values:
  4489. // "CREATIVE_GROUP_ONE"
  4490. // "CREATIVE_GROUP_TWO"
  4491. CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"`
  4492. // ForceSendFields is a list of field names (e.g. "CreativeGroupId") 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. "CreativeGroupId") 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 *CreativeGroupAssignment) MarshalJSON() ([]byte, error) {
  4509. type NoMethod CreativeGroupAssignment
  4510. raw := NoMethod(*s)
  4511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4512. }
  4513. // CreativeGroupsListResponse: Creative Group List Response
  4514. type CreativeGroupsListResponse struct {
  4515. // CreativeGroups: Creative group collection.
  4516. CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"`
  4517. // Kind: Identifies what kind of resource this is. Value: the fixed
  4518. // string "dfareporting#creativeGroupsListResponse".
  4519. Kind string `json:"kind,omitempty"`
  4520. // NextPageToken: Pagination token to be used for the next list
  4521. // operation.
  4522. NextPageToken string `json:"nextPageToken,omitempty"`
  4523. // ServerResponse contains the HTTP response code and headers from the
  4524. // server.
  4525. googleapi.ServerResponse `json:"-"`
  4526. // ForceSendFields is a list of field names (e.g. "CreativeGroups") to
  4527. // unconditionally include in API requests. By default, fields with
  4528. // empty values are omitted from API requests. However, any non-pointer,
  4529. // non-interface field appearing in ForceSendFields will be sent to the
  4530. // server regardless of whether the field is empty or not. This may be
  4531. // used to include empty fields in Patch requests.
  4532. ForceSendFields []string `json:"-"`
  4533. // NullFields is a list of field names (e.g. "CreativeGroups") to
  4534. // include in API requests with the JSON null value. By default, fields
  4535. // with empty values are omitted from API requests. However, any field
  4536. // with an empty value appearing in NullFields will be sent to the
  4537. // server as null. It is an error if a field in this list has a
  4538. // non-empty value. This may be used to include null fields in Patch
  4539. // requests.
  4540. NullFields []string `json:"-"`
  4541. }
  4542. func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) {
  4543. type NoMethod CreativeGroupsListResponse
  4544. raw := NoMethod(*s)
  4545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4546. }
  4547. // CreativeOptimizationConfiguration: Creative optimization settings.
  4548. type CreativeOptimizationConfiguration struct {
  4549. // Id: ID of this creative optimization config. This field is
  4550. // auto-generated when the campaign is inserted or updated. It can be
  4551. // null for existing campaigns.
  4552. Id int64 `json:"id,omitempty,string"`
  4553. // Name: Name of this creative optimization config. This is a required
  4554. // field and must be less than 129 characters long.
  4555. Name string `json:"name,omitempty"`
  4556. // OptimizationActivitys: List of optimization activities associated
  4557. // with this configuration.
  4558. OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"`
  4559. // OptimizationModel: Optimization model for this configuration.
  4560. //
  4561. // Possible values:
  4562. // "CLICK"
  4563. // "POST_CLICK"
  4564. // "POST_CLICK_AND_IMPRESSION"
  4565. // "POST_IMPRESSION"
  4566. // "VIDEO_COMPLETION"
  4567. OptimizationModel string `json:"optimizationModel,omitempty"`
  4568. // ForceSendFields is a list of field names (e.g. "Id") to
  4569. // unconditionally include in API requests. By default, fields with
  4570. // empty values are omitted from API requests. However, any non-pointer,
  4571. // non-interface field appearing in ForceSendFields will be sent to the
  4572. // server regardless of whether the field is empty or not. This may be
  4573. // used to include empty fields in Patch requests.
  4574. ForceSendFields []string `json:"-"`
  4575. // NullFields is a list of field names (e.g. "Id") to include in API
  4576. // requests with the JSON null value. By default, fields with empty
  4577. // values are omitted from API requests. However, any field with an
  4578. // empty value appearing in NullFields will be sent to the server as
  4579. // null. It is an error if a field in this list has a non-empty value.
  4580. // This may be used to include null fields in Patch requests.
  4581. NullFields []string `json:"-"`
  4582. }
  4583. func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) {
  4584. type NoMethod CreativeOptimizationConfiguration
  4585. raw := NoMethod(*s)
  4586. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4587. }
  4588. // CreativeRotation: Creative Rotation.
  4589. type CreativeRotation struct {
  4590. // CreativeAssignments: Creative assignments in this creative rotation.
  4591. CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"`
  4592. // CreativeOptimizationConfigurationId: Creative optimization
  4593. // configuration that is used by this ad. It should refer to one of the
  4594. // existing optimization configurations in the ad's campaign. If it is
  4595. // unset or set to 0, then the campaign's default optimization
  4596. // configuration will be used for this ad.
  4597. CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"`
  4598. // Type: Type of creative rotation. Can be used to specify whether to
  4599. // use sequential or random rotation.
  4600. //
  4601. // Possible values:
  4602. // "CREATIVE_ROTATION_TYPE_RANDOM"
  4603. // "CREATIVE_ROTATION_TYPE_SEQUENTIAL"
  4604. Type string `json:"type,omitempty"`
  4605. // WeightCalculationStrategy: Strategy for calculating weights. Used
  4606. // with CREATIVE_ROTATION_TYPE_RANDOM.
  4607. //
  4608. // Possible values:
  4609. // "WEIGHT_STRATEGY_CUSTOM"
  4610. // "WEIGHT_STRATEGY_EQUAL"
  4611. // "WEIGHT_STRATEGY_HIGHEST_CTR"
  4612. // "WEIGHT_STRATEGY_OPTIMIZED"
  4613. WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"`
  4614. // ForceSendFields is a list of field names (e.g. "CreativeAssignments")
  4615. // to unconditionally include in API requests. By default, fields with
  4616. // empty values are omitted from API requests. However, any non-pointer,
  4617. // non-interface field appearing in ForceSendFields will be sent to the
  4618. // server regardless of whether the field is empty or not. This may be
  4619. // used to include empty fields in Patch requests.
  4620. ForceSendFields []string `json:"-"`
  4621. // NullFields is a list of field names (e.g. "CreativeAssignments") to
  4622. // include in API requests with the JSON null value. By default, fields
  4623. // with empty values are omitted from API requests. However, any field
  4624. // with an empty value appearing in NullFields will be sent to the
  4625. // server as null. It is an error if a field in this list has a
  4626. // non-empty value. This may be used to include null fields in Patch
  4627. // requests.
  4628. NullFields []string `json:"-"`
  4629. }
  4630. func (s *CreativeRotation) MarshalJSON() ([]byte, error) {
  4631. type NoMethod CreativeRotation
  4632. raw := NoMethod(*s)
  4633. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4634. }
  4635. // CreativeSettings: Creative Settings
  4636. type CreativeSettings struct {
  4637. // IFrameFooter: Header text for iFrames for this site. Must be less
  4638. // than or equal to 2000 characters long.
  4639. IFrameFooter string `json:"iFrameFooter,omitempty"`
  4640. // IFrameHeader: Header text for iFrames for this site. Must be less
  4641. // than or equal to 2000 characters long.
  4642. IFrameHeader string `json:"iFrameHeader,omitempty"`
  4643. // ForceSendFields is a list of field names (e.g. "IFrameFooter") to
  4644. // unconditionally include in API requests. By default, fields with
  4645. // empty values are omitted from API requests. However, any non-pointer,
  4646. // non-interface field appearing in ForceSendFields will be sent to the
  4647. // server regardless of whether the field is empty or not. This may be
  4648. // used to include empty fields in Patch requests.
  4649. ForceSendFields []string `json:"-"`
  4650. // NullFields is a list of field names (e.g. "IFrameFooter") to include
  4651. // in API requests with the JSON null value. By default, fields with
  4652. // empty values are omitted from API requests. However, any field with
  4653. // an empty value appearing in NullFields will be sent to the server as
  4654. // null. It is an error if a field in this list has a non-empty value.
  4655. // This may be used to include null fields in Patch requests.
  4656. NullFields []string `json:"-"`
  4657. }
  4658. func (s *CreativeSettings) MarshalJSON() ([]byte, error) {
  4659. type NoMethod CreativeSettings
  4660. raw := NoMethod(*s)
  4661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4662. }
  4663. // CreativesListResponse: Creative List Response
  4664. type CreativesListResponse struct {
  4665. // Creatives: Creative collection.
  4666. Creatives []*Creative `json:"creatives,omitempty"`
  4667. // Kind: Identifies what kind of resource this is. Value: the fixed
  4668. // string "dfareporting#creativesListResponse".
  4669. Kind string `json:"kind,omitempty"`
  4670. // NextPageToken: Pagination token to be used for the next list
  4671. // operation.
  4672. NextPageToken string `json:"nextPageToken,omitempty"`
  4673. // ServerResponse contains the HTTP response code and headers from the
  4674. // server.
  4675. googleapi.ServerResponse `json:"-"`
  4676. // ForceSendFields is a list of field names (e.g. "Creatives") to
  4677. // unconditionally include in API requests. By default, fields with
  4678. // empty values are omitted from API requests. However, any non-pointer,
  4679. // non-interface field appearing in ForceSendFields will be sent to the
  4680. // server regardless of whether the field is empty or not. This may be
  4681. // used to include empty fields in Patch requests.
  4682. ForceSendFields []string `json:"-"`
  4683. // NullFields is a list of field names (e.g. "Creatives") to include in
  4684. // API requests with the JSON null value. By default, fields with empty
  4685. // values are omitted from API requests. However, any field with an
  4686. // empty value appearing in NullFields will be sent to the server as
  4687. // null. It is an error if a field in this list has a non-empty value.
  4688. // This may be used to include null fields in Patch requests.
  4689. NullFields []string `json:"-"`
  4690. }
  4691. func (s *CreativesListResponse) MarshalJSON() ([]byte, error) {
  4692. type NoMethod CreativesListResponse
  4693. raw := NoMethod(*s)
  4694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4695. }
  4696. // CrossDimensionReachReportCompatibleFields: Represents fields that are
  4697. // compatible to be selected for a report of type
  4698. // "CROSS_DIMENSION_REACH".
  4699. type CrossDimensionReachReportCompatibleFields struct {
  4700. // Breakdown: Dimensions which are compatible to be selected in the
  4701. // "breakdown" section of the report.
  4702. Breakdown []*Dimension `json:"breakdown,omitempty"`
  4703. // DimensionFilters: Dimensions which are compatible to be selected in
  4704. // the "dimensionFilters" section of the report.
  4705. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  4706. // Kind: The kind of resource this is, in this case
  4707. // dfareporting#crossDimensionReachReportCompatibleFields.
  4708. Kind string `json:"kind,omitempty"`
  4709. // Metrics: Metrics which are compatible to be selected in the
  4710. // "metricNames" section of the report.
  4711. Metrics []*Metric `json:"metrics,omitempty"`
  4712. // OverlapMetrics: Metrics which are compatible to be selected in the
  4713. // "overlapMetricNames" section of the report.
  4714. OverlapMetrics []*Metric `json:"overlapMetrics,omitempty"`
  4715. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  4716. // unconditionally include in API requests. By default, fields with
  4717. // empty values are omitted from API requests. However, any non-pointer,
  4718. // non-interface field appearing in ForceSendFields will be sent to the
  4719. // server regardless of whether the field is empty or not. This may be
  4720. // used to include empty fields in Patch requests.
  4721. ForceSendFields []string `json:"-"`
  4722. // NullFields is a list of field names (e.g. "Breakdown") to include in
  4723. // API requests with the JSON null value. By default, fields with empty
  4724. // values are omitted from API requests. However, any field with an
  4725. // empty value appearing in NullFields will be sent to the server as
  4726. // null. It is an error if a field in this list has a non-empty value.
  4727. // This may be used to include null fields in Patch requests.
  4728. NullFields []string `json:"-"`
  4729. }
  4730. func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  4731. type NoMethod CrossDimensionReachReportCompatibleFields
  4732. raw := NoMethod(*s)
  4733. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4734. }
  4735. // CustomFloodlightVariable: A custom floodlight variable.
  4736. type CustomFloodlightVariable struct {
  4737. // Kind: Identifies what kind of resource this is. Value: the fixed
  4738. // string "dfareporting#customFloodlightVariable".
  4739. Kind string `json:"kind,omitempty"`
  4740. // Type: The type of custom floodlight variable to supply a value for.
  4741. // These map to the "u[1-20]=" in the tags.
  4742. //
  4743. // Possible values:
  4744. // "U1"
  4745. // "U10"
  4746. // "U100"
  4747. // "U11"
  4748. // "U12"
  4749. // "U13"
  4750. // "U14"
  4751. // "U15"
  4752. // "U16"
  4753. // "U17"
  4754. // "U18"
  4755. // "U19"
  4756. // "U2"
  4757. // "U20"
  4758. // "U21"
  4759. // "U22"
  4760. // "U23"
  4761. // "U24"
  4762. // "U25"
  4763. // "U26"
  4764. // "U27"
  4765. // "U28"
  4766. // "U29"
  4767. // "U3"
  4768. // "U30"
  4769. // "U31"
  4770. // "U32"
  4771. // "U33"
  4772. // "U34"
  4773. // "U35"
  4774. // "U36"
  4775. // "U37"
  4776. // "U38"
  4777. // "U39"
  4778. // "U4"
  4779. // "U40"
  4780. // "U41"
  4781. // "U42"
  4782. // "U43"
  4783. // "U44"
  4784. // "U45"
  4785. // "U46"
  4786. // "U47"
  4787. // "U48"
  4788. // "U49"
  4789. // "U5"
  4790. // "U50"
  4791. // "U51"
  4792. // "U52"
  4793. // "U53"
  4794. // "U54"
  4795. // "U55"
  4796. // "U56"
  4797. // "U57"
  4798. // "U58"
  4799. // "U59"
  4800. // "U6"
  4801. // "U60"
  4802. // "U61"
  4803. // "U62"
  4804. // "U63"
  4805. // "U64"
  4806. // "U65"
  4807. // "U66"
  4808. // "U67"
  4809. // "U68"
  4810. // "U69"
  4811. // "U7"
  4812. // "U70"
  4813. // "U71"
  4814. // "U72"
  4815. // "U73"
  4816. // "U74"
  4817. // "U75"
  4818. // "U76"
  4819. // "U77"
  4820. // "U78"
  4821. // "U79"
  4822. // "U8"
  4823. // "U80"
  4824. // "U81"
  4825. // "U82"
  4826. // "U83"
  4827. // "U84"
  4828. // "U85"
  4829. // "U86"
  4830. // "U87"
  4831. // "U88"
  4832. // "U89"
  4833. // "U9"
  4834. // "U90"
  4835. // "U91"
  4836. // "U92"
  4837. // "U93"
  4838. // "U94"
  4839. // "U95"
  4840. // "U96"
  4841. // "U97"
  4842. // "U98"
  4843. // "U99"
  4844. Type string `json:"type,omitempty"`
  4845. // Value: The value of the custom floodlight variable. The length of
  4846. // string must not exceed 50 characters.
  4847. Value string `json:"value,omitempty"`
  4848. // ForceSendFields is a list of field names (e.g. "Kind") to
  4849. // unconditionally include in API requests. By default, fields with
  4850. // empty values are omitted from API requests. However, any non-pointer,
  4851. // non-interface field appearing in ForceSendFields will be sent to the
  4852. // server regardless of whether the field is empty or not. This may be
  4853. // used to include empty fields in Patch requests.
  4854. ForceSendFields []string `json:"-"`
  4855. // NullFields is a list of field names (e.g. "Kind") to include in API
  4856. // requests with the JSON null value. By default, fields with empty
  4857. // values are omitted from API requests. However, any field with an
  4858. // empty value appearing in NullFields will be sent to the server as
  4859. // null. It is an error if a field in this list has a non-empty value.
  4860. // This may be used to include null fields in Patch requests.
  4861. NullFields []string `json:"-"`
  4862. }
  4863. func (s *CustomFloodlightVariable) MarshalJSON() ([]byte, error) {
  4864. type NoMethod CustomFloodlightVariable
  4865. raw := NoMethod(*s)
  4866. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4867. }
  4868. // CustomRichMediaEvents: Represents a Custom Rich Media Events group.
  4869. type CustomRichMediaEvents struct {
  4870. // FilteredEventIds: List of custom rich media event IDs. Dimension
  4871. // values must be all of type dfa:richMediaEventTypeIdAndName.
  4872. FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"`
  4873. // Kind: The kind of resource this is, in this case
  4874. // dfareporting#customRichMediaEvents.
  4875. Kind string `json:"kind,omitempty"`
  4876. // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to
  4877. // unconditionally include in API requests. By default, fields with
  4878. // empty values are omitted from API requests. However, any non-pointer,
  4879. // non-interface field appearing in ForceSendFields will be sent to the
  4880. // server regardless of whether the field is empty or not. This may be
  4881. // used to include empty fields in Patch requests.
  4882. ForceSendFields []string `json:"-"`
  4883. // NullFields is a list of field names (e.g. "FilteredEventIds") to
  4884. // include in API requests with the JSON null value. By default, fields
  4885. // with empty values are omitted from API requests. However, any field
  4886. // with an empty value appearing in NullFields will be sent to the
  4887. // server as null. It is an error if a field in this list has a
  4888. // non-empty value. This may be used to include null fields in Patch
  4889. // requests.
  4890. NullFields []string `json:"-"`
  4891. }
  4892. func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) {
  4893. type NoMethod CustomRichMediaEvents
  4894. raw := NoMethod(*s)
  4895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4896. }
  4897. // DateRange: Represents a date range.
  4898. type DateRange struct {
  4899. // EndDate: The end date of the date range, inclusive. A string of the
  4900. // format: "yyyy-MM-dd".
  4901. EndDate string `json:"endDate,omitempty"`
  4902. // Kind: The kind of resource this is, in this case
  4903. // dfareporting#dateRange.
  4904. Kind string `json:"kind,omitempty"`
  4905. // RelativeDateRange: The date range relative to the date of when the
  4906. // report is run.
  4907. //
  4908. // Possible values:
  4909. // "LAST_24_MONTHS"
  4910. // "LAST_30_DAYS"
  4911. // "LAST_365_DAYS"
  4912. // "LAST_7_DAYS"
  4913. // "LAST_90_DAYS"
  4914. // "MONTH_TO_DATE"
  4915. // "PREVIOUS_MONTH"
  4916. // "PREVIOUS_QUARTER"
  4917. // "PREVIOUS_WEEK"
  4918. // "PREVIOUS_YEAR"
  4919. // "QUARTER_TO_DATE"
  4920. // "TODAY"
  4921. // "WEEK_TO_DATE"
  4922. // "YEAR_TO_DATE"
  4923. // "YESTERDAY"
  4924. RelativeDateRange string `json:"relativeDateRange,omitempty"`
  4925. // StartDate: The start date of the date range, inclusive. A string of
  4926. // the format: "yyyy-MM-dd".
  4927. StartDate string `json:"startDate,omitempty"`
  4928. // ForceSendFields is a list of field names (e.g. "EndDate") to
  4929. // unconditionally include in API requests. By default, fields with
  4930. // empty values are omitted from API requests. However, any non-pointer,
  4931. // non-interface field appearing in ForceSendFields will be sent to the
  4932. // server regardless of whether the field is empty or not. This may be
  4933. // used to include empty fields in Patch requests.
  4934. ForceSendFields []string `json:"-"`
  4935. // NullFields is a list of field names (e.g. "EndDate") to include in
  4936. // API requests with the JSON null value. By default, fields with empty
  4937. // values are omitted from API requests. However, any field with an
  4938. // empty value appearing in NullFields will be sent to the server as
  4939. // null. It is an error if a field in this list has a non-empty value.
  4940. // This may be used to include null fields in Patch requests.
  4941. NullFields []string `json:"-"`
  4942. }
  4943. func (s *DateRange) MarshalJSON() ([]byte, error) {
  4944. type NoMethod DateRange
  4945. raw := NoMethod(*s)
  4946. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4947. }
  4948. // DayPartTargeting: Day Part Targeting.
  4949. type DayPartTargeting struct {
  4950. // DaysOfWeek: Days of the week when the ad will serve.
  4951. //
  4952. // Acceptable values are:
  4953. // - "SUNDAY"
  4954. // - "MONDAY"
  4955. // - "TUESDAY"
  4956. // - "WEDNESDAY"
  4957. // - "THURSDAY"
  4958. // - "FRIDAY"
  4959. // - "SATURDAY"
  4960. //
  4961. // Possible values:
  4962. // "FRIDAY"
  4963. // "MONDAY"
  4964. // "SATURDAY"
  4965. // "SUNDAY"
  4966. // "THURSDAY"
  4967. // "TUESDAY"
  4968. // "WEDNESDAY"
  4969. DaysOfWeek []string `json:"daysOfWeek,omitempty"`
  4970. // HoursOfDay: Hours of the day when the ad will serve, where 0 is
  4971. // midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with
  4972. // days of week, in which case the ad would serve during these hours on
  4973. // the specified days. For example if Monday, Wednesday, Friday are the
  4974. // days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is
  4975. // specified, the ad would serve Monday, Wednesdays, and Fridays at
  4976. // 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive.
  4977. HoursOfDay []int64 `json:"hoursOfDay,omitempty"`
  4978. // UserLocalTime: Whether or not to use the user's local time. If false,
  4979. // the America/New York time zone applies.
  4980. UserLocalTime bool `json:"userLocalTime,omitempty"`
  4981. // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to
  4982. // unconditionally include in API requests. By default, fields with
  4983. // empty values are omitted from API requests. However, any non-pointer,
  4984. // non-interface field appearing in ForceSendFields will be sent to the
  4985. // server regardless of whether the field is empty or not. This may be
  4986. // used to include empty fields in Patch requests.
  4987. ForceSendFields []string `json:"-"`
  4988. // NullFields is a list of field names (e.g. "DaysOfWeek") to include in
  4989. // API requests with the JSON null value. By default, fields with empty
  4990. // values are omitted from API requests. However, any field with an
  4991. // empty value appearing in NullFields will be sent to the server as
  4992. // null. It is an error if a field in this list has a non-empty value.
  4993. // This may be used to include null fields in Patch requests.
  4994. NullFields []string `json:"-"`
  4995. }
  4996. func (s *DayPartTargeting) MarshalJSON() ([]byte, error) {
  4997. type NoMethod DayPartTargeting
  4998. raw := NoMethod(*s)
  4999. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5000. }
  5001. // DefaultClickThroughEventTagProperties: Properties of inheriting and
  5002. // overriding the default click-through event tag. A campaign may
  5003. // override the event tag defined at the advertiser level, and an ad may
  5004. // also override the campaign's setting further.
  5005. type DefaultClickThroughEventTagProperties struct {
  5006. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  5007. // apply to all ads in this entity's scope.
  5008. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  5009. // OverrideInheritedEventTag: Whether this entity should override the
  5010. // inherited default click-through event tag with its own defined value.
  5011. OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"`
  5012. // ForceSendFields is a list of field names (e.g.
  5013. // "DefaultClickThroughEventTagId") to unconditionally include in API
  5014. // requests. By default, fields with empty values are omitted from API
  5015. // requests. However, any non-pointer, non-interface field appearing in
  5016. // ForceSendFields will be sent to the server regardless of whether the
  5017. // field is empty or not. This may be used to include empty fields in
  5018. // Patch requests.
  5019. ForceSendFields []string `json:"-"`
  5020. // NullFields is a list of field names (e.g.
  5021. // "DefaultClickThroughEventTagId") to include in API requests with the
  5022. // JSON null value. By default, fields with empty values are omitted
  5023. // from API requests. However, any field with an empty value appearing
  5024. // in NullFields will be sent to the server as null. It is an error if a
  5025. // field in this list has a non-empty value. This may be used to include
  5026. // null fields in Patch requests.
  5027. NullFields []string `json:"-"`
  5028. }
  5029. func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) {
  5030. type NoMethod DefaultClickThroughEventTagProperties
  5031. raw := NoMethod(*s)
  5032. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5033. }
  5034. // DeliverySchedule: Delivery Schedule.
  5035. type DeliverySchedule struct {
  5036. // FrequencyCap: Limit on the number of times an individual user can be
  5037. // served the ad within a specified period of time.
  5038. FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"`
  5039. // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad
  5040. // will not serve after the end date and time. Otherwise the ad will
  5041. // continue to be served until it has reached its delivery goals.
  5042. HardCutoff bool `json:"hardCutoff,omitempty"`
  5043. // ImpressionRatio: Impression ratio for this ad. This ratio determines
  5044. // how often each ad is served relative to the others. For example, if
  5045. // ad A has an impression ratio of 1 and ad B has an impression ratio of
  5046. // 3, then DCM will serve ad B three times as often as ad A. Acceptable
  5047. // values are 1 to 10, inclusive.
  5048. ImpressionRatio int64 `json:"impressionRatio,omitempty,string"`
  5049. // Priority: Serving priority of an ad, with respect to other ads. The
  5050. // lower the priority number, the greater the priority with which it is
  5051. // served.
  5052. //
  5053. // Possible values:
  5054. // "AD_PRIORITY_01"
  5055. // "AD_PRIORITY_02"
  5056. // "AD_PRIORITY_03"
  5057. // "AD_PRIORITY_04"
  5058. // "AD_PRIORITY_05"
  5059. // "AD_PRIORITY_06"
  5060. // "AD_PRIORITY_07"
  5061. // "AD_PRIORITY_08"
  5062. // "AD_PRIORITY_09"
  5063. // "AD_PRIORITY_10"
  5064. // "AD_PRIORITY_11"
  5065. // "AD_PRIORITY_12"
  5066. // "AD_PRIORITY_13"
  5067. // "AD_PRIORITY_14"
  5068. // "AD_PRIORITY_15"
  5069. // "AD_PRIORITY_16"
  5070. Priority string `json:"priority,omitempty"`
  5071. // ForceSendFields is a list of field names (e.g. "FrequencyCap") to
  5072. // unconditionally include in API requests. By default, fields with
  5073. // empty values are omitted from API requests. However, any non-pointer,
  5074. // non-interface field appearing in ForceSendFields will be sent to the
  5075. // server regardless of whether the field is empty or not. This may be
  5076. // used to include empty fields in Patch requests.
  5077. ForceSendFields []string `json:"-"`
  5078. // NullFields is a list of field names (e.g. "FrequencyCap") to include
  5079. // in API requests with the JSON null value. By default, fields with
  5080. // empty values are omitted from API requests. However, any field with
  5081. // an empty value appearing in NullFields will be sent to the server as
  5082. // null. It is an error if a field in this list has a non-empty value.
  5083. // This may be used to include null fields in Patch requests.
  5084. NullFields []string `json:"-"`
  5085. }
  5086. func (s *DeliverySchedule) MarshalJSON() ([]byte, error) {
  5087. type NoMethod DeliverySchedule
  5088. raw := NoMethod(*s)
  5089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5090. }
  5091. // DfpSettings: DFP Settings
  5092. type DfpSettings struct {
  5093. // DfpNetworkCode: DFP network code for this directory site.
  5094. DfpNetworkCode string `json:"dfpNetworkCode,omitempty"`
  5095. // DfpNetworkName: DFP network name for this directory site.
  5096. DfpNetworkName string `json:"dfpNetworkName,omitempty"`
  5097. // ProgrammaticPlacementAccepted: Whether this directory site accepts
  5098. // programmatic placements.
  5099. ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"`
  5100. // PubPaidPlacementAccepted: Whether this directory site accepts
  5101. // publisher-paid tags.
  5102. PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"`
  5103. // PublisherPortalOnly: Whether this directory site is available only
  5104. // via DoubleClick Publisher Portal.
  5105. PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"`
  5106. // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to
  5107. // unconditionally include in API requests. By default, fields with
  5108. // empty values are omitted from API requests. However, any non-pointer,
  5109. // non-interface field appearing in ForceSendFields will be sent to the
  5110. // server regardless of whether the field is empty or not. This may be
  5111. // used to include empty fields in Patch requests.
  5112. ForceSendFields []string `json:"-"`
  5113. // NullFields is a list of field names (e.g. "DfpNetworkCode") to
  5114. // include in API requests with the JSON null value. By default, fields
  5115. // with empty values are omitted from API requests. However, any field
  5116. // with an empty value appearing in NullFields will be sent to the
  5117. // server as null. It is an error if a field in this list has a
  5118. // non-empty value. This may be used to include null fields in Patch
  5119. // requests.
  5120. NullFields []string `json:"-"`
  5121. }
  5122. func (s *DfpSettings) MarshalJSON() ([]byte, error) {
  5123. type NoMethod DfpSettings
  5124. raw := NoMethod(*s)
  5125. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5126. }
  5127. // Dimension: Represents a dimension.
  5128. type Dimension struct {
  5129. // Kind: The kind of resource this is, in this case
  5130. // dfareporting#dimension.
  5131. Kind string `json:"kind,omitempty"`
  5132. // Name: The dimension name, e.g. dfa:advertiser
  5133. Name string `json:"name,omitempty"`
  5134. // ForceSendFields is a list of field names (e.g. "Kind") to
  5135. // unconditionally include in API requests. By default, fields with
  5136. // empty values are omitted from API requests. However, any non-pointer,
  5137. // non-interface field appearing in ForceSendFields will be sent to the
  5138. // server regardless of whether the field is empty or not. This may be
  5139. // used to include empty fields in Patch requests.
  5140. ForceSendFields []string `json:"-"`
  5141. // NullFields is a list of field names (e.g. "Kind") to include in API
  5142. // requests with the JSON null value. By default, fields with empty
  5143. // values are omitted from API requests. However, any field with an
  5144. // empty value appearing in NullFields will be sent to the server as
  5145. // null. It is an error if a field in this list has a non-empty value.
  5146. // This may be used to include null fields in Patch requests.
  5147. NullFields []string `json:"-"`
  5148. }
  5149. func (s *Dimension) MarshalJSON() ([]byte, error) {
  5150. type NoMethod Dimension
  5151. raw := NoMethod(*s)
  5152. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5153. }
  5154. // DimensionFilter: Represents a dimension filter.
  5155. type DimensionFilter struct {
  5156. // DimensionName: The name of the dimension to filter.
  5157. DimensionName string `json:"dimensionName,omitempty"`
  5158. // Kind: The kind of resource this is, in this case
  5159. // dfareporting#dimensionFilter.
  5160. Kind string `json:"kind,omitempty"`
  5161. // Value: The value of the dimension to filter.
  5162. Value string `json:"value,omitempty"`
  5163. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5164. // unconditionally include in API requests. By default, fields with
  5165. // empty values are omitted from API requests. However, any non-pointer,
  5166. // non-interface field appearing in ForceSendFields will be sent to the
  5167. // server regardless of whether the field is empty or not. This may be
  5168. // used to include empty fields in Patch requests.
  5169. ForceSendFields []string `json:"-"`
  5170. // NullFields is a list of field names (e.g. "DimensionName") to include
  5171. // in API requests with the JSON null value. By default, fields with
  5172. // empty values are omitted from API requests. However, any field with
  5173. // an empty value appearing in NullFields will be sent to the server as
  5174. // null. It is an error if a field in this list has a non-empty value.
  5175. // This may be used to include null fields in Patch requests.
  5176. NullFields []string `json:"-"`
  5177. }
  5178. func (s *DimensionFilter) MarshalJSON() ([]byte, error) {
  5179. type NoMethod DimensionFilter
  5180. raw := NoMethod(*s)
  5181. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5182. }
  5183. // DimensionValue: Represents a DimensionValue resource.
  5184. type DimensionValue struct {
  5185. // DimensionName: The name of the dimension.
  5186. DimensionName string `json:"dimensionName,omitempty"`
  5187. // Etag: The eTag of this response for caching purposes.
  5188. Etag string `json:"etag,omitempty"`
  5189. // Id: The ID associated with the value if available.
  5190. Id string `json:"id,omitempty"`
  5191. // Kind: The kind of resource this is, in this case
  5192. // dfareporting#dimensionValue.
  5193. Kind string `json:"kind,omitempty"`
  5194. // MatchType: Determines how the 'value' field is matched when
  5195. // filtering. If not specified, defaults to EXACT. If set to
  5196. // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable
  5197. // length character sequences, and it can be escaped with a backslash.
  5198. // Note, only paid search dimensions ('dfa:paidSearch*') allow a
  5199. // matchType other than EXACT.
  5200. //
  5201. // Possible values:
  5202. // "BEGINS_WITH"
  5203. // "CONTAINS"
  5204. // "EXACT"
  5205. // "WILDCARD_EXPRESSION"
  5206. MatchType string `json:"matchType,omitempty"`
  5207. // Value: The value of the dimension.
  5208. Value string `json:"value,omitempty"`
  5209. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5210. // unconditionally include in API requests. By default, fields with
  5211. // empty values are omitted from API requests. However, any non-pointer,
  5212. // non-interface field appearing in ForceSendFields will be sent to the
  5213. // server regardless of whether the field is empty or not. This may be
  5214. // used to include empty fields in Patch requests.
  5215. ForceSendFields []string `json:"-"`
  5216. // NullFields is a list of field names (e.g. "DimensionName") to include
  5217. // in API requests with the JSON null value. By default, fields with
  5218. // empty values are omitted from API requests. However, any field with
  5219. // an empty value appearing in NullFields will be sent to the server as
  5220. // null. It is an error if a field in this list has a non-empty value.
  5221. // This may be used to include null fields in Patch requests.
  5222. NullFields []string `json:"-"`
  5223. }
  5224. func (s *DimensionValue) MarshalJSON() ([]byte, error) {
  5225. type NoMethod DimensionValue
  5226. raw := NoMethod(*s)
  5227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5228. }
  5229. // DimensionValueList: Represents the list of DimensionValue resources.
  5230. type DimensionValueList struct {
  5231. // Etag: The eTag of this response for caching purposes.
  5232. Etag string `json:"etag,omitempty"`
  5233. // Items: The dimension values returned in this response.
  5234. Items []*DimensionValue `json:"items,omitempty"`
  5235. // Kind: The kind of list this is, in this case
  5236. // dfareporting#dimensionValueList.
  5237. Kind string `json:"kind,omitempty"`
  5238. // NextPageToken: Continuation token used to page through dimension
  5239. // values. To retrieve the next page of results, set the next request's
  5240. // "pageToken" to the value of this field. The page token is only valid
  5241. // for a limited amount of time and should not be persisted.
  5242. NextPageToken string `json:"nextPageToken,omitempty"`
  5243. // ServerResponse contains the HTTP response code and headers from the
  5244. // server.
  5245. googleapi.ServerResponse `json:"-"`
  5246. // ForceSendFields is a list of field names (e.g. "Etag") to
  5247. // unconditionally include in API requests. By default, fields with
  5248. // empty values are omitted from API requests. However, any non-pointer,
  5249. // non-interface field appearing in ForceSendFields will be sent to the
  5250. // server regardless of whether the field is empty or not. This may be
  5251. // used to include empty fields in Patch requests.
  5252. ForceSendFields []string `json:"-"`
  5253. // NullFields is a list of field names (e.g. "Etag") to include in API
  5254. // requests with the JSON null value. By default, fields with empty
  5255. // values are omitted from API requests. However, any field with an
  5256. // empty value appearing in NullFields will be sent to the server as
  5257. // null. It is an error if a field in this list has a non-empty value.
  5258. // This may be used to include null fields in Patch requests.
  5259. NullFields []string `json:"-"`
  5260. }
  5261. func (s *DimensionValueList) MarshalJSON() ([]byte, error) {
  5262. type NoMethod DimensionValueList
  5263. raw := NoMethod(*s)
  5264. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5265. }
  5266. // DimensionValueRequest: Represents a DimensionValuesRequest.
  5267. type DimensionValueRequest struct {
  5268. // DimensionName: The name of the dimension for which values should be
  5269. // requested.
  5270. DimensionName string `json:"dimensionName,omitempty"`
  5271. // EndDate: The end date of the date range for which to retrieve
  5272. // dimension values. A string of the format "yyyy-MM-dd".
  5273. EndDate string `json:"endDate,omitempty"`
  5274. // Filters: The list of filters by which to filter values. The filters
  5275. // are ANDed.
  5276. Filters []*DimensionFilter `json:"filters,omitempty"`
  5277. // Kind: The kind of request this is, in this case
  5278. // dfareporting#dimensionValueRequest.
  5279. Kind string `json:"kind,omitempty"`
  5280. // StartDate: The start date of the date range for which to retrieve
  5281. // dimension values. A string of the format "yyyy-MM-dd".
  5282. StartDate string `json:"startDate,omitempty"`
  5283. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5284. // unconditionally include in API requests. By default, fields with
  5285. // empty values are omitted from API requests. However, any non-pointer,
  5286. // non-interface field appearing in ForceSendFields will be sent to the
  5287. // server regardless of whether the field is empty or not. This may be
  5288. // used to include empty fields in Patch requests.
  5289. ForceSendFields []string `json:"-"`
  5290. // NullFields is a list of field names (e.g. "DimensionName") to include
  5291. // in API requests with the JSON null value. By default, fields with
  5292. // empty values are omitted from API requests. However, any field with
  5293. // an empty value appearing in NullFields will be sent to the server as
  5294. // null. It is an error if a field in this list has a non-empty value.
  5295. // This may be used to include null fields in Patch requests.
  5296. NullFields []string `json:"-"`
  5297. }
  5298. func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) {
  5299. type NoMethod DimensionValueRequest
  5300. raw := NoMethod(*s)
  5301. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5302. }
  5303. // DirectorySite: DirectorySites contains properties of a website from
  5304. // the Site Directory. Sites need to be added to an account via the
  5305. // Sites resource before they can be assigned to a placement.
  5306. type DirectorySite struct {
  5307. // Active: Whether this directory site is active.
  5308. Active bool `json:"active,omitempty"`
  5309. // ContactAssignments: Directory site contacts.
  5310. ContactAssignments []*DirectorySiteContactAssignment `json:"contactAssignments,omitempty"`
  5311. // CountryId: Country ID of this directory site. This is a read-only
  5312. // field.
  5313. CountryId int64 `json:"countryId,omitempty,string"`
  5314. // CurrencyId: Currency ID of this directory site. This is a read-only
  5315. // field.
  5316. // Possible values are:
  5317. // - "1" for USD
  5318. // - "2" for GBP
  5319. // - "3" for ESP
  5320. // - "4" for SEK
  5321. // - "5" for CAD
  5322. // - "6" for JPY
  5323. // - "7" for DEM
  5324. // - "8" for AUD
  5325. // - "9" for FRF
  5326. // - "10" for ITL
  5327. // - "11" for DKK
  5328. // - "12" for NOK
  5329. // - "13" for FIM
  5330. // - "14" for ZAR
  5331. // - "15" for IEP
  5332. // - "16" for NLG
  5333. // - "17" for EUR
  5334. // - "18" for KRW
  5335. // - "19" for TWD
  5336. // - "20" for SGD
  5337. // - "21" for CNY
  5338. // - "22" for HKD
  5339. // - "23" for NZD
  5340. // - "24" for MYR
  5341. // - "25" for BRL
  5342. // - "26" for PTE
  5343. // - "27" for MXP
  5344. // - "28" for CLP
  5345. // - "29" for TRY
  5346. // - "30" for ARS
  5347. // - "31" for PEN
  5348. // - "32" for ILS
  5349. // - "33" for CHF
  5350. // - "34" for VEF
  5351. // - "35" for COP
  5352. // - "36" for GTQ
  5353. // - "37" for PLN
  5354. // - "39" for INR
  5355. // - "40" for THB
  5356. // - "41" for IDR
  5357. // - "42" for CZK
  5358. // - "43" for RON
  5359. // - "44" for HUF
  5360. // - "45" for RUB
  5361. // - "46" for AED
  5362. // - "47" for BGN
  5363. // - "48" for HRK
  5364. // - "49" for MXN
  5365. // - "50" for NGN
  5366. CurrencyId int64 `json:"currencyId,omitempty,string"`
  5367. // Description: Description of this directory site. This is a read-only
  5368. // field.
  5369. Description string `json:"description,omitempty"`
  5370. // Id: ID of this directory site. This is a read-only, auto-generated
  5371. // field.
  5372. Id int64 `json:"id,omitempty,string"`
  5373. // IdDimensionValue: Dimension value for the ID of this directory site.
  5374. // This is a read-only, auto-generated field.
  5375. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  5376. // InpageTagFormats: Tag types for regular placements.
  5377. //
  5378. // Acceptable values are:
  5379. // - "STANDARD"
  5380. // - "IFRAME_JAVASCRIPT_INPAGE"
  5381. // - "INTERNAL_REDIRECT_INPAGE"
  5382. // - "JAVASCRIPT_INPAGE"
  5383. //
  5384. // Possible values:
  5385. // "IFRAME_JAVASCRIPT_INPAGE"
  5386. // "INTERNAL_REDIRECT_INPAGE"
  5387. // "JAVASCRIPT_INPAGE"
  5388. // "STANDARD"
  5389. InpageTagFormats []string `json:"inpageTagFormats,omitempty"`
  5390. // InterstitialTagFormats: Tag types for interstitial
  5391. // placements.
  5392. //
  5393. // Acceptable values are:
  5394. // - "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5395. // - "INTERNAL_REDIRECT_INTERSTITIAL"
  5396. // - "JAVASCRIPT_INTERSTITIAL"
  5397. //
  5398. // Possible values:
  5399. // "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5400. // "INTERNAL_REDIRECT_INTERSTITIAL"
  5401. // "JAVASCRIPT_INTERSTITIAL"
  5402. InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"`
  5403. // Kind: Identifies what kind of resource this is. Value: the fixed
  5404. // string "dfareporting#directorySite".
  5405. Kind string `json:"kind,omitempty"`
  5406. // Name: Name of this directory site.
  5407. Name string `json:"name,omitempty"`
  5408. // ParentId: Parent directory site ID.
  5409. ParentId int64 `json:"parentId,omitempty,string"`
  5410. // Settings: Directory site settings.
  5411. Settings *DirectorySiteSettings `json:"settings,omitempty"`
  5412. // Url: URL of this directory site.
  5413. Url string `json:"url,omitempty"`
  5414. // ServerResponse contains the HTTP response code and headers from the
  5415. // server.
  5416. googleapi.ServerResponse `json:"-"`
  5417. // ForceSendFields is a list of field names (e.g. "Active") to
  5418. // unconditionally include in API requests. By default, fields with
  5419. // empty values are omitted from API requests. However, any non-pointer,
  5420. // non-interface field appearing in ForceSendFields will be sent to the
  5421. // server regardless of whether the field is empty or not. This may be
  5422. // used to include empty fields in Patch requests.
  5423. ForceSendFields []string `json:"-"`
  5424. // NullFields is a list of field names (e.g. "Active") to include in API
  5425. // requests with the JSON null value. By default, fields with empty
  5426. // values are omitted from API requests. However, any field with an
  5427. // empty value appearing in NullFields will be sent to the server as
  5428. // null. It is an error if a field in this list has a non-empty value.
  5429. // This may be used to include null fields in Patch requests.
  5430. NullFields []string `json:"-"`
  5431. }
  5432. func (s *DirectorySite) MarshalJSON() ([]byte, error) {
  5433. type NoMethod DirectorySite
  5434. raw := NoMethod(*s)
  5435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5436. }
  5437. // DirectorySiteContact: Contains properties of a Site Directory
  5438. // contact.
  5439. type DirectorySiteContact struct {
  5440. // Address: Address of this directory site contact.
  5441. Address string `json:"address,omitempty"`
  5442. // Email: Email address of this directory site contact.
  5443. Email string `json:"email,omitempty"`
  5444. // FirstName: First name of this directory site contact.
  5445. FirstName string `json:"firstName,omitempty"`
  5446. // Id: ID of this directory site contact. This is a read-only,
  5447. // auto-generated field.
  5448. Id int64 `json:"id,omitempty,string"`
  5449. // Kind: Identifies what kind of resource this is. Value: the fixed
  5450. // string "dfareporting#directorySiteContact".
  5451. Kind string `json:"kind,omitempty"`
  5452. // LastName: Last name of this directory site contact.
  5453. LastName string `json:"lastName,omitempty"`
  5454. // Phone: Phone number of this directory site contact.
  5455. Phone string `json:"phone,omitempty"`
  5456. // Role: Directory site contact role.
  5457. //
  5458. // Possible values:
  5459. // "ADMIN"
  5460. // "EDIT"
  5461. // "VIEW"
  5462. Role string `json:"role,omitempty"`
  5463. // Title: Title or designation of this directory site contact.
  5464. Title string `json:"title,omitempty"`
  5465. // Type: Directory site contact type.
  5466. //
  5467. // Possible values:
  5468. // "BILLING"
  5469. // "OTHER"
  5470. // "SALES"
  5471. // "TECHNICAL"
  5472. Type string `json:"type,omitempty"`
  5473. // ServerResponse contains the HTTP response code and headers from the
  5474. // server.
  5475. googleapi.ServerResponse `json:"-"`
  5476. // ForceSendFields is a list of field names (e.g. "Address") to
  5477. // unconditionally include in API requests. By default, fields with
  5478. // empty values are omitted from API requests. However, any non-pointer,
  5479. // non-interface field appearing in ForceSendFields will be sent to the
  5480. // server regardless of whether the field is empty or not. This may be
  5481. // used to include empty fields in Patch requests.
  5482. ForceSendFields []string `json:"-"`
  5483. // NullFields is a list of field names (e.g. "Address") to include in
  5484. // API requests with the JSON null value. By default, fields with empty
  5485. // values are omitted from API requests. However, any field with an
  5486. // empty value appearing in NullFields will be sent to the server as
  5487. // null. It is an error if a field in this list has a non-empty value.
  5488. // This may be used to include null fields in Patch requests.
  5489. NullFields []string `json:"-"`
  5490. }
  5491. func (s *DirectorySiteContact) MarshalJSON() ([]byte, error) {
  5492. type NoMethod DirectorySiteContact
  5493. raw := NoMethod(*s)
  5494. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5495. }
  5496. // DirectorySiteContactAssignment: Directory Site Contact Assignment
  5497. type DirectorySiteContactAssignment struct {
  5498. // ContactId: ID of this directory site contact. This is a read-only,
  5499. // auto-generated field.
  5500. ContactId int64 `json:"contactId,omitempty,string"`
  5501. // Visibility: Visibility of this directory site contact assignment.
  5502. // When set to PUBLIC this contact assignment is visible to all account
  5503. // and agency users; when set to PRIVATE it is visible only to the site.
  5504. //
  5505. // Possible values:
  5506. // "PRIVATE"
  5507. // "PUBLIC"
  5508. Visibility string `json:"visibility,omitempty"`
  5509. // ForceSendFields is a list of field names (e.g. "ContactId") to
  5510. // unconditionally include in API requests. By default, fields with
  5511. // empty values are omitted from API requests. However, any non-pointer,
  5512. // non-interface field appearing in ForceSendFields will be sent to the
  5513. // server regardless of whether the field is empty or not. This may be
  5514. // used to include empty fields in Patch requests.
  5515. ForceSendFields []string `json:"-"`
  5516. // NullFields is a list of field names (e.g. "ContactId") to include in
  5517. // API requests with the JSON null value. By default, fields with empty
  5518. // values are omitted from API requests. However, any field with an
  5519. // empty value appearing in NullFields will be sent to the server as
  5520. // null. It is an error if a field in this list has a non-empty value.
  5521. // This may be used to include null fields in Patch requests.
  5522. NullFields []string `json:"-"`
  5523. }
  5524. func (s *DirectorySiteContactAssignment) MarshalJSON() ([]byte, error) {
  5525. type NoMethod DirectorySiteContactAssignment
  5526. raw := NoMethod(*s)
  5527. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5528. }
  5529. // DirectorySiteContactsListResponse: Directory Site Contact List
  5530. // Response
  5531. type DirectorySiteContactsListResponse struct {
  5532. // DirectorySiteContacts: Directory site contact collection
  5533. DirectorySiteContacts []*DirectorySiteContact `json:"directorySiteContacts,omitempty"`
  5534. // Kind: Identifies what kind of resource this is. Value: the fixed
  5535. // string "dfareporting#directorySiteContactsListResponse".
  5536. Kind string `json:"kind,omitempty"`
  5537. // NextPageToken: Pagination token to be used for the next list
  5538. // operation.
  5539. NextPageToken string `json:"nextPageToken,omitempty"`
  5540. // ServerResponse contains the HTTP response code and headers from the
  5541. // server.
  5542. googleapi.ServerResponse `json:"-"`
  5543. // ForceSendFields is a list of field names (e.g.
  5544. // "DirectorySiteContacts") to unconditionally include in API requests.
  5545. // By default, fields with empty values are omitted from API requests.
  5546. // However, any non-pointer, non-interface field appearing in
  5547. // ForceSendFields will be sent to the server regardless of whether the
  5548. // field is empty or not. This may be used to include empty fields in
  5549. // Patch requests.
  5550. ForceSendFields []string `json:"-"`
  5551. // NullFields is a list of field names (e.g. "DirectorySiteContacts") to
  5552. // include in API requests with the JSON null value. By default, fields
  5553. // with empty values are omitted from API requests. However, any field
  5554. // with an empty value appearing in NullFields will be sent to the
  5555. // server as null. It is an error if a field in this list has a
  5556. // non-empty value. This may be used to include null fields in Patch
  5557. // requests.
  5558. NullFields []string `json:"-"`
  5559. }
  5560. func (s *DirectorySiteContactsListResponse) MarshalJSON() ([]byte, error) {
  5561. type NoMethod DirectorySiteContactsListResponse
  5562. raw := NoMethod(*s)
  5563. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5564. }
  5565. // DirectorySiteSettings: Directory Site Settings
  5566. type DirectorySiteSettings struct {
  5567. // ActiveViewOptOut: Whether this directory site has disabled active
  5568. // view creatives.
  5569. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  5570. // DfpSettings: Directory site DFP settings.
  5571. DfpSettings *DfpSettings `json:"dfpSettings,omitempty"`
  5572. // InstreamVideoPlacementAccepted: Whether this site accepts in-stream
  5573. // video ads.
  5574. InstreamVideoPlacementAccepted bool `json:"instreamVideoPlacementAccepted,omitempty"`
  5575. // InterstitialPlacementAccepted: Whether this site accepts interstitial
  5576. // ads.
  5577. InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"`
  5578. // NielsenOcrOptOut: Whether this directory site has disabled Nielsen
  5579. // OCR reach ratings.
  5580. NielsenOcrOptOut bool `json:"nielsenOcrOptOut,omitempty"`
  5581. // VerificationTagOptOut: Whether this directory site has disabled
  5582. // generation of Verification ins tags.
  5583. VerificationTagOptOut bool `json:"verificationTagOptOut,omitempty"`
  5584. // VideoActiveViewOptOut: Whether this directory site has disabled
  5585. // active view for in-stream video creatives. This is a read-only field.
  5586. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  5587. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  5588. // unconditionally include in API requests. By default, fields with
  5589. // empty values are omitted from API requests. However, any non-pointer,
  5590. // non-interface field appearing in ForceSendFields will be sent to the
  5591. // server regardless of whether the field is empty or not. This may be
  5592. // used to include empty fields in Patch requests.
  5593. ForceSendFields []string `json:"-"`
  5594. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  5595. // include in API requests with the JSON null value. By default, fields
  5596. // with empty values are omitted from API requests. However, any field
  5597. // with an empty value appearing in NullFields will be sent to the
  5598. // server as null. It is an error if a field in this list has a
  5599. // non-empty value. This may be used to include null fields in Patch
  5600. // requests.
  5601. NullFields []string `json:"-"`
  5602. }
  5603. func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) {
  5604. type NoMethod DirectorySiteSettings
  5605. raw := NoMethod(*s)
  5606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5607. }
  5608. // DirectorySitesListResponse: Directory Site List Response
  5609. type DirectorySitesListResponse struct {
  5610. // DirectorySites: Directory site collection.
  5611. DirectorySites []*DirectorySite `json:"directorySites,omitempty"`
  5612. // Kind: Identifies what kind of resource this is. Value: the fixed
  5613. // string "dfareporting#directorySitesListResponse".
  5614. Kind string `json:"kind,omitempty"`
  5615. // NextPageToken: Pagination token to be used for the next list
  5616. // operation.
  5617. NextPageToken string `json:"nextPageToken,omitempty"`
  5618. // ServerResponse contains the HTTP response code and headers from the
  5619. // server.
  5620. googleapi.ServerResponse `json:"-"`
  5621. // ForceSendFields is a list of field names (e.g. "DirectorySites") to
  5622. // unconditionally include in API requests. By default, fields with
  5623. // empty values are omitted from API requests. However, any non-pointer,
  5624. // non-interface field appearing in ForceSendFields will be sent to the
  5625. // server regardless of whether the field is empty or not. This may be
  5626. // used to include empty fields in Patch requests.
  5627. ForceSendFields []string `json:"-"`
  5628. // NullFields is a list of field names (e.g. "DirectorySites") to
  5629. // include in API requests with the JSON null value. By default, fields
  5630. // with empty values are omitted from API requests. However, any field
  5631. // with an empty value appearing in NullFields will be sent to the
  5632. // server as null. It is an error if a field in this list has a
  5633. // non-empty value. This may be used to include null fields in Patch
  5634. // requests.
  5635. NullFields []string `json:"-"`
  5636. }
  5637. func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) {
  5638. type NoMethod DirectorySitesListResponse
  5639. raw := NoMethod(*s)
  5640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5641. }
  5642. // DynamicTargetingKey: Contains properties of a dynamic targeting key.
  5643. // Dynamic targeting keys are unique, user-friendly labels, created at
  5644. // the advertiser level in DCM, that can be assigned to ads, creatives,
  5645. // and placements and used for targeting with DoubleClick Studio dynamic
  5646. // creatives. Use these labels instead of numeric DCM IDs (such as
  5647. // placement IDs) to save time and avoid errors in your dynamic feeds.
  5648. type DynamicTargetingKey struct {
  5649. // Kind: Identifies what kind of resource this is. Value: the fixed
  5650. // string "dfareporting#dynamicTargetingKey".
  5651. Kind string `json:"kind,omitempty"`
  5652. // Name: Name of this dynamic targeting key. This is a required field.
  5653. // Must be less than 256 characters long and cannot contain commas. All
  5654. // characters are converted to lowercase.
  5655. Name string `json:"name,omitempty"`
  5656. // ObjectId: ID of the object of this dynamic targeting key. This is a
  5657. // required field.
  5658. ObjectId int64 `json:"objectId,omitempty,string"`
  5659. // ObjectType: Type of the object of this dynamic targeting key. This is
  5660. // a required field.
  5661. //
  5662. // Possible values:
  5663. // "OBJECT_AD"
  5664. // "OBJECT_ADVERTISER"
  5665. // "OBJECT_CREATIVE"
  5666. // "OBJECT_PLACEMENT"
  5667. ObjectType string `json:"objectType,omitempty"`
  5668. // ServerResponse contains the HTTP response code and headers from the
  5669. // server.
  5670. googleapi.ServerResponse `json:"-"`
  5671. // ForceSendFields is a list of field names (e.g. "Kind") to
  5672. // unconditionally include in API requests. By default, fields with
  5673. // empty values are omitted from API requests. However, any non-pointer,
  5674. // non-interface field appearing in ForceSendFields will be sent to the
  5675. // server regardless of whether the field is empty or not. This may be
  5676. // used to include empty fields in Patch requests.
  5677. ForceSendFields []string `json:"-"`
  5678. // NullFields is a list of field names (e.g. "Kind") to include in API
  5679. // requests with the JSON null value. By default, fields with empty
  5680. // values are omitted from API requests. However, any field with an
  5681. // empty value appearing in NullFields will be sent to the server as
  5682. // null. It is an error if a field in this list has a non-empty value.
  5683. // This may be used to include null fields in Patch requests.
  5684. NullFields []string `json:"-"`
  5685. }
  5686. func (s *DynamicTargetingKey) MarshalJSON() ([]byte, error) {
  5687. type NoMethod DynamicTargetingKey
  5688. raw := NoMethod(*s)
  5689. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5690. }
  5691. // DynamicTargetingKeysListResponse: Dynamic Targeting Key List Response
  5692. type DynamicTargetingKeysListResponse struct {
  5693. // DynamicTargetingKeys: Dynamic targeting key collection.
  5694. DynamicTargetingKeys []*DynamicTargetingKey `json:"dynamicTargetingKeys,omitempty"`
  5695. // Kind: Identifies what kind of resource this is. Value: the fixed
  5696. // string "dfareporting#dynamicTargetingKeysListResponse".
  5697. Kind string `json:"kind,omitempty"`
  5698. // ServerResponse contains the HTTP response code and headers from the
  5699. // server.
  5700. googleapi.ServerResponse `json:"-"`
  5701. // ForceSendFields is a list of field names (e.g.
  5702. // "DynamicTargetingKeys") to unconditionally include in API requests.
  5703. // By default, fields with empty values are omitted from API requests.
  5704. // However, any non-pointer, non-interface field appearing in
  5705. // ForceSendFields will be sent to the server regardless of whether the
  5706. // field is empty or not. This may be used to include empty fields in
  5707. // Patch requests.
  5708. ForceSendFields []string `json:"-"`
  5709. // NullFields is a list of field names (e.g. "DynamicTargetingKeys") to
  5710. // include in API requests with the JSON null value. By default, fields
  5711. // with empty values are omitted from API requests. However, any field
  5712. // with an empty value appearing in NullFields will be sent to the
  5713. // server as null. It is an error if a field in this list has a
  5714. // non-empty value. This may be used to include null fields in Patch
  5715. // requests.
  5716. NullFields []string `json:"-"`
  5717. }
  5718. func (s *DynamicTargetingKeysListResponse) MarshalJSON() ([]byte, error) {
  5719. type NoMethod DynamicTargetingKeysListResponse
  5720. raw := NoMethod(*s)
  5721. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5722. }
  5723. // EncryptionInfo: A description of how user IDs are encrypted.
  5724. type EncryptionInfo struct {
  5725. // EncryptionEntityId: The encryption entity ID. This should match the
  5726. // encryption configuration for ad serving or Data Transfer.
  5727. EncryptionEntityId int64 `json:"encryptionEntityId,omitempty,string"`
  5728. // EncryptionEntityType: The encryption entity type. This should match
  5729. // the encryption configuration for ad serving or Data Transfer.
  5730. //
  5731. // Possible values:
  5732. // "ADWORDS_CUSTOMER"
  5733. // "DBM_ADVERTISER"
  5734. // "DBM_PARTNER"
  5735. // "DCM_ACCOUNT"
  5736. // "DCM_ADVERTISER"
  5737. // "DFP_NETWORK_CODE"
  5738. // "ENCRYPTION_ENTITY_TYPE_UNKNOWN"
  5739. EncryptionEntityType string `json:"encryptionEntityType,omitempty"`
  5740. // EncryptionSource: Describes whether the encrypted cookie was received
  5741. // from ad serving (the %m macro) or from Data Transfer.
  5742. //
  5743. // Possible values:
  5744. // "AD_SERVING"
  5745. // "DATA_TRANSFER"
  5746. // "ENCRYPTION_SCOPE_UNKNOWN"
  5747. EncryptionSource string `json:"encryptionSource,omitempty"`
  5748. // Kind: Identifies what kind of resource this is. Value: the fixed
  5749. // string "dfareporting#encryptionInfo".
  5750. Kind string `json:"kind,omitempty"`
  5751. // ForceSendFields is a list of field names (e.g. "EncryptionEntityId")
  5752. // to unconditionally include in API requests. By default, fields with
  5753. // empty values are omitted from API requests. However, any non-pointer,
  5754. // non-interface field appearing in ForceSendFields will be sent to the
  5755. // server regardless of whether the field is empty or not. This may be
  5756. // used to include empty fields in Patch requests.
  5757. ForceSendFields []string `json:"-"`
  5758. // NullFields is a list of field names (e.g. "EncryptionEntityId") to
  5759. // include in API requests with the JSON null value. By default, fields
  5760. // with empty values are omitted from API requests. However, any field
  5761. // with an empty value appearing in NullFields will be sent to the
  5762. // server as null. It is an error if a field in this list has a
  5763. // non-empty value. This may be used to include null fields in Patch
  5764. // requests.
  5765. NullFields []string `json:"-"`
  5766. }
  5767. func (s *EncryptionInfo) MarshalJSON() ([]byte, error) {
  5768. type NoMethod EncryptionInfo
  5769. raw := NoMethod(*s)
  5770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5771. }
  5772. // EventTag: Contains properties of an event tag.
  5773. type EventTag struct {
  5774. // AccountId: Account ID of this event tag. This is a read-only field
  5775. // that can be left blank.
  5776. AccountId int64 `json:"accountId,omitempty,string"`
  5777. // AdvertiserId: Advertiser ID of this event tag. This field or the
  5778. // campaignId field is required on insertion.
  5779. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  5780. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  5781. // advertiser. This is a read-only, auto-generated field.
  5782. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  5783. // CampaignId: Campaign ID of this event tag. This field or the
  5784. // advertiserId field is required on insertion.
  5785. CampaignId int64 `json:"campaignId,omitempty,string"`
  5786. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  5787. // This is a read-only, auto-generated field.
  5788. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  5789. // EnabledByDefault: Whether this event tag should be automatically
  5790. // enabled for all of the advertiser's campaigns and ads.
  5791. EnabledByDefault bool `json:"enabledByDefault,omitempty"`
  5792. // ExcludeFromAdxRequests: Whether to remove this event tag from ads
  5793. // that are trafficked through DoubleClick Bid Manager to Ad Exchange.
  5794. // This may be useful if the event tag uses a pixel that is unapproved
  5795. // for Ad Exchange bids on one or more networks, such as the Google
  5796. // Display Network.
  5797. ExcludeFromAdxRequests bool `json:"excludeFromAdxRequests,omitempty"`
  5798. // Id: ID of this event tag. This is a read-only, auto-generated field.
  5799. Id int64 `json:"id,omitempty,string"`
  5800. // Kind: Identifies what kind of resource this is. Value: the fixed
  5801. // string "dfareporting#eventTag".
  5802. Kind string `json:"kind,omitempty"`
  5803. // Name: Name of this event tag. This is a required field and must be
  5804. // less than 256 characters long.
  5805. Name string `json:"name,omitempty"`
  5806. // SiteFilterType: Site filter type for this event tag. If no type is
  5807. // specified then the event tag will be applied to all sites.
  5808. //
  5809. // Possible values:
  5810. // "BLACKLIST"
  5811. // "WHITELIST"
  5812. SiteFilterType string `json:"siteFilterType,omitempty"`
  5813. // SiteIds: Filter list of site IDs associated with this event tag. The
  5814. // siteFilterType determines whether this is a whitelist or blacklist
  5815. // filter.
  5816. SiteIds googleapi.Int64s `json:"siteIds,omitempty"`
  5817. // SslCompliant: Whether this tag is SSL-compliant or not. This is a
  5818. // read-only field.
  5819. SslCompliant bool `json:"sslCompliant,omitempty"`
  5820. // Status: Status of this event tag. Must be ENABLED for this event tag
  5821. // to fire. This is a required field.
  5822. //
  5823. // Possible values:
  5824. // "DISABLED"
  5825. // "ENABLED"
  5826. Status string `json:"status,omitempty"`
  5827. // SubaccountId: Subaccount ID of this event tag. This is a read-only
  5828. // field that can be left blank.
  5829. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  5830. // Type: Event tag type. Can be used to specify whether to use a
  5831. // third-party pixel, a third-party JavaScript URL, or a third-party
  5832. // click-through URL for either impression or click tracking. This is a
  5833. // required field.
  5834. //
  5835. // Possible values:
  5836. // "CLICK_THROUGH_EVENT_TAG"
  5837. // "IMPRESSION_IMAGE_EVENT_TAG"
  5838. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  5839. Type string `json:"type,omitempty"`
  5840. // Url: Payload URL for this event tag. The URL on a click-through event
  5841. // tag should have a landing page URL appended to the end of it. This
  5842. // field is required on insertion.
  5843. Url string `json:"url,omitempty"`
  5844. // UrlEscapeLevels: Number of times the landing page URL should be
  5845. // URL-escaped before being appended to the click-through event tag URL.
  5846. // Only applies to click-through event tags as specified by the event
  5847. // tag type.
  5848. UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"`
  5849. // ServerResponse contains the HTTP response code and headers from the
  5850. // server.
  5851. googleapi.ServerResponse `json:"-"`
  5852. // ForceSendFields is a list of field names (e.g. "AccountId") to
  5853. // unconditionally include in API requests. By default, fields with
  5854. // empty values are omitted from API requests. However, any non-pointer,
  5855. // non-interface field appearing in ForceSendFields will be sent to the
  5856. // server regardless of whether the field is empty or not. This may be
  5857. // used to include empty fields in Patch requests.
  5858. ForceSendFields []string `json:"-"`
  5859. // NullFields is a list of field names (e.g. "AccountId") to include in
  5860. // API requests with the JSON null value. By default, fields with empty
  5861. // values are omitted from API requests. However, any field with an
  5862. // empty value appearing in NullFields will be sent to the server as
  5863. // null. It is an error if a field in this list has a non-empty value.
  5864. // This may be used to include null fields in Patch requests.
  5865. NullFields []string `json:"-"`
  5866. }
  5867. func (s *EventTag) MarshalJSON() ([]byte, error) {
  5868. type NoMethod EventTag
  5869. raw := NoMethod(*s)
  5870. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5871. }
  5872. // EventTagOverride: Event tag override information.
  5873. type EventTagOverride struct {
  5874. // Enabled: Whether this override is enabled.
  5875. Enabled bool `json:"enabled,omitempty"`
  5876. // Id: ID of this event tag override. This is a read-only,
  5877. // auto-generated field.
  5878. Id int64 `json:"id,omitempty,string"`
  5879. // ForceSendFields is a list of field names (e.g. "Enabled") to
  5880. // unconditionally include in API requests. By default, fields with
  5881. // empty values are omitted from API requests. However, any non-pointer,
  5882. // non-interface field appearing in ForceSendFields will be sent to the
  5883. // server regardless of whether the field is empty or not. This may be
  5884. // used to include empty fields in Patch requests.
  5885. ForceSendFields []string `json:"-"`
  5886. // NullFields is a list of field names (e.g. "Enabled") to include in
  5887. // API requests with the JSON null value. By default, fields with empty
  5888. // values are omitted from API requests. However, any field with an
  5889. // empty value appearing in NullFields will be sent to the server as
  5890. // null. It is an error if a field in this list has a non-empty value.
  5891. // This may be used to include null fields in Patch requests.
  5892. NullFields []string `json:"-"`
  5893. }
  5894. func (s *EventTagOverride) MarshalJSON() ([]byte, error) {
  5895. type NoMethod EventTagOverride
  5896. raw := NoMethod(*s)
  5897. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5898. }
  5899. // EventTagsListResponse: Event Tag List Response
  5900. type EventTagsListResponse struct {
  5901. // EventTags: Event tag collection.
  5902. EventTags []*EventTag `json:"eventTags,omitempty"`
  5903. // Kind: Identifies what kind of resource this is. Value: the fixed
  5904. // string "dfareporting#eventTagsListResponse".
  5905. Kind string `json:"kind,omitempty"`
  5906. // ServerResponse contains the HTTP response code and headers from the
  5907. // server.
  5908. googleapi.ServerResponse `json:"-"`
  5909. // ForceSendFields is a list of field names (e.g. "EventTags") to
  5910. // unconditionally include in API requests. By default, fields with
  5911. // empty values are omitted from API requests. However, any non-pointer,
  5912. // non-interface field appearing in ForceSendFields will be sent to the
  5913. // server regardless of whether the field is empty or not. This may be
  5914. // used to include empty fields in Patch requests.
  5915. ForceSendFields []string `json:"-"`
  5916. // NullFields is a list of field names (e.g. "EventTags") to include in
  5917. // API requests with the JSON null value. By default, fields with empty
  5918. // values are omitted from API requests. However, any field with an
  5919. // empty value appearing in NullFields will be sent to the server as
  5920. // null. It is an error if a field in this list has a non-empty value.
  5921. // This may be used to include null fields in Patch requests.
  5922. NullFields []string `json:"-"`
  5923. }
  5924. func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) {
  5925. type NoMethod EventTagsListResponse
  5926. raw := NoMethod(*s)
  5927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5928. }
  5929. // File: Represents a File resource. A file contains the metadata for a
  5930. // report run. It shows the status of the run and holds the URLs to the
  5931. // generated report data if the run is finished and the status is
  5932. // "REPORT_AVAILABLE".
  5933. type File struct {
  5934. // DateRange: The date range for which the file has report data. The
  5935. // date range will always be the absolute date range for which the
  5936. // report is run.
  5937. DateRange *DateRange `json:"dateRange,omitempty"`
  5938. // Etag: The eTag of this response for caching purposes.
  5939. Etag string `json:"etag,omitempty"`
  5940. // FileName: The filename of the file.
  5941. FileName string `json:"fileName,omitempty"`
  5942. // Format: The output format of the report. Only available once the file
  5943. // is available.
  5944. //
  5945. // Possible values:
  5946. // "CSV"
  5947. // "EXCEL"
  5948. Format string `json:"format,omitempty"`
  5949. // Id: The unique ID of this report file.
  5950. Id int64 `json:"id,omitempty,string"`
  5951. // Kind: The kind of resource this is, in this case dfareporting#file.
  5952. Kind string `json:"kind,omitempty"`
  5953. // LastModifiedTime: The timestamp in milliseconds since epoch when this
  5954. // file was last modified.
  5955. LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"`
  5956. // ReportId: The ID of the report this file was generated from.
  5957. ReportId int64 `json:"reportId,omitempty,string"`
  5958. // Status: The status of the report file.
  5959. //
  5960. // Possible values:
  5961. // "CANCELLED"
  5962. // "FAILED"
  5963. // "PROCESSING"
  5964. // "REPORT_AVAILABLE"
  5965. Status string `json:"status,omitempty"`
  5966. // Urls: The URLs where the completed report file can be downloaded.
  5967. Urls *FileUrls `json:"urls,omitempty"`
  5968. // ServerResponse contains the HTTP response code and headers from the
  5969. // server.
  5970. googleapi.ServerResponse `json:"-"`
  5971. // ForceSendFields is a list of field names (e.g. "DateRange") to
  5972. // unconditionally include in API requests. By default, fields with
  5973. // empty values are omitted from API requests. However, any non-pointer,
  5974. // non-interface field appearing in ForceSendFields will be sent to the
  5975. // server regardless of whether the field is empty or not. This may be
  5976. // used to include empty fields in Patch requests.
  5977. ForceSendFields []string `json:"-"`
  5978. // NullFields is a list of field names (e.g. "DateRange") to include in
  5979. // API requests with the JSON null value. By default, fields with empty
  5980. // values are omitted from API requests. However, any field with an
  5981. // empty value appearing in NullFields will be sent to the server as
  5982. // null. It is an error if a field in this list has a non-empty value.
  5983. // This may be used to include null fields in Patch requests.
  5984. NullFields []string `json:"-"`
  5985. }
  5986. func (s *File) MarshalJSON() ([]byte, error) {
  5987. type NoMethod File
  5988. raw := NoMethod(*s)
  5989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5990. }
  5991. // FileUrls: The URLs where the completed report file can be downloaded.
  5992. type FileUrls struct {
  5993. // ApiUrl: The URL for downloading the report data through the API.
  5994. ApiUrl string `json:"apiUrl,omitempty"`
  5995. // BrowserUrl: The URL for downloading the report data through a
  5996. // browser.
  5997. BrowserUrl string `json:"browserUrl,omitempty"`
  5998. // ForceSendFields is a list of field names (e.g. "ApiUrl") to
  5999. // unconditionally include in API requests. By default, fields with
  6000. // empty values are omitted from API requests. However, any non-pointer,
  6001. // non-interface field appearing in ForceSendFields will be sent to the
  6002. // server regardless of whether the field is empty or not. This may be
  6003. // used to include empty fields in Patch requests.
  6004. ForceSendFields []string `json:"-"`
  6005. // NullFields is a list of field names (e.g. "ApiUrl") to include in API
  6006. // requests with the JSON null value. By default, fields with empty
  6007. // values are omitted from API requests. However, any field with an
  6008. // empty value appearing in NullFields will be sent to the server as
  6009. // null. It is an error if a field in this list has a non-empty value.
  6010. // This may be used to include null fields in Patch requests.
  6011. NullFields []string `json:"-"`
  6012. }
  6013. func (s *FileUrls) MarshalJSON() ([]byte, error) {
  6014. type NoMethod FileUrls
  6015. raw := NoMethod(*s)
  6016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6017. }
  6018. // FileList: Represents the list of File resources.
  6019. type FileList struct {
  6020. // Etag: The eTag of this response for caching purposes.
  6021. Etag string `json:"etag,omitempty"`
  6022. // Items: The files returned in this response.
  6023. Items []*File `json:"items,omitempty"`
  6024. // Kind: The kind of list this is, in this case dfareporting#fileList.
  6025. Kind string `json:"kind,omitempty"`
  6026. // NextPageToken: Continuation token used to page through files. To
  6027. // retrieve the next page of results, set the next request's "pageToken"
  6028. // to the value of this field. The page token is only valid for a
  6029. // limited amount of time and should not be persisted.
  6030. NextPageToken string `json:"nextPageToken,omitempty"`
  6031. // ServerResponse contains the HTTP response code and headers from the
  6032. // server.
  6033. googleapi.ServerResponse `json:"-"`
  6034. // ForceSendFields is a list of field names (e.g. "Etag") to
  6035. // unconditionally include in API requests. By default, fields with
  6036. // empty values are omitted from API requests. However, any non-pointer,
  6037. // non-interface field appearing in ForceSendFields will be sent to the
  6038. // server regardless of whether the field is empty or not. This may be
  6039. // used to include empty fields in Patch requests.
  6040. ForceSendFields []string `json:"-"`
  6041. // NullFields is a list of field names (e.g. "Etag") to include in API
  6042. // requests with the JSON null value. By default, fields with empty
  6043. // values are omitted from API requests. However, any field with an
  6044. // empty value appearing in NullFields will be sent to the server as
  6045. // null. It is an error if a field in this list has a non-empty value.
  6046. // This may be used to include null fields in Patch requests.
  6047. NullFields []string `json:"-"`
  6048. }
  6049. func (s *FileList) MarshalJSON() ([]byte, error) {
  6050. type NoMethod FileList
  6051. raw := NoMethod(*s)
  6052. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6053. }
  6054. // Flight: Flight
  6055. type Flight struct {
  6056. // EndDate: Inventory item flight end date.
  6057. EndDate string `json:"endDate,omitempty"`
  6058. // RateOrCost: Rate or cost of this flight.
  6059. RateOrCost int64 `json:"rateOrCost,omitempty,string"`
  6060. // StartDate: Inventory item flight start date.
  6061. StartDate string `json:"startDate,omitempty"`
  6062. // Units: Units of this flight.
  6063. Units int64 `json:"units,omitempty,string"`
  6064. // ForceSendFields is a list of field names (e.g. "EndDate") to
  6065. // unconditionally include in API requests. By default, fields with
  6066. // empty values are omitted from API requests. However, any non-pointer,
  6067. // non-interface field appearing in ForceSendFields will be sent to the
  6068. // server regardless of whether the field is empty or not. This may be
  6069. // used to include empty fields in Patch requests.
  6070. ForceSendFields []string `json:"-"`
  6071. // NullFields is a list of field names (e.g. "EndDate") to include in
  6072. // API requests with the JSON null value. By default, fields with empty
  6073. // values are omitted from API requests. However, any field with an
  6074. // empty value appearing in NullFields will be sent to the server as
  6075. // null. It is an error if a field in this list has a non-empty value.
  6076. // This may be used to include null fields in Patch requests.
  6077. NullFields []string `json:"-"`
  6078. }
  6079. func (s *Flight) MarshalJSON() ([]byte, error) {
  6080. type NoMethod Flight
  6081. raw := NoMethod(*s)
  6082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6083. }
  6084. // FloodlightActivitiesGenerateTagResponse: Floodlight Activity
  6085. // GenerateTag Response
  6086. type FloodlightActivitiesGenerateTagResponse struct {
  6087. // FloodlightActivityTag: Generated tag for this Floodlight activity.
  6088. // For global site tags, this is the event snippet.
  6089. FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"`
  6090. // GlobalSiteTagGlobalSnippet: The global snippet section of a global
  6091. // site tag. The global site tag sets new cookies on your domain, which
  6092. // will store a unique identifier for a user or the ad click that
  6093. // brought the user to your site. Learn more.
  6094. GlobalSiteTagGlobalSnippet string `json:"globalSiteTagGlobalSnippet,omitempty"`
  6095. // Kind: Identifies what kind of resource this is. Value: the fixed
  6096. // string "dfareporting#floodlightActivitiesGenerateTagResponse".
  6097. Kind string `json:"kind,omitempty"`
  6098. // ServerResponse contains the HTTP response code and headers from the
  6099. // server.
  6100. googleapi.ServerResponse `json:"-"`
  6101. // ForceSendFields is a list of field names (e.g.
  6102. // "FloodlightActivityTag") to unconditionally include in API requests.
  6103. // By default, fields with empty values are omitted from API requests.
  6104. // However, any non-pointer, non-interface field appearing in
  6105. // ForceSendFields will be sent to the server regardless of whether the
  6106. // field is empty or not. This may be used to include empty fields in
  6107. // Patch requests.
  6108. ForceSendFields []string `json:"-"`
  6109. // NullFields is a list of field names (e.g. "FloodlightActivityTag") to
  6110. // include in API requests with the JSON null value. By default, fields
  6111. // with empty values are omitted from API requests. However, any field
  6112. // with an empty value appearing in NullFields will be sent to the
  6113. // server as null. It is an error if a field in this list has a
  6114. // non-empty value. This may be used to include null fields in Patch
  6115. // requests.
  6116. NullFields []string `json:"-"`
  6117. }
  6118. func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) {
  6119. type NoMethod FloodlightActivitiesGenerateTagResponse
  6120. raw := NoMethod(*s)
  6121. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6122. }
  6123. // FloodlightActivitiesListResponse: Floodlight Activity List Response
  6124. type FloodlightActivitiesListResponse struct {
  6125. // FloodlightActivities: Floodlight activity collection.
  6126. FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"`
  6127. // Kind: Identifies what kind of resource this is. Value: the fixed
  6128. // string "dfareporting#floodlightActivitiesListResponse".
  6129. Kind string `json:"kind,omitempty"`
  6130. // NextPageToken: Pagination token to be used for the next list
  6131. // operation.
  6132. NextPageToken string `json:"nextPageToken,omitempty"`
  6133. // ServerResponse contains the HTTP response code and headers from the
  6134. // server.
  6135. googleapi.ServerResponse `json:"-"`
  6136. // ForceSendFields is a list of field names (e.g.
  6137. // "FloodlightActivities") to unconditionally include in API requests.
  6138. // By default, fields with empty values are omitted from API requests.
  6139. // However, any non-pointer, non-interface field appearing in
  6140. // ForceSendFields will be sent to the server regardless of whether the
  6141. // field is empty or not. This may be used to include empty fields in
  6142. // Patch requests.
  6143. ForceSendFields []string `json:"-"`
  6144. // NullFields is a list of field names (e.g. "FloodlightActivities") to
  6145. // include in API requests with the JSON null value. By default, fields
  6146. // with empty values are omitted from API requests. However, any field
  6147. // with an empty value appearing in NullFields will be sent to the
  6148. // server as null. It is an error if a field in this list has a
  6149. // non-empty value. This may be used to include null fields in Patch
  6150. // requests.
  6151. NullFields []string `json:"-"`
  6152. }
  6153. func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) {
  6154. type NoMethod FloodlightActivitiesListResponse
  6155. raw := NoMethod(*s)
  6156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6157. }
  6158. // FloodlightActivity: Contains properties of a Floodlight activity.
  6159. type FloodlightActivity struct {
  6160. // AccountId: Account ID of this floodlight activity. This is a
  6161. // read-only field that can be left blank.
  6162. AccountId int64 `json:"accountId,omitempty,string"`
  6163. // AdvertiserId: Advertiser ID of this floodlight activity. If this
  6164. // field is left blank, the value will be copied over either from the
  6165. // activity group's advertiser or the existing activity's advertiser.
  6166. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6167. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6168. // advertiser. This is a read-only, auto-generated field.
  6169. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6170. // CacheBustingType: Code type used for cache busting in the generated
  6171. // tag. Applicable only when floodlightActivityGroupType is COUNTER and
  6172. // countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING.
  6173. //
  6174. // Possible values:
  6175. // "ACTIVE_SERVER_PAGE"
  6176. // "COLD_FUSION"
  6177. // "JAVASCRIPT"
  6178. // "JSP"
  6179. // "PHP"
  6180. CacheBustingType string `json:"cacheBustingType,omitempty"`
  6181. // CountingMethod: Counting method for conversions for this floodlight
  6182. // activity. This is a required field.
  6183. //
  6184. // Possible values:
  6185. // "ITEMS_SOLD_COUNTING"
  6186. // "SESSION_COUNTING"
  6187. // "STANDARD_COUNTING"
  6188. // "TRANSACTIONS_COUNTING"
  6189. // "UNIQUE_COUNTING"
  6190. CountingMethod string `json:"countingMethod,omitempty"`
  6191. // DefaultTags: Dynamic floodlight tags.
  6192. DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"`
  6193. // ExpectedUrl: URL where this tag will be deployed. If specified, must
  6194. // be less than 256 characters long.
  6195. ExpectedUrl string `json:"expectedUrl,omitempty"`
  6196. // FloodlightActivityGroupId: Floodlight activity group ID of this
  6197. // floodlight activity. This is a required field.
  6198. FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"`
  6199. // FloodlightActivityGroupName: Name of the associated floodlight
  6200. // activity group. This is a read-only field.
  6201. FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"`
  6202. // FloodlightActivityGroupTagString: Tag string of the associated
  6203. // floodlight activity group. This is a read-only field.
  6204. FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"`
  6205. // FloodlightActivityGroupType: Type of the associated floodlight
  6206. // activity group. This is a read-only field.
  6207. //
  6208. // Possible values:
  6209. // "COUNTER"
  6210. // "SALE"
  6211. FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"`
  6212. // FloodlightConfigurationId: Floodlight configuration ID of this
  6213. // floodlight activity. If this field is left blank, the value will be
  6214. // copied over either from the activity group's floodlight configuration
  6215. // or from the existing activity's floodlight configuration.
  6216. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6217. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6218. // of the floodlight configuration. This is a read-only, auto-generated
  6219. // field.
  6220. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6221. // FloodlightTagType: The type of Floodlight tag this activity will
  6222. // generate. This is a required field.
  6223. //
  6224. // Possible values:
  6225. // "GLOBAL_SITE_TAG"
  6226. // "IFRAME"
  6227. // "IMAGE"
  6228. FloodlightTagType string `json:"floodlightTagType,omitempty"`
  6229. // Hidden: Whether this activity is archived.
  6230. Hidden bool `json:"hidden,omitempty"`
  6231. // Id: ID of this floodlight activity. This is a read-only,
  6232. // auto-generated field.
  6233. Id int64 `json:"id,omitempty,string"`
  6234. // IdDimensionValue: Dimension value for the ID of this floodlight
  6235. // activity. This is a read-only, auto-generated field.
  6236. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6237. // Kind: Identifies what kind of resource this is. Value: the fixed
  6238. // string "dfareporting#floodlightActivity".
  6239. Kind string `json:"kind,omitempty"`
  6240. // Name: Name of this floodlight activity. This is a required field.
  6241. // Must be less than 129 characters long and cannot contain quotes.
  6242. Name string `json:"name,omitempty"`
  6243. // Notes: General notes or implementation instructions for the tag.
  6244. Notes string `json:"notes,omitempty"`
  6245. // PublisherTags: Publisher dynamic floodlight tags.
  6246. PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"`
  6247. // Secure: Whether this tag should use SSL.
  6248. Secure bool `json:"secure,omitempty"`
  6249. // SslCompliant: Whether the floodlight activity is SSL-compliant. This
  6250. // is a read-only field, its value detected by the system from the
  6251. // floodlight tags.
  6252. SslCompliant bool `json:"sslCompliant,omitempty"`
  6253. // SslRequired: Whether this floodlight activity must be SSL-compliant.
  6254. SslRequired bool `json:"sslRequired,omitempty"`
  6255. // SubaccountId: Subaccount ID of this floodlight activity. This is a
  6256. // read-only field that can be left blank.
  6257. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6258. // TagFormat: Tag format type for the floodlight activity. If left
  6259. // blank, the tag format will default to HTML.
  6260. //
  6261. // Possible values:
  6262. // "HTML"
  6263. // "XHTML"
  6264. TagFormat string `json:"tagFormat,omitempty"`
  6265. // TagString: Value of the cat= parameter in the floodlight tag, which
  6266. // the ad servers use to identify the activity. This is optional: if
  6267. // empty, a new tag string will be generated for you. This string must
  6268. // be 1 to 8 characters long, with valid characters being
  6269. // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among
  6270. // activities of the same activity group. This field is read-only after
  6271. // insertion.
  6272. TagString string `json:"tagString,omitempty"`
  6273. // UserDefinedVariableTypes: List of the user-defined variables used by
  6274. // this conversion tag. These map to the "u[1-100]=" in the tags. Each
  6275. // of these can have a user defined type.
  6276. // Acceptable values are U1 to U100, inclusive.
  6277. //
  6278. // Possible values:
  6279. // "U1"
  6280. // "U10"
  6281. // "U100"
  6282. // "U11"
  6283. // "U12"
  6284. // "U13"
  6285. // "U14"
  6286. // "U15"
  6287. // "U16"
  6288. // "U17"
  6289. // "U18"
  6290. // "U19"
  6291. // "U2"
  6292. // "U20"
  6293. // "U21"
  6294. // "U22"
  6295. // "U23"
  6296. // "U24"
  6297. // "U25"
  6298. // "U26"
  6299. // "U27"
  6300. // "U28"
  6301. // "U29"
  6302. // "U3"
  6303. // "U30"
  6304. // "U31"
  6305. // "U32"
  6306. // "U33"
  6307. // "U34"
  6308. // "U35"
  6309. // "U36"
  6310. // "U37"
  6311. // "U38"
  6312. // "U39"
  6313. // "U4"
  6314. // "U40"
  6315. // "U41"
  6316. // "U42"
  6317. // "U43"
  6318. // "U44"
  6319. // "U45"
  6320. // "U46"
  6321. // "U47"
  6322. // "U48"
  6323. // "U49"
  6324. // "U5"
  6325. // "U50"
  6326. // "U51"
  6327. // "U52"
  6328. // "U53"
  6329. // "U54"
  6330. // "U55"
  6331. // "U56"
  6332. // "U57"
  6333. // "U58"
  6334. // "U59"
  6335. // "U6"
  6336. // "U60"
  6337. // "U61"
  6338. // "U62"
  6339. // "U63"
  6340. // "U64"
  6341. // "U65"
  6342. // "U66"
  6343. // "U67"
  6344. // "U68"
  6345. // "U69"
  6346. // "U7"
  6347. // "U70"
  6348. // "U71"
  6349. // "U72"
  6350. // "U73"
  6351. // "U74"
  6352. // "U75"
  6353. // "U76"
  6354. // "U77"
  6355. // "U78"
  6356. // "U79"
  6357. // "U8"
  6358. // "U80"
  6359. // "U81"
  6360. // "U82"
  6361. // "U83"
  6362. // "U84"
  6363. // "U85"
  6364. // "U86"
  6365. // "U87"
  6366. // "U88"
  6367. // "U89"
  6368. // "U9"
  6369. // "U90"
  6370. // "U91"
  6371. // "U92"
  6372. // "U93"
  6373. // "U94"
  6374. // "U95"
  6375. // "U96"
  6376. // "U97"
  6377. // "U98"
  6378. // "U99"
  6379. UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"`
  6380. // ServerResponse contains the HTTP response code and headers from the
  6381. // server.
  6382. googleapi.ServerResponse `json:"-"`
  6383. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6384. // unconditionally include in API requests. By default, fields with
  6385. // empty values are omitted from API requests. However, any non-pointer,
  6386. // non-interface field appearing in ForceSendFields will be sent to the
  6387. // server regardless of whether the field is empty or not. This may be
  6388. // used to include empty fields in Patch requests.
  6389. ForceSendFields []string `json:"-"`
  6390. // NullFields is a list of field names (e.g. "AccountId") to include in
  6391. // API requests with the JSON null value. By default, fields with empty
  6392. // values are omitted from API requests. However, any field with an
  6393. // empty value appearing in NullFields will be sent to the server as
  6394. // null. It is an error if a field in this list has a non-empty value.
  6395. // This may be used to include null fields in Patch requests.
  6396. NullFields []string `json:"-"`
  6397. }
  6398. func (s *FloodlightActivity) MarshalJSON() ([]byte, error) {
  6399. type NoMethod FloodlightActivity
  6400. raw := NoMethod(*s)
  6401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6402. }
  6403. // FloodlightActivityDynamicTag: Dynamic Tag
  6404. type FloodlightActivityDynamicTag struct {
  6405. // Id: ID of this dynamic tag. This is a read-only, auto-generated
  6406. // field.
  6407. Id int64 `json:"id,omitempty,string"`
  6408. // Name: Name of this tag.
  6409. Name string `json:"name,omitempty"`
  6410. // Tag: Tag code.
  6411. Tag string `json:"tag,omitempty"`
  6412. // ForceSendFields is a list of field names (e.g. "Id") to
  6413. // unconditionally include in API requests. By default, fields with
  6414. // empty values are omitted from API requests. However, any non-pointer,
  6415. // non-interface field appearing in ForceSendFields will be sent to the
  6416. // server regardless of whether the field is empty or not. This may be
  6417. // used to include empty fields in Patch requests.
  6418. ForceSendFields []string `json:"-"`
  6419. // NullFields is a list of field names (e.g. "Id") to include in API
  6420. // requests with the JSON null value. By default, fields with empty
  6421. // values are omitted from API requests. However, any field with an
  6422. // empty value appearing in NullFields will be sent to the server as
  6423. // null. It is an error if a field in this list has a non-empty value.
  6424. // This may be used to include null fields in Patch requests.
  6425. NullFields []string `json:"-"`
  6426. }
  6427. func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) {
  6428. type NoMethod FloodlightActivityDynamicTag
  6429. raw := NoMethod(*s)
  6430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6431. }
  6432. // FloodlightActivityGroup: Contains properties of a Floodlight activity
  6433. // group.
  6434. type FloodlightActivityGroup struct {
  6435. // AccountId: Account ID of this floodlight activity group. This is a
  6436. // read-only field that can be left blank.
  6437. AccountId int64 `json:"accountId,omitempty,string"`
  6438. // AdvertiserId: Advertiser ID of this floodlight activity group. If
  6439. // this field is left blank, the value will be copied over either from
  6440. // the floodlight configuration's advertiser or from the existing
  6441. // activity group's advertiser.
  6442. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6443. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6444. // advertiser. This is a read-only, auto-generated field.
  6445. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6446. // FloodlightConfigurationId: Floodlight configuration ID of this
  6447. // floodlight activity group. This is a required field.
  6448. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6449. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6450. // of the floodlight configuration. This is a read-only, auto-generated
  6451. // field.
  6452. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6453. // Id: ID of this floodlight activity group. This is a read-only,
  6454. // auto-generated field.
  6455. Id int64 `json:"id,omitempty,string"`
  6456. // IdDimensionValue: Dimension value for the ID of this floodlight
  6457. // activity group. This is a read-only, auto-generated field.
  6458. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6459. // Kind: Identifies what kind of resource this is. Value: the fixed
  6460. // string "dfareporting#floodlightActivityGroup".
  6461. Kind string `json:"kind,omitempty"`
  6462. // Name: Name of this floodlight activity group. This is a required
  6463. // field. Must be less than 65 characters long and cannot contain
  6464. // quotes.
  6465. Name string `json:"name,omitempty"`
  6466. // SubaccountId: Subaccount ID of this floodlight activity group. This
  6467. // is a read-only field that can be left blank.
  6468. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6469. // TagString: Value of the type= parameter in the floodlight tag, which
  6470. // the ad servers use to identify the activity group that the activity
  6471. // belongs to. This is optional: if empty, a new tag string will be
  6472. // generated for you. This string must be 1 to 8 characters long, with
  6473. // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must
  6474. // also be unique among activity groups of the same floodlight
  6475. // configuration. This field is read-only after insertion.
  6476. TagString string `json:"tagString,omitempty"`
  6477. // Type: Type of the floodlight activity group. This is a required field
  6478. // that is read-only after insertion.
  6479. //
  6480. // Possible values:
  6481. // "COUNTER"
  6482. // "SALE"
  6483. Type string `json:"type,omitempty"`
  6484. // ServerResponse contains the HTTP response code and headers from the
  6485. // server.
  6486. googleapi.ServerResponse `json:"-"`
  6487. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6488. // unconditionally include in API requests. By default, fields with
  6489. // empty values are omitted from API requests. However, any non-pointer,
  6490. // non-interface field appearing in ForceSendFields will be sent to the
  6491. // server regardless of whether the field is empty or not. This may be
  6492. // used to include empty fields in Patch requests.
  6493. ForceSendFields []string `json:"-"`
  6494. // NullFields is a list of field names (e.g. "AccountId") to include in
  6495. // API requests with the JSON null value. By default, fields with empty
  6496. // values are omitted from API requests. However, any field with an
  6497. // empty value appearing in NullFields will be sent to the server as
  6498. // null. It is an error if a field in this list has a non-empty value.
  6499. // This may be used to include null fields in Patch requests.
  6500. NullFields []string `json:"-"`
  6501. }
  6502. func (s *FloodlightActivityGroup) MarshalJSON() ([]byte, error) {
  6503. type NoMethod FloodlightActivityGroup
  6504. raw := NoMethod(*s)
  6505. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6506. }
  6507. // FloodlightActivityGroupsListResponse: Floodlight Activity Group List
  6508. // Response
  6509. type FloodlightActivityGroupsListResponse struct {
  6510. // FloodlightActivityGroups: Floodlight activity group collection.
  6511. FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"`
  6512. // Kind: Identifies what kind of resource this is. Value: the fixed
  6513. // string "dfareporting#floodlightActivityGroupsListResponse".
  6514. Kind string `json:"kind,omitempty"`
  6515. // NextPageToken: Pagination token to be used for the next list
  6516. // operation.
  6517. NextPageToken string `json:"nextPageToken,omitempty"`
  6518. // ServerResponse contains the HTTP response code and headers from the
  6519. // server.
  6520. googleapi.ServerResponse `json:"-"`
  6521. // ForceSendFields is a list of field names (e.g.
  6522. // "FloodlightActivityGroups") to unconditionally include in API
  6523. // requests. By default, fields with empty values are omitted from API
  6524. // requests. However, any non-pointer, non-interface field appearing in
  6525. // ForceSendFields will be sent to the server regardless of whether the
  6526. // field is empty or not. This may be used to include empty fields in
  6527. // Patch requests.
  6528. ForceSendFields []string `json:"-"`
  6529. // NullFields is a list of field names (e.g. "FloodlightActivityGroups")
  6530. // to include in API requests with the JSON null value. By default,
  6531. // fields with empty values are omitted from API requests. However, any
  6532. // field with an empty value appearing in NullFields will be sent to the
  6533. // server as null. It is an error if a field in this list has a
  6534. // non-empty value. This may be used to include null fields in Patch
  6535. // requests.
  6536. NullFields []string `json:"-"`
  6537. }
  6538. func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) {
  6539. type NoMethod FloodlightActivityGroupsListResponse
  6540. raw := NoMethod(*s)
  6541. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6542. }
  6543. // FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag
  6544. type FloodlightActivityPublisherDynamicTag struct {
  6545. // ClickThrough: Whether this tag is applicable only for click-throughs.
  6546. ClickThrough bool `json:"clickThrough,omitempty"`
  6547. // DirectorySiteId: Directory site ID of this dynamic tag. This is a
  6548. // write-only field that can be used as an alternative to the siteId
  6549. // field. When this resource is retrieved, only the siteId field will be
  6550. // populated.
  6551. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  6552. // DynamicTag: Dynamic floodlight tag.
  6553. DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"`
  6554. // SiteId: Site ID of this dynamic tag.
  6555. SiteId int64 `json:"siteId,omitempty,string"`
  6556. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  6557. // a read-only, auto-generated field.
  6558. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  6559. // ViewThrough: Whether this tag is applicable only for view-throughs.
  6560. ViewThrough bool `json:"viewThrough,omitempty"`
  6561. // ForceSendFields is a list of field names (e.g. "ClickThrough") to
  6562. // unconditionally include in API requests. By default, fields with
  6563. // empty values are omitted from API requests. However, any non-pointer,
  6564. // non-interface field appearing in ForceSendFields will be sent to the
  6565. // server regardless of whether the field is empty or not. This may be
  6566. // used to include empty fields in Patch requests.
  6567. ForceSendFields []string `json:"-"`
  6568. // NullFields is a list of field names (e.g. "ClickThrough") to include
  6569. // in API requests with the JSON null value. By default, fields with
  6570. // empty values are omitted from API requests. However, any field with
  6571. // an empty value appearing in NullFields will be sent to the server as
  6572. // null. It is an error if a field in this list has a non-empty value.
  6573. // This may be used to include null fields in Patch requests.
  6574. NullFields []string `json:"-"`
  6575. }
  6576. func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) {
  6577. type NoMethod FloodlightActivityPublisherDynamicTag
  6578. raw := NoMethod(*s)
  6579. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6580. }
  6581. // FloodlightConfiguration: Contains properties of a Floodlight
  6582. // configuration.
  6583. type FloodlightConfiguration struct {
  6584. // AccountId: Account ID of this floodlight configuration. This is a
  6585. // read-only field that can be left blank.
  6586. AccountId int64 `json:"accountId,omitempty,string"`
  6587. // AdvertiserId: Advertiser ID of the parent advertiser of this
  6588. // floodlight configuration.
  6589. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6590. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6591. // advertiser. This is a read-only, auto-generated field.
  6592. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6593. // AnalyticsDataSharingEnabled: Whether advertiser data is shared with
  6594. // Google Analytics.
  6595. AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"`
  6596. // ExposureToConversionEnabled: Whether the exposure-to-conversion
  6597. // report is enabled. This report shows detailed pathway information on
  6598. // up to 10 of the most recent ad exposures seen by a user before
  6599. // converting.
  6600. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  6601. // FirstDayOfWeek: Day that will be counted as the first day of the week
  6602. // in reports. This is a required field.
  6603. //
  6604. // Possible values:
  6605. // "MONDAY"
  6606. // "SUNDAY"
  6607. FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"`
  6608. // Id: ID of this floodlight configuration. This is a read-only,
  6609. // auto-generated field.
  6610. Id int64 `json:"id,omitempty,string"`
  6611. // IdDimensionValue: Dimension value for the ID of this floodlight
  6612. // configuration. This is a read-only, auto-generated field.
  6613. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6614. // InAppAttributionTrackingEnabled: Whether in-app attribution tracking
  6615. // is enabled.
  6616. InAppAttributionTrackingEnabled bool `json:"inAppAttributionTrackingEnabled,omitempty"`
  6617. // Kind: Identifies what kind of resource this is. Value: the fixed
  6618. // string "dfareporting#floodlightConfiguration".
  6619. Kind string `json:"kind,omitempty"`
  6620. // LookbackConfiguration: Lookback window settings for this floodlight
  6621. // configuration.
  6622. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  6623. // NaturalSearchConversionAttributionOption: Types of attribution
  6624. // options for natural search conversions.
  6625. //
  6626. // Possible values:
  6627. // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6628. // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6629. // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION"
  6630. NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"`
  6631. // OmnitureSettings: Settings for DCM Omniture integration.
  6632. OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"`
  6633. // SubaccountId: Subaccount ID of this floodlight configuration. This is
  6634. // a read-only field that can be left blank.
  6635. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6636. // TagSettings: Configuration settings for dynamic and image floodlight
  6637. // tags.
  6638. TagSettings *TagSettings `json:"tagSettings,omitempty"`
  6639. // ThirdPartyAuthenticationTokens: List of third-party authentication
  6640. // tokens enabled for this configuration.
  6641. ThirdPartyAuthenticationTokens []*ThirdPartyAuthenticationToken `json:"thirdPartyAuthenticationTokens,omitempty"`
  6642. // UserDefinedVariableConfigurations: List of user defined variables
  6643. // enabled for this configuration.
  6644. UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"`
  6645. // ServerResponse contains the HTTP response code and headers from the
  6646. // server.
  6647. googleapi.ServerResponse `json:"-"`
  6648. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6649. // unconditionally include in API requests. By default, fields with
  6650. // empty values are omitted from API requests. However, any non-pointer,
  6651. // non-interface field appearing in ForceSendFields will be sent to the
  6652. // server regardless of whether the field is empty or not. This may be
  6653. // used to include empty fields in Patch requests.
  6654. ForceSendFields []string `json:"-"`
  6655. // NullFields is a list of field names (e.g. "AccountId") to include in
  6656. // API requests with the JSON null value. By default, fields with empty
  6657. // values are omitted from API requests. However, any field with an
  6658. // empty value appearing in NullFields will be sent to the server as
  6659. // null. It is an error if a field in this list has a non-empty value.
  6660. // This may be used to include null fields in Patch requests.
  6661. NullFields []string `json:"-"`
  6662. }
  6663. func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) {
  6664. type NoMethod FloodlightConfiguration
  6665. raw := NoMethod(*s)
  6666. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6667. }
  6668. // FloodlightConfigurationsListResponse: Floodlight Configuration List
  6669. // Response
  6670. type FloodlightConfigurationsListResponse struct {
  6671. // FloodlightConfigurations: Floodlight configuration collection.
  6672. FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"`
  6673. // Kind: Identifies what kind of resource this is. Value: the fixed
  6674. // string "dfareporting#floodlightConfigurationsListResponse".
  6675. Kind string `json:"kind,omitempty"`
  6676. // ServerResponse contains the HTTP response code and headers from the
  6677. // server.
  6678. googleapi.ServerResponse `json:"-"`
  6679. // ForceSendFields is a list of field names (e.g.
  6680. // "FloodlightConfigurations") to unconditionally include in API
  6681. // requests. By default, fields with empty values are omitted from API
  6682. // requests. However, any non-pointer, non-interface field appearing in
  6683. // ForceSendFields will be sent to the server regardless of whether the
  6684. // field is empty or not. This may be used to include empty fields in
  6685. // Patch requests.
  6686. ForceSendFields []string `json:"-"`
  6687. // NullFields is a list of field names (e.g. "FloodlightConfigurations")
  6688. // to include in API requests with the JSON null value. By default,
  6689. // fields with empty values are omitted from API requests. However, any
  6690. // field with an empty value appearing in NullFields will be sent to the
  6691. // server as null. It is an error if a field in this list has a
  6692. // non-empty value. This may be used to include null fields in Patch
  6693. // requests.
  6694. NullFields []string `json:"-"`
  6695. }
  6696. func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) {
  6697. type NoMethod FloodlightConfigurationsListResponse
  6698. raw := NoMethod(*s)
  6699. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6700. }
  6701. // FloodlightReportCompatibleFields: Represents fields that are
  6702. // compatible to be selected for a report of type "FlOODLIGHT".
  6703. type FloodlightReportCompatibleFields struct {
  6704. // DimensionFilters: Dimensions which are compatible to be selected in
  6705. // the "dimensionFilters" section of the report.
  6706. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  6707. // Dimensions: Dimensions which are compatible to be selected in the
  6708. // "dimensions" section of the report.
  6709. Dimensions []*Dimension `json:"dimensions,omitempty"`
  6710. // Kind: The kind of resource this is, in this case
  6711. // dfareporting#floodlightReportCompatibleFields.
  6712. Kind string `json:"kind,omitempty"`
  6713. // Metrics: Metrics which are compatible to be selected in the
  6714. // "metricNames" section of the report.
  6715. Metrics []*Metric `json:"metrics,omitempty"`
  6716. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  6717. // unconditionally include in API requests. By default, fields with
  6718. // empty values are omitted from API requests. However, any non-pointer,
  6719. // non-interface field appearing in ForceSendFields will be sent to the
  6720. // server regardless of whether the field is empty or not. This may be
  6721. // used to include empty fields in Patch requests.
  6722. ForceSendFields []string `json:"-"`
  6723. // NullFields is a list of field names (e.g. "DimensionFilters") to
  6724. // include in API requests with the JSON null value. By default, fields
  6725. // with empty values are omitted from API requests. However, any field
  6726. // with an empty value appearing in NullFields will be sent to the
  6727. // server as null. It is an error if a field in this list has a
  6728. // non-empty value. This may be used to include null fields in Patch
  6729. // requests.
  6730. NullFields []string `json:"-"`
  6731. }
  6732. func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) {
  6733. type NoMethod FloodlightReportCompatibleFields
  6734. raw := NoMethod(*s)
  6735. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6736. }
  6737. // FrequencyCap: Frequency Cap.
  6738. type FrequencyCap struct {
  6739. // Duration: Duration of time, in seconds, for this frequency cap. The
  6740. // maximum duration is 90 days. Acceptable values are 1 to 7776000,
  6741. // inclusive.
  6742. Duration int64 `json:"duration,omitempty,string"`
  6743. // Impressions: Number of times an individual user can be served the ad
  6744. // within the specified duration. Acceptable values are 1 to 15,
  6745. // inclusive.
  6746. Impressions int64 `json:"impressions,omitempty,string"`
  6747. // ForceSendFields is a list of field names (e.g. "Duration") to
  6748. // unconditionally include in API requests. By default, fields with
  6749. // empty values are omitted from API requests. However, any non-pointer,
  6750. // non-interface field appearing in ForceSendFields will be sent to the
  6751. // server regardless of whether the field is empty or not. This may be
  6752. // used to include empty fields in Patch requests.
  6753. ForceSendFields []string `json:"-"`
  6754. // NullFields is a list of field names (e.g. "Duration") to include in
  6755. // API requests with the JSON null value. By default, fields with empty
  6756. // values are omitted from API requests. However, any field with an
  6757. // empty value appearing in NullFields will be sent to the server as
  6758. // null. It is an error if a field in this list has a non-empty value.
  6759. // This may be used to include null fields in Patch requests.
  6760. NullFields []string `json:"-"`
  6761. }
  6762. func (s *FrequencyCap) MarshalJSON() ([]byte, error) {
  6763. type NoMethod FrequencyCap
  6764. raw := NoMethod(*s)
  6765. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6766. }
  6767. // FsCommand: FsCommand.
  6768. type FsCommand struct {
  6769. // Left: Distance from the left of the browser.Applicable when
  6770. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6771. Left int64 `json:"left,omitempty"`
  6772. // PositionOption: Position in the browser where the window will open.
  6773. //
  6774. // Possible values:
  6775. // "CENTERED"
  6776. // "DISTANCE_FROM_TOP_LEFT_CORNER"
  6777. PositionOption string `json:"positionOption,omitempty"`
  6778. // Top: Distance from the top of the browser. Applicable when
  6779. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6780. Top int64 `json:"top,omitempty"`
  6781. // WindowHeight: Height of the window.
  6782. WindowHeight int64 `json:"windowHeight,omitempty"`
  6783. // WindowWidth: Width of the window.
  6784. WindowWidth int64 `json:"windowWidth,omitempty"`
  6785. // ForceSendFields is a list of field names (e.g. "Left") to
  6786. // unconditionally include in API requests. By default, fields with
  6787. // empty values are omitted from API requests. However, any non-pointer,
  6788. // non-interface field appearing in ForceSendFields will be sent to the
  6789. // server regardless of whether the field is empty or not. This may be
  6790. // used to include empty fields in Patch requests.
  6791. ForceSendFields []string `json:"-"`
  6792. // NullFields is a list of field names (e.g. "Left") to include in API
  6793. // requests with the JSON null value. By default, fields with empty
  6794. // values are omitted from API requests. However, any field with an
  6795. // empty value appearing in NullFields will be sent to the server as
  6796. // null. It is an error if a field in this list has a non-empty value.
  6797. // This may be used to include null fields in Patch requests.
  6798. NullFields []string `json:"-"`
  6799. }
  6800. func (s *FsCommand) MarshalJSON() ([]byte, error) {
  6801. type NoMethod FsCommand
  6802. raw := NoMethod(*s)
  6803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6804. }
  6805. // GeoTargeting: Geographical Targeting.
  6806. type GeoTargeting struct {
  6807. // Cities: Cities to be targeted. For each city only dartId is required.
  6808. // The other fields are populated automatically when the ad is inserted
  6809. // or updated. If targeting a city, do not target or exclude the country
  6810. // of the city, and do not target the metro or region of the city.
  6811. Cities []*City `json:"cities,omitempty"`
  6812. // Countries: Countries to be targeted or excluded from targeting,
  6813. // depending on the setting of the excludeCountries field. For each
  6814. // country only dartId is required. The other fields are populated
  6815. // automatically when the ad is inserted or updated. If targeting or
  6816. // excluding a country, do not target regions, cities, metros, or postal
  6817. // codes in the same country.
  6818. Countries []*Country `json:"countries,omitempty"`
  6819. // ExcludeCountries: Whether or not to exclude the countries in the
  6820. // countries field from targeting. If false, the countries field refers
  6821. // to countries which will be targeted by the ad.
  6822. ExcludeCountries bool `json:"excludeCountries,omitempty"`
  6823. // Metros: Metros to be targeted. For each metro only dmaId is required.
  6824. // The other fields are populated automatically when the ad is inserted
  6825. // or updated. If targeting a metro, do not target or exclude the
  6826. // country of the metro.
  6827. Metros []*Metro `json:"metros,omitempty"`
  6828. // PostalCodes: Postal codes to be targeted. For each postal code only
  6829. // id is required. The other fields are populated automatically when the
  6830. // ad is inserted or updated. If targeting a postal code, do not target
  6831. // or exclude the country of the postal code.
  6832. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  6833. // Regions: Regions to be targeted. For each region only dartId is
  6834. // required. The other fields are populated automatically when the ad is
  6835. // inserted or updated. If targeting a region, do not target or exclude
  6836. // the country of the region.
  6837. Regions []*Region `json:"regions,omitempty"`
  6838. // ForceSendFields is a list of field names (e.g. "Cities") 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. "Cities") to include in API
  6846. // requests with the JSON null value. By default, fields with empty
  6847. // values are omitted from API requests. However, any field with an
  6848. // empty value appearing in NullFields will be sent to the server as
  6849. // null. It is an error if a field in this list has a non-empty value.
  6850. // This may be used to include null fields in Patch requests.
  6851. NullFields []string `json:"-"`
  6852. }
  6853. func (s *GeoTargeting) MarshalJSON() ([]byte, error) {
  6854. type NoMethod GeoTargeting
  6855. raw := NoMethod(*s)
  6856. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6857. }
  6858. // InventoryItem: Represents a buy from the DoubleClick Planning
  6859. // inventory store.
  6860. type InventoryItem struct {
  6861. // AccountId: Account ID of this inventory item.
  6862. AccountId int64 `json:"accountId,omitempty,string"`
  6863. // AdSlots: Ad slots of this inventory item. If this inventory item
  6864. // represents a standalone placement, there will be exactly one ad slot.
  6865. // If this inventory item represents a placement group, there will be
  6866. // more than one ad slot, each representing one child placement in that
  6867. // placement group.
  6868. AdSlots []*AdSlot `json:"adSlots,omitempty"`
  6869. // AdvertiserId: Advertiser ID of this inventory item.
  6870. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6871. // ContentCategoryId: Content category ID of this inventory item.
  6872. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  6873. // EstimatedClickThroughRate: Estimated click-through rate of this
  6874. // inventory item.
  6875. EstimatedClickThroughRate int64 `json:"estimatedClickThroughRate,omitempty,string"`
  6876. // EstimatedConversionRate: Estimated conversion rate of this inventory
  6877. // item.
  6878. EstimatedConversionRate int64 `json:"estimatedConversionRate,omitempty,string"`
  6879. // Id: ID of this inventory item.
  6880. Id int64 `json:"id,omitempty,string"`
  6881. // InPlan: Whether this inventory item is in plan.
  6882. InPlan bool `json:"inPlan,omitempty"`
  6883. // Kind: Identifies what kind of resource this is. Value: the fixed
  6884. // string "dfareporting#inventoryItem".
  6885. Kind string `json:"kind,omitempty"`
  6886. // LastModifiedInfo: Information about the most recent modification of
  6887. // this inventory item.
  6888. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  6889. // Name: Name of this inventory item. For standalone inventory items,
  6890. // this is the same name as that of its only ad slot. For group
  6891. // inventory items, this can differ from the name of any of its ad
  6892. // slots.
  6893. Name string `json:"name,omitempty"`
  6894. // NegotiationChannelId: Negotiation channel ID of this inventory item.
  6895. NegotiationChannelId int64 `json:"negotiationChannelId,omitempty,string"`
  6896. // OrderId: Order ID of this inventory item.
  6897. OrderId int64 `json:"orderId,omitempty,string"`
  6898. // PlacementStrategyId: Placement strategy ID of this inventory item.
  6899. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  6900. // Pricing: Pricing of this inventory item.
  6901. Pricing *Pricing `json:"pricing,omitempty"`
  6902. // ProjectId: Project ID of this inventory item.
  6903. ProjectId int64 `json:"projectId,omitempty,string"`
  6904. // RfpId: RFP ID of this inventory item.
  6905. RfpId int64 `json:"rfpId,omitempty,string"`
  6906. // SiteId: ID of the site this inventory item is associated with.
  6907. SiteId int64 `json:"siteId,omitempty,string"`
  6908. // SubaccountId: Subaccount ID of this inventory item.
  6909. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6910. // Type: Type of inventory item.
  6911. //
  6912. // Possible values:
  6913. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  6914. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  6915. Type string `json:"type,omitempty"`
  6916. // ServerResponse contains the HTTP response code and headers from the
  6917. // server.
  6918. googleapi.ServerResponse `json:"-"`
  6919. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6920. // unconditionally include in API requests. By default, fields with
  6921. // empty values are omitted from API requests. However, any non-pointer,
  6922. // non-interface field appearing in ForceSendFields will be sent to the
  6923. // server regardless of whether the field is empty or not. This may be
  6924. // used to include empty fields in Patch requests.
  6925. ForceSendFields []string `json:"-"`
  6926. // NullFields is a list of field names (e.g. "AccountId") to include in
  6927. // API requests with the JSON null value. By default, fields with empty
  6928. // values are omitted from API requests. However, any field with an
  6929. // empty value appearing in NullFields will be sent to the server as
  6930. // null. It is an error if a field in this list has a non-empty value.
  6931. // This may be used to include null fields in Patch requests.
  6932. NullFields []string `json:"-"`
  6933. }
  6934. func (s *InventoryItem) MarshalJSON() ([]byte, error) {
  6935. type NoMethod InventoryItem
  6936. raw := NoMethod(*s)
  6937. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6938. }
  6939. // InventoryItemsListResponse: Inventory item List Response
  6940. type InventoryItemsListResponse struct {
  6941. // InventoryItems: Inventory item collection
  6942. InventoryItems []*InventoryItem `json:"inventoryItems,omitempty"`
  6943. // Kind: Identifies what kind of resource this is. Value: the fixed
  6944. // string "dfareporting#inventoryItemsListResponse".
  6945. Kind string `json:"kind,omitempty"`
  6946. // NextPageToken: Pagination token to be used for the next list
  6947. // operation.
  6948. NextPageToken string `json:"nextPageToken,omitempty"`
  6949. // ServerResponse contains the HTTP response code and headers from the
  6950. // server.
  6951. googleapi.ServerResponse `json:"-"`
  6952. // ForceSendFields is a list of field names (e.g. "InventoryItems") to
  6953. // unconditionally include in API requests. By default, fields with
  6954. // empty values are omitted from API requests. However, any non-pointer,
  6955. // non-interface field appearing in ForceSendFields will be sent to the
  6956. // server regardless of whether the field is empty or not. This may be
  6957. // used to include empty fields in Patch requests.
  6958. ForceSendFields []string `json:"-"`
  6959. // NullFields is a list of field names (e.g. "InventoryItems") to
  6960. // include in API requests with the JSON null value. By default, fields
  6961. // with empty values are omitted from API requests. However, any field
  6962. // with an empty value appearing in NullFields will be sent to the
  6963. // server as null. It is an error if a field in this list has a
  6964. // non-empty value. This may be used to include null fields in Patch
  6965. // requests.
  6966. NullFields []string `json:"-"`
  6967. }
  6968. func (s *InventoryItemsListResponse) MarshalJSON() ([]byte, error) {
  6969. type NoMethod InventoryItemsListResponse
  6970. raw := NoMethod(*s)
  6971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6972. }
  6973. // KeyValueTargetingExpression: Key Value Targeting Expression.
  6974. type KeyValueTargetingExpression struct {
  6975. // Expression: Keyword expression being targeted by the ad.
  6976. Expression string `json:"expression,omitempty"`
  6977. // ForceSendFields is a list of field names (e.g. "Expression") to
  6978. // unconditionally include in API requests. By default, fields with
  6979. // empty values are omitted from API requests. However, any non-pointer,
  6980. // non-interface field appearing in ForceSendFields will be sent to the
  6981. // server regardless of whether the field is empty or not. This may be
  6982. // used to include empty fields in Patch requests.
  6983. ForceSendFields []string `json:"-"`
  6984. // NullFields is a list of field names (e.g. "Expression") to include in
  6985. // API requests with the JSON null value. By default, fields with empty
  6986. // values are omitted from API requests. However, any field with an
  6987. // empty value appearing in NullFields will be sent to the server as
  6988. // null. It is an error if a field in this list has a non-empty value.
  6989. // This may be used to include null fields in Patch requests.
  6990. NullFields []string `json:"-"`
  6991. }
  6992. func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) {
  6993. type NoMethod KeyValueTargetingExpression
  6994. raw := NoMethod(*s)
  6995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6996. }
  6997. // LandingPage: Contains information about where a user's browser is
  6998. // taken after the user clicks an ad.
  6999. type LandingPage struct {
  7000. // AdvertiserId: Advertiser ID of this landing page. This is a required
  7001. // field.
  7002. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7003. // Archived: Whether this landing page has been archived.
  7004. Archived bool `json:"archived,omitempty"`
  7005. // Id: ID of this landing page. This is a read-only, auto-generated
  7006. // field.
  7007. Id int64 `json:"id,omitempty,string"`
  7008. // Kind: Identifies what kind of resource this is. Value: the fixed
  7009. // string "dfareporting#landingPage".
  7010. Kind string `json:"kind,omitempty"`
  7011. // Name: Name of this landing page. This is a required field. It must be
  7012. // less than 256 characters long.
  7013. Name string `json:"name,omitempty"`
  7014. // Url: URL of this landing page. This is a required field.
  7015. Url string `json:"url,omitempty"`
  7016. // ServerResponse contains the HTTP response code and headers from the
  7017. // server.
  7018. googleapi.ServerResponse `json:"-"`
  7019. // ForceSendFields is a list of field names (e.g. "AdvertiserId") to
  7020. // unconditionally include in API requests. By default, fields with
  7021. // empty values are omitted from API requests. However, any non-pointer,
  7022. // non-interface field appearing in ForceSendFields will be sent to the
  7023. // server regardless of whether the field is empty or not. This may be
  7024. // used to include empty fields in Patch requests.
  7025. ForceSendFields []string `json:"-"`
  7026. // NullFields is a list of field names (e.g. "AdvertiserId") to include
  7027. // in API requests with the JSON null value. By default, fields with
  7028. // empty values are omitted from API requests. However, any field with
  7029. // an empty value appearing in NullFields will be sent to the server as
  7030. // null. It is an error if a field in this list has a non-empty value.
  7031. // This may be used to include null fields in Patch requests.
  7032. NullFields []string `json:"-"`
  7033. }
  7034. func (s *LandingPage) MarshalJSON() ([]byte, error) {
  7035. type NoMethod LandingPage
  7036. raw := NoMethod(*s)
  7037. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7038. }
  7039. // Language: Contains information about a language that can be targeted
  7040. // by ads.
  7041. type Language struct {
  7042. // Id: Language ID of this language. This is the ID used for targeting
  7043. // and generating reports.
  7044. Id int64 `json:"id,omitempty,string"`
  7045. // Kind: Identifies what kind of resource this is. Value: the fixed
  7046. // string "dfareporting#language".
  7047. Kind string `json:"kind,omitempty"`
  7048. // LanguageCode: Format of language code is an ISO 639 two-letter
  7049. // language code optionally followed by an underscore followed by an ISO
  7050. // 3166 code. Examples are "en" for English or "zh_CN" for Simplified
  7051. // Chinese.
  7052. LanguageCode string `json:"languageCode,omitempty"`
  7053. // Name: Name of this language.
  7054. Name string `json:"name,omitempty"`
  7055. // ForceSendFields is a list of field names (e.g. "Id") to
  7056. // unconditionally include in API requests. By default, fields with
  7057. // empty values are omitted from API requests. However, any non-pointer,
  7058. // non-interface field appearing in ForceSendFields will be sent to the
  7059. // server regardless of whether the field is empty or not. This may be
  7060. // used to include empty fields in Patch requests.
  7061. ForceSendFields []string `json:"-"`
  7062. // NullFields is a list of field names (e.g. "Id") to include in API
  7063. // requests with the JSON null value. By default, fields with empty
  7064. // values are omitted from API requests. However, any field with an
  7065. // empty value appearing in NullFields will be sent to the server as
  7066. // null. It is an error if a field in this list has a non-empty value.
  7067. // This may be used to include null fields in Patch requests.
  7068. NullFields []string `json:"-"`
  7069. }
  7070. func (s *Language) MarshalJSON() ([]byte, error) {
  7071. type NoMethod Language
  7072. raw := NoMethod(*s)
  7073. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7074. }
  7075. // LanguageTargeting: Language Targeting.
  7076. type LanguageTargeting struct {
  7077. // Languages: Languages that this ad targets. For each language only
  7078. // languageId is required. The other fields are populated automatically
  7079. // when the ad is inserted or updated.
  7080. Languages []*Language `json:"languages,omitempty"`
  7081. // ForceSendFields is a list of field names (e.g. "Languages") to
  7082. // unconditionally include in API requests. By default, fields with
  7083. // empty values are omitted from API requests. However, any non-pointer,
  7084. // non-interface field appearing in ForceSendFields will be sent to the
  7085. // server regardless of whether the field is empty or not. This may be
  7086. // used to include empty fields in Patch requests.
  7087. ForceSendFields []string `json:"-"`
  7088. // NullFields is a list of field names (e.g. "Languages") to include in
  7089. // API requests with the JSON null value. By default, fields with empty
  7090. // values are omitted from API requests. However, any field with an
  7091. // empty value appearing in NullFields will be sent to the server as
  7092. // null. It is an error if a field in this list has a non-empty value.
  7093. // This may be used to include null fields in Patch requests.
  7094. NullFields []string `json:"-"`
  7095. }
  7096. func (s *LanguageTargeting) MarshalJSON() ([]byte, error) {
  7097. type NoMethod LanguageTargeting
  7098. raw := NoMethod(*s)
  7099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7100. }
  7101. // LanguagesListResponse: Language List Response
  7102. type LanguagesListResponse struct {
  7103. // Kind: Identifies what kind of resource this is. Value: the fixed
  7104. // string "dfareporting#languagesListResponse".
  7105. Kind string `json:"kind,omitempty"`
  7106. // Languages: Language collection.
  7107. Languages []*Language `json:"languages,omitempty"`
  7108. // ServerResponse contains the HTTP response code and headers from the
  7109. // server.
  7110. googleapi.ServerResponse `json:"-"`
  7111. // ForceSendFields is a list of field names (e.g. "Kind") to
  7112. // unconditionally include in API requests. By default, fields with
  7113. // empty values are omitted from API requests. However, any non-pointer,
  7114. // non-interface field appearing in ForceSendFields will be sent to the
  7115. // server regardless of whether the field is empty or not. This may be
  7116. // used to include empty fields in Patch requests.
  7117. ForceSendFields []string `json:"-"`
  7118. // NullFields is a list of field names (e.g. "Kind") to include in API
  7119. // requests with the JSON null value. By default, fields with empty
  7120. // values are omitted from API requests. However, any field with an
  7121. // empty value appearing in NullFields will be sent to the server as
  7122. // null. It is an error if a field in this list has a non-empty value.
  7123. // This may be used to include null fields in Patch requests.
  7124. NullFields []string `json:"-"`
  7125. }
  7126. func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) {
  7127. type NoMethod LanguagesListResponse
  7128. raw := NoMethod(*s)
  7129. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7130. }
  7131. // LastModifiedInfo: Modification timestamp.
  7132. type LastModifiedInfo struct {
  7133. // Time: Timestamp of the last change in milliseconds since epoch.
  7134. Time int64 `json:"time,omitempty,string"`
  7135. // ForceSendFields is a list of field names (e.g. "Time") to
  7136. // unconditionally include in API requests. By default, fields with
  7137. // empty values are omitted from API requests. However, any non-pointer,
  7138. // non-interface field appearing in ForceSendFields will be sent to the
  7139. // server regardless of whether the field is empty or not. This may be
  7140. // used to include empty fields in Patch requests.
  7141. ForceSendFields []string `json:"-"`
  7142. // NullFields is a list of field names (e.g. "Time") to include in API
  7143. // requests with the JSON null value. By default, fields with empty
  7144. // values are omitted from API requests. However, any field with an
  7145. // empty value appearing in NullFields will be sent to the server as
  7146. // null. It is an error if a field in this list has a non-empty value.
  7147. // This may be used to include null fields in Patch requests.
  7148. NullFields []string `json:"-"`
  7149. }
  7150. func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) {
  7151. type NoMethod LastModifiedInfo
  7152. raw := NoMethod(*s)
  7153. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7154. }
  7155. // ListPopulationClause: A group clause made up of list population terms
  7156. // representing constraints joined by ORs.
  7157. type ListPopulationClause struct {
  7158. // Terms: Terms of this list population clause. Each clause is made up
  7159. // of list population terms representing constraints and are joined by
  7160. // ORs.
  7161. Terms []*ListPopulationTerm `json:"terms,omitempty"`
  7162. // ForceSendFields is a list of field names (e.g. "Terms") to
  7163. // unconditionally include in API requests. By default, fields with
  7164. // empty values are omitted from API requests. However, any non-pointer,
  7165. // non-interface field appearing in ForceSendFields will be sent to the
  7166. // server regardless of whether the field is empty or not. This may be
  7167. // used to include empty fields in Patch requests.
  7168. ForceSendFields []string `json:"-"`
  7169. // NullFields is a list of field names (e.g. "Terms") to include in API
  7170. // requests with the JSON null value. By default, fields with empty
  7171. // values are omitted from API requests. However, any field with an
  7172. // empty value appearing in NullFields will be sent to the server as
  7173. // null. It is an error if a field in this list has a non-empty value.
  7174. // This may be used to include null fields in Patch requests.
  7175. NullFields []string `json:"-"`
  7176. }
  7177. func (s *ListPopulationClause) MarshalJSON() ([]byte, error) {
  7178. type NoMethod ListPopulationClause
  7179. raw := NoMethod(*s)
  7180. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7181. }
  7182. // ListPopulationRule: Remarketing List Population Rule.
  7183. type ListPopulationRule struct {
  7184. // FloodlightActivityId: Floodlight activity ID associated with this
  7185. // rule. This field can be left blank.
  7186. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7187. // FloodlightActivityName: Name of floodlight activity associated with
  7188. // this rule. This is a read-only, auto-generated field.
  7189. FloodlightActivityName string `json:"floodlightActivityName,omitempty"`
  7190. // ListPopulationClauses: Clauses that make up this list population
  7191. // rule. Clauses are joined by ANDs, and the clauses themselves are made
  7192. // up of list population terms which are joined by ORs.
  7193. ListPopulationClauses []*ListPopulationClause `json:"listPopulationClauses,omitempty"`
  7194. // ForceSendFields is a list of field names (e.g.
  7195. // "FloodlightActivityId") to unconditionally include in API requests.
  7196. // By default, fields with empty values are omitted from API requests.
  7197. // However, any non-pointer, non-interface field appearing in
  7198. // ForceSendFields will be sent to the server regardless of whether the
  7199. // field is empty or not. This may be used to include empty fields in
  7200. // Patch requests.
  7201. ForceSendFields []string `json:"-"`
  7202. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7203. // include in API requests with the JSON null value. By default, fields
  7204. // with empty values are omitted from API requests. However, any field
  7205. // with an empty value appearing in NullFields will be sent to the
  7206. // server as null. It is an error if a field in this list has a
  7207. // non-empty value. This may be used to include null fields in Patch
  7208. // requests.
  7209. NullFields []string `json:"-"`
  7210. }
  7211. func (s *ListPopulationRule) MarshalJSON() ([]byte, error) {
  7212. type NoMethod ListPopulationRule
  7213. raw := NoMethod(*s)
  7214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7215. }
  7216. // ListPopulationTerm: Remarketing List Population Rule Term.
  7217. type ListPopulationTerm struct {
  7218. // Contains: Will be true if the term should check if the user is in the
  7219. // list and false if the term should check if the user is not in the
  7220. // list. This field is only relevant when type is set to
  7221. // LIST_MEMBERSHIP_TERM. False by default.
  7222. Contains bool `json:"contains,omitempty"`
  7223. // Negation: Whether to negate the comparison result of this term during
  7224. // rule evaluation. This field is only relevant when type is left unset
  7225. // or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7226. Negation bool `json:"negation,omitempty"`
  7227. // Operator: Comparison operator of this term. This field is only
  7228. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7229. // REFERRER_TERM.
  7230. //
  7231. // Possible values:
  7232. // "NUM_EQUALS"
  7233. // "NUM_GREATER_THAN"
  7234. // "NUM_GREATER_THAN_EQUAL"
  7235. // "NUM_LESS_THAN"
  7236. // "NUM_LESS_THAN_EQUAL"
  7237. // "STRING_CONTAINS"
  7238. // "STRING_EQUALS"
  7239. Operator string `json:"operator,omitempty"`
  7240. // RemarketingListId: ID of the list in question. This field is only
  7241. // relevant when type is set to LIST_MEMBERSHIP_TERM.
  7242. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  7243. // Type: List population term type determines the applicable fields in
  7244. // this object. If left unset or set to CUSTOM_VARIABLE_TERM, then
  7245. // variableName, variableFriendlyName, operator, value, and negation are
  7246. // applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and
  7247. // contains are applicable. If set to REFERRER_TERM then operator,
  7248. // value, and negation are applicable.
  7249. //
  7250. // Possible values:
  7251. // "CUSTOM_VARIABLE_TERM"
  7252. // "LIST_MEMBERSHIP_TERM"
  7253. // "REFERRER_TERM"
  7254. Type string `json:"type,omitempty"`
  7255. // Value: Literal to compare the variable to. This field is only
  7256. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7257. // REFERRER_TERM.
  7258. Value string `json:"value,omitempty"`
  7259. // VariableFriendlyName: Friendly name of this term's variable. This is
  7260. // a read-only, auto-generated field. This field is only relevant when
  7261. // type is left unset or set to CUSTOM_VARIABLE_TERM.
  7262. VariableFriendlyName string `json:"variableFriendlyName,omitempty"`
  7263. // VariableName: Name of the variable (U1, U2, etc.) being compared in
  7264. // this term. This field is only relevant when type is set to null,
  7265. // CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7266. VariableName string `json:"variableName,omitempty"`
  7267. // ForceSendFields is a list of field names (e.g. "Contains") to
  7268. // unconditionally include in API requests. By default, fields with
  7269. // empty values are omitted from API requests. However, any non-pointer,
  7270. // non-interface field appearing in ForceSendFields will be sent to the
  7271. // server regardless of whether the field is empty or not. This may be
  7272. // used to include empty fields in Patch requests.
  7273. ForceSendFields []string `json:"-"`
  7274. // NullFields is a list of field names (e.g. "Contains") to include in
  7275. // API requests with the JSON null value. By default, fields with empty
  7276. // values are omitted from API requests. However, any field with an
  7277. // empty value appearing in NullFields will be sent to the server as
  7278. // null. It is an error if a field in this list has a non-empty value.
  7279. // This may be used to include null fields in Patch requests.
  7280. NullFields []string `json:"-"`
  7281. }
  7282. func (s *ListPopulationTerm) MarshalJSON() ([]byte, error) {
  7283. type NoMethod ListPopulationTerm
  7284. raw := NoMethod(*s)
  7285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7286. }
  7287. // ListTargetingExpression: Remarketing List Targeting Expression.
  7288. type ListTargetingExpression struct {
  7289. // Expression: Expression describing which lists are being targeted by
  7290. // the ad.
  7291. Expression string `json:"expression,omitempty"`
  7292. // ForceSendFields is a list of field names (e.g. "Expression") to
  7293. // unconditionally include in API requests. By default, fields with
  7294. // empty values are omitted from API requests. However, any non-pointer,
  7295. // non-interface field appearing in ForceSendFields will be sent to the
  7296. // server regardless of whether the field is empty or not. This may be
  7297. // used to include empty fields in Patch requests.
  7298. ForceSendFields []string `json:"-"`
  7299. // NullFields is a list of field names (e.g. "Expression") to include in
  7300. // API requests with the JSON null value. By default, fields with empty
  7301. // values are omitted from API requests. However, any field with an
  7302. // empty value appearing in NullFields will be sent to the server as
  7303. // null. It is an error if a field in this list has a non-empty value.
  7304. // This may be used to include null fields in Patch requests.
  7305. NullFields []string `json:"-"`
  7306. }
  7307. func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) {
  7308. type NoMethod ListTargetingExpression
  7309. raw := NoMethod(*s)
  7310. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7311. }
  7312. // LookbackConfiguration: Lookback configuration settings.
  7313. type LookbackConfiguration struct {
  7314. // ClickDuration: Lookback window, in days, from the last time a given
  7315. // user clicked on one of your ads. If you enter 0, clicks will not be
  7316. // considered as triggering events for floodlight tracking. If you leave
  7317. // this field blank, the default value for your account will be used.
  7318. // Acceptable values are 0 to 90, inclusive.
  7319. ClickDuration int64 `json:"clickDuration,omitempty"`
  7320. // PostImpressionActivitiesDuration: Lookback window, in days, from the
  7321. // last time a given user viewed one of your ads. If you enter 0,
  7322. // impressions will not be considered as triggering events for
  7323. // floodlight tracking. If you leave this field blank, the default value
  7324. // for your account will be used. Acceptable values are 0 to 90,
  7325. // inclusive.
  7326. PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"`
  7327. // ForceSendFields is a list of field names (e.g. "ClickDuration") to
  7328. // unconditionally include in API requests. By default, fields with
  7329. // empty values are omitted from API requests. However, any non-pointer,
  7330. // non-interface field appearing in ForceSendFields will be sent to the
  7331. // server regardless of whether the field is empty or not. This may be
  7332. // used to include empty fields in Patch requests.
  7333. ForceSendFields []string `json:"-"`
  7334. // NullFields is a list of field names (e.g. "ClickDuration") to include
  7335. // in API requests with the JSON null value. By default, fields with
  7336. // empty values are omitted from API requests. However, any field with
  7337. // an empty value appearing in NullFields will be sent to the server as
  7338. // null. It is an error if a field in this list has a non-empty value.
  7339. // This may be used to include null fields in Patch requests.
  7340. NullFields []string `json:"-"`
  7341. }
  7342. func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) {
  7343. type NoMethod LookbackConfiguration
  7344. raw := NoMethod(*s)
  7345. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7346. }
  7347. // Metric: Represents a metric.
  7348. type Metric struct {
  7349. // Kind: The kind of resource this is, in this case dfareporting#metric.
  7350. Kind string `json:"kind,omitempty"`
  7351. // Name: The metric name, e.g. dfa:impressions
  7352. Name string `json:"name,omitempty"`
  7353. // ForceSendFields is a list of field names (e.g. "Kind") to
  7354. // unconditionally include in API requests. By default, fields with
  7355. // empty values are omitted from API requests. However, any non-pointer,
  7356. // non-interface field appearing in ForceSendFields will be sent to the
  7357. // server regardless of whether the field is empty or not. This may be
  7358. // used to include empty fields in Patch requests.
  7359. ForceSendFields []string `json:"-"`
  7360. // NullFields is a list of field names (e.g. "Kind") to include in API
  7361. // requests with the JSON null value. By default, fields with empty
  7362. // values are omitted from API requests. However, any field with an
  7363. // empty value appearing in NullFields will be sent to the server as
  7364. // null. It is an error if a field in this list has a non-empty value.
  7365. // This may be used to include null fields in Patch requests.
  7366. NullFields []string `json:"-"`
  7367. }
  7368. func (s *Metric) MarshalJSON() ([]byte, error) {
  7369. type NoMethod Metric
  7370. raw := NoMethod(*s)
  7371. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7372. }
  7373. // Metro: Contains information about a metro region that can be targeted
  7374. // by ads.
  7375. type Metro struct {
  7376. // CountryCode: Country code of the country to which this metro region
  7377. // belongs.
  7378. CountryCode string `json:"countryCode,omitempty"`
  7379. // CountryDartId: DART ID of the country to which this metro region
  7380. // belongs.
  7381. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7382. // DartId: DART ID of this metro region.
  7383. DartId int64 `json:"dartId,omitempty,string"`
  7384. // DmaId: DMA ID of this metro region. This is the ID used for targeting
  7385. // and generating reports, and is equivalent to metro_code.
  7386. DmaId int64 `json:"dmaId,omitempty,string"`
  7387. // Kind: Identifies what kind of resource this is. Value: the fixed
  7388. // string "dfareporting#metro".
  7389. Kind string `json:"kind,omitempty"`
  7390. // MetroCode: Metro code of this metro region. This is equivalent to
  7391. // dma_id.
  7392. MetroCode string `json:"metroCode,omitempty"`
  7393. // Name: Name of this metro region.
  7394. Name string `json:"name,omitempty"`
  7395. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7396. // unconditionally include in API requests. By default, fields with
  7397. // empty values are omitted from API requests. However, any non-pointer,
  7398. // non-interface field appearing in ForceSendFields will be sent to the
  7399. // server regardless of whether the field is empty or not. This may be
  7400. // used to include empty fields in Patch requests.
  7401. ForceSendFields []string `json:"-"`
  7402. // NullFields is a list of field names (e.g. "CountryCode") to include
  7403. // in API requests with the JSON null value. By default, fields with
  7404. // empty values are omitted from API requests. However, any field with
  7405. // an empty value appearing in NullFields will be sent to the server as
  7406. // null. It is an error if a field in this list has a non-empty value.
  7407. // This may be used to include null fields in Patch requests.
  7408. NullFields []string `json:"-"`
  7409. }
  7410. func (s *Metro) MarshalJSON() ([]byte, error) {
  7411. type NoMethod Metro
  7412. raw := NoMethod(*s)
  7413. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7414. }
  7415. // MetrosListResponse: Metro List Response
  7416. type MetrosListResponse struct {
  7417. // Kind: Identifies what kind of resource this is. Value: the fixed
  7418. // string "dfareporting#metrosListResponse".
  7419. Kind string `json:"kind,omitempty"`
  7420. // Metros: Metro collection.
  7421. Metros []*Metro `json:"metros,omitempty"`
  7422. // ServerResponse contains the HTTP response code and headers from the
  7423. // server.
  7424. googleapi.ServerResponse `json:"-"`
  7425. // ForceSendFields is a list of field names (e.g. "Kind") to
  7426. // unconditionally include in API requests. By default, fields with
  7427. // empty values are omitted from API requests. However, any non-pointer,
  7428. // non-interface field appearing in ForceSendFields will be sent to the
  7429. // server regardless of whether the field is empty or not. This may be
  7430. // used to include empty fields in Patch requests.
  7431. ForceSendFields []string `json:"-"`
  7432. // NullFields is a list of field names (e.g. "Kind") to include in API
  7433. // requests with the JSON null value. By default, fields with empty
  7434. // values are omitted from API requests. However, any field with an
  7435. // empty value appearing in NullFields will be sent to the server as
  7436. // null. It is an error if a field in this list has a non-empty value.
  7437. // This may be used to include null fields in Patch requests.
  7438. NullFields []string `json:"-"`
  7439. }
  7440. func (s *MetrosListResponse) MarshalJSON() ([]byte, error) {
  7441. type NoMethod MetrosListResponse
  7442. raw := NoMethod(*s)
  7443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7444. }
  7445. // MobileCarrier: Contains information about a mobile carrier that can
  7446. // be targeted by ads.
  7447. type MobileCarrier struct {
  7448. // CountryCode: Country code of the country to which this mobile carrier
  7449. // belongs.
  7450. CountryCode string `json:"countryCode,omitempty"`
  7451. // CountryDartId: DART ID of the country to which this mobile carrier
  7452. // belongs.
  7453. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7454. // Id: ID of this mobile carrier.
  7455. Id int64 `json:"id,omitempty,string"`
  7456. // Kind: Identifies what kind of resource this is. Value: the fixed
  7457. // string "dfareporting#mobileCarrier".
  7458. Kind string `json:"kind,omitempty"`
  7459. // Name: Name of this mobile carrier.
  7460. Name string `json:"name,omitempty"`
  7461. // ServerResponse contains the HTTP response code and headers from the
  7462. // server.
  7463. googleapi.ServerResponse `json:"-"`
  7464. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7465. // unconditionally include in API requests. By default, fields with
  7466. // empty values are omitted from API requests. However, any non-pointer,
  7467. // non-interface field appearing in ForceSendFields will be sent to the
  7468. // server regardless of whether the field is empty or not. This may be
  7469. // used to include empty fields in Patch requests.
  7470. ForceSendFields []string `json:"-"`
  7471. // NullFields is a list of field names (e.g. "CountryCode") to include
  7472. // in API requests with the JSON null value. By default, fields with
  7473. // empty values are omitted from API requests. However, any field with
  7474. // an empty value appearing in NullFields will be sent to the server as
  7475. // null. It is an error if a field in this list has a non-empty value.
  7476. // This may be used to include null fields in Patch requests.
  7477. NullFields []string `json:"-"`
  7478. }
  7479. func (s *MobileCarrier) MarshalJSON() ([]byte, error) {
  7480. type NoMethod MobileCarrier
  7481. raw := NoMethod(*s)
  7482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7483. }
  7484. // MobileCarriersListResponse: Mobile Carrier List Response
  7485. type MobileCarriersListResponse struct {
  7486. // Kind: Identifies what kind of resource this is. Value: the fixed
  7487. // string "dfareporting#mobileCarriersListResponse".
  7488. Kind string `json:"kind,omitempty"`
  7489. // MobileCarriers: Mobile carrier collection.
  7490. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  7491. // ServerResponse contains the HTTP response code and headers from the
  7492. // server.
  7493. googleapi.ServerResponse `json:"-"`
  7494. // ForceSendFields is a list of field names (e.g. "Kind") to
  7495. // unconditionally include in API requests. By default, fields with
  7496. // empty values are omitted from API requests. However, any non-pointer,
  7497. // non-interface field appearing in ForceSendFields will be sent to the
  7498. // server regardless of whether the field is empty or not. This may be
  7499. // used to include empty fields in Patch requests.
  7500. ForceSendFields []string `json:"-"`
  7501. // NullFields is a list of field names (e.g. "Kind") to include in API
  7502. // requests with the JSON null value. By default, fields with empty
  7503. // values are omitted from API requests. However, any field with an
  7504. // empty value appearing in NullFields will be sent to the server as
  7505. // null. It is an error if a field in this list has a non-empty value.
  7506. // This may be used to include null fields in Patch requests.
  7507. NullFields []string `json:"-"`
  7508. }
  7509. func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) {
  7510. type NoMethod MobileCarriersListResponse
  7511. raw := NoMethod(*s)
  7512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7513. }
  7514. // ObjectFilter: Object Filter.
  7515. type ObjectFilter struct {
  7516. // Kind: Identifies what kind of resource this is. Value: the fixed
  7517. // string "dfareporting#objectFilter".
  7518. Kind string `json:"kind,omitempty"`
  7519. // ObjectIds: Applicable when status is ASSIGNED. The user has access to
  7520. // objects with these object IDs.
  7521. ObjectIds googleapi.Int64s `json:"objectIds,omitempty"`
  7522. // Status: Status of the filter. NONE means the user has access to none
  7523. // of the objects. ALL means the user has access to all objects.
  7524. // ASSIGNED means the user has access to the objects with IDs in the
  7525. // objectIds list.
  7526. //
  7527. // Possible values:
  7528. // "ALL"
  7529. // "ASSIGNED"
  7530. // "NONE"
  7531. Status string `json:"status,omitempty"`
  7532. // ForceSendFields is a list of field names (e.g. "Kind") to
  7533. // unconditionally include in API requests. By default, fields with
  7534. // empty values are omitted from API requests. However, any non-pointer,
  7535. // non-interface field appearing in ForceSendFields will be sent to the
  7536. // server regardless of whether the field is empty or not. This may be
  7537. // used to include empty fields in Patch requests.
  7538. ForceSendFields []string `json:"-"`
  7539. // NullFields is a list of field names (e.g. "Kind") to include in API
  7540. // requests with the JSON null value. By default, fields with empty
  7541. // values are omitted from API requests. However, any field with an
  7542. // empty value appearing in NullFields will be sent to the server as
  7543. // null. It is an error if a field in this list has a non-empty value.
  7544. // This may be used to include null fields in Patch requests.
  7545. NullFields []string `json:"-"`
  7546. }
  7547. func (s *ObjectFilter) MarshalJSON() ([]byte, error) {
  7548. type NoMethod ObjectFilter
  7549. raw := NoMethod(*s)
  7550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7551. }
  7552. // OffsetPosition: Offset Position.
  7553. type OffsetPosition struct {
  7554. // Left: Offset distance from left side of an asset or a window.
  7555. Left int64 `json:"left,omitempty"`
  7556. // Top: Offset distance from top side of an asset or a window.
  7557. Top int64 `json:"top,omitempty"`
  7558. // ForceSendFields is a list of field names (e.g. "Left") to
  7559. // unconditionally include in API requests. By default, fields with
  7560. // empty values are omitted from API requests. However, any non-pointer,
  7561. // non-interface field appearing in ForceSendFields will be sent to the
  7562. // server regardless of whether the field is empty or not. This may be
  7563. // used to include empty fields in Patch requests.
  7564. ForceSendFields []string `json:"-"`
  7565. // NullFields is a list of field names (e.g. "Left") to include in API
  7566. // requests with the JSON null value. By default, fields with empty
  7567. // values are omitted from API requests. However, any field with an
  7568. // empty value appearing in NullFields will be sent to the server as
  7569. // null. It is an error if a field in this list has a non-empty value.
  7570. // This may be used to include null fields in Patch requests.
  7571. NullFields []string `json:"-"`
  7572. }
  7573. func (s *OffsetPosition) MarshalJSON() ([]byte, error) {
  7574. type NoMethod OffsetPosition
  7575. raw := NoMethod(*s)
  7576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7577. }
  7578. // OmnitureSettings: Omniture Integration Settings.
  7579. type OmnitureSettings struct {
  7580. // OmnitureCostDataEnabled: Whether placement cost data will be sent to
  7581. // Omniture. This property can be enabled only if
  7582. // omnitureIntegrationEnabled is true.
  7583. OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"`
  7584. // OmnitureIntegrationEnabled: Whether Omniture integration is enabled.
  7585. // This property can be enabled only when the "Advanced Ad Serving"
  7586. // account setting is enabled.
  7587. OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"`
  7588. // ForceSendFields is a list of field names (e.g.
  7589. // "OmnitureCostDataEnabled") to unconditionally include in API
  7590. // requests. By default, fields with empty values are omitted from API
  7591. // requests. However, any non-pointer, non-interface field appearing in
  7592. // ForceSendFields will be sent to the server regardless of whether the
  7593. // field is empty or not. This may be used to include empty fields in
  7594. // Patch requests.
  7595. ForceSendFields []string `json:"-"`
  7596. // NullFields is a list of field names (e.g. "OmnitureCostDataEnabled")
  7597. // to include in API requests with the JSON null value. By default,
  7598. // fields with empty values are omitted from API requests. However, any
  7599. // field with an empty value appearing in NullFields will be sent to the
  7600. // server as null. It is an error if a field in this list has a
  7601. // non-empty value. This may be used to include null fields in Patch
  7602. // requests.
  7603. NullFields []string `json:"-"`
  7604. }
  7605. func (s *OmnitureSettings) MarshalJSON() ([]byte, error) {
  7606. type NoMethod OmnitureSettings
  7607. raw := NoMethod(*s)
  7608. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7609. }
  7610. // OperatingSystem: Contains information about an operating system that
  7611. // can be targeted by ads.
  7612. type OperatingSystem struct {
  7613. // DartId: DART ID of this operating system. This is the ID used for
  7614. // targeting.
  7615. DartId int64 `json:"dartId,omitempty,string"`
  7616. // Desktop: Whether this operating system is for desktop.
  7617. Desktop bool `json:"desktop,omitempty"`
  7618. // Kind: Identifies what kind of resource this is. Value: the fixed
  7619. // string "dfareporting#operatingSystem".
  7620. Kind string `json:"kind,omitempty"`
  7621. // Mobile: Whether this operating system is for mobile.
  7622. Mobile bool `json:"mobile,omitempty"`
  7623. // Name: Name of this operating system.
  7624. Name string `json:"name,omitempty"`
  7625. // ServerResponse contains the HTTP response code and headers from the
  7626. // server.
  7627. googleapi.ServerResponse `json:"-"`
  7628. // ForceSendFields is a list of field names (e.g. "DartId") to
  7629. // unconditionally include in API requests. By default, fields with
  7630. // empty values are omitted from API requests. However, any non-pointer,
  7631. // non-interface field appearing in ForceSendFields will be sent to the
  7632. // server regardless of whether the field is empty or not. This may be
  7633. // used to include empty fields in Patch requests.
  7634. ForceSendFields []string `json:"-"`
  7635. // NullFields is a list of field names (e.g. "DartId") to include in API
  7636. // requests with the JSON null value. By default, fields with empty
  7637. // values are omitted from API requests. However, any field with an
  7638. // empty value appearing in NullFields will be sent to the server as
  7639. // null. It is an error if a field in this list has a non-empty value.
  7640. // This may be used to include null fields in Patch requests.
  7641. NullFields []string `json:"-"`
  7642. }
  7643. func (s *OperatingSystem) MarshalJSON() ([]byte, error) {
  7644. type NoMethod OperatingSystem
  7645. raw := NoMethod(*s)
  7646. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7647. }
  7648. // OperatingSystemVersion: Contains information about a particular
  7649. // version of an operating system that can be targeted by ads.
  7650. type OperatingSystemVersion struct {
  7651. // Id: ID of this operating system version.
  7652. Id int64 `json:"id,omitempty,string"`
  7653. // Kind: Identifies what kind of resource this is. Value: the fixed
  7654. // string "dfareporting#operatingSystemVersion".
  7655. Kind string `json:"kind,omitempty"`
  7656. // MajorVersion: Major version (leftmost number) of this operating
  7657. // system version.
  7658. MajorVersion string `json:"majorVersion,omitempty"`
  7659. // MinorVersion: Minor version (number after the first dot) of this
  7660. // operating system version.
  7661. MinorVersion string `json:"minorVersion,omitempty"`
  7662. // Name: Name of this operating system version.
  7663. Name string `json:"name,omitempty"`
  7664. // OperatingSystem: Operating system of this operating system version.
  7665. OperatingSystem *OperatingSystem `json:"operatingSystem,omitempty"`
  7666. // ServerResponse contains the HTTP response code and headers from the
  7667. // server.
  7668. googleapi.ServerResponse `json:"-"`
  7669. // ForceSendFields is a list of field names (e.g. "Id") to
  7670. // unconditionally include in API requests. By default, fields with
  7671. // empty values are omitted from API requests. However, any non-pointer,
  7672. // non-interface field appearing in ForceSendFields will be sent to the
  7673. // server regardless of whether the field is empty or not. This may be
  7674. // used to include empty fields in Patch requests.
  7675. ForceSendFields []string `json:"-"`
  7676. // NullFields is a list of field names (e.g. "Id") to include in API
  7677. // requests with the JSON null value. By default, fields with empty
  7678. // values are omitted from API requests. However, any field with an
  7679. // empty value appearing in NullFields will be sent to the server as
  7680. // null. It is an error if a field in this list has a non-empty value.
  7681. // This may be used to include null fields in Patch requests.
  7682. NullFields []string `json:"-"`
  7683. }
  7684. func (s *OperatingSystemVersion) MarshalJSON() ([]byte, error) {
  7685. type NoMethod OperatingSystemVersion
  7686. raw := NoMethod(*s)
  7687. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7688. }
  7689. // OperatingSystemVersionsListResponse: Operating System Version List
  7690. // Response
  7691. type OperatingSystemVersionsListResponse struct {
  7692. // Kind: Identifies what kind of resource this is. Value: the fixed
  7693. // string "dfareporting#operatingSystemVersionsListResponse".
  7694. Kind string `json:"kind,omitempty"`
  7695. // OperatingSystemVersions: Operating system version collection.
  7696. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  7697. // ServerResponse contains the HTTP response code and headers from the
  7698. // server.
  7699. googleapi.ServerResponse `json:"-"`
  7700. // ForceSendFields is a list of field names (e.g. "Kind") to
  7701. // unconditionally include in API requests. By default, fields with
  7702. // empty values are omitted from API requests. However, any non-pointer,
  7703. // non-interface field appearing in ForceSendFields will be sent to the
  7704. // server regardless of whether the field is empty or not. This may be
  7705. // used to include empty fields in Patch requests.
  7706. ForceSendFields []string `json:"-"`
  7707. // NullFields is a list of field names (e.g. "Kind") to include in API
  7708. // requests with the JSON null value. By default, fields with empty
  7709. // values are omitted from API requests. However, any field with an
  7710. // empty value appearing in NullFields will be sent to the server as
  7711. // null. It is an error if a field in this list has a non-empty value.
  7712. // This may be used to include null fields in Patch requests.
  7713. NullFields []string `json:"-"`
  7714. }
  7715. func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) {
  7716. type NoMethod OperatingSystemVersionsListResponse
  7717. raw := NoMethod(*s)
  7718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7719. }
  7720. // OperatingSystemsListResponse: Operating System List Response
  7721. type OperatingSystemsListResponse struct {
  7722. // Kind: Identifies what kind of resource this is. Value: the fixed
  7723. // string "dfareporting#operatingSystemsListResponse".
  7724. Kind string `json:"kind,omitempty"`
  7725. // OperatingSystems: Operating system collection.
  7726. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  7727. // ServerResponse contains the HTTP response code and headers from the
  7728. // server.
  7729. googleapi.ServerResponse `json:"-"`
  7730. // ForceSendFields is a list of field names (e.g. "Kind") to
  7731. // unconditionally include in API requests. By default, fields with
  7732. // empty values are omitted from API requests. However, any non-pointer,
  7733. // non-interface field appearing in ForceSendFields will be sent to the
  7734. // server regardless of whether the field is empty or not. This may be
  7735. // used to include empty fields in Patch requests.
  7736. ForceSendFields []string `json:"-"`
  7737. // NullFields is a list of field names (e.g. "Kind") to include in API
  7738. // requests with the JSON null value. By default, fields with empty
  7739. // values are omitted from API requests. However, any field with an
  7740. // empty value appearing in NullFields will be sent to the server as
  7741. // null. It is an error if a field in this list has a non-empty value.
  7742. // This may be used to include null fields in Patch requests.
  7743. NullFields []string `json:"-"`
  7744. }
  7745. func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) {
  7746. type NoMethod OperatingSystemsListResponse
  7747. raw := NoMethod(*s)
  7748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7749. }
  7750. // OptimizationActivity: Creative optimization activity.
  7751. type OptimizationActivity struct {
  7752. // FloodlightActivityId: Floodlight activity ID of this optimization
  7753. // activity. This is a required field.
  7754. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7755. // FloodlightActivityIdDimensionValue: Dimension value for the ID of the
  7756. // floodlight activity. This is a read-only, auto-generated field.
  7757. FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"`
  7758. // Weight: Weight associated with this optimization. The weight assigned
  7759. // will be understood in proportion to the weights assigned to the other
  7760. // optimization activities. Value must be greater than or equal to 1.
  7761. Weight int64 `json:"weight,omitempty"`
  7762. // ForceSendFields is a list of field names (e.g.
  7763. // "FloodlightActivityId") to unconditionally include in API requests.
  7764. // By default, fields with empty values are omitted from API requests.
  7765. // However, any non-pointer, non-interface field appearing in
  7766. // ForceSendFields will be sent to the server regardless of whether the
  7767. // field is empty or not. This may be used to include empty fields in
  7768. // Patch requests.
  7769. ForceSendFields []string `json:"-"`
  7770. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7771. // include in API requests with the JSON null value. By default, fields
  7772. // with empty values are omitted from API requests. However, any field
  7773. // with an empty value appearing in NullFields will be sent to the
  7774. // server as null. It is an error if a field in this list has a
  7775. // non-empty value. This may be used to include null fields in Patch
  7776. // requests.
  7777. NullFields []string `json:"-"`
  7778. }
  7779. func (s *OptimizationActivity) MarshalJSON() ([]byte, error) {
  7780. type NoMethod OptimizationActivity
  7781. raw := NoMethod(*s)
  7782. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7783. }
  7784. // Order: Describes properties of a DoubleClick Planning order.
  7785. type Order struct {
  7786. // AccountId: Account ID of this order.
  7787. AccountId int64 `json:"accountId,omitempty,string"`
  7788. // AdvertiserId: Advertiser ID of this order.
  7789. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7790. // ApproverUserProfileIds: IDs for users that have to approve documents
  7791. // created for this order.
  7792. ApproverUserProfileIds googleapi.Int64s `json:"approverUserProfileIds,omitempty"`
  7793. // BuyerInvoiceId: Buyer invoice ID associated with this order.
  7794. BuyerInvoiceId string `json:"buyerInvoiceId,omitempty"`
  7795. // BuyerOrganizationName: Name of the buyer organization.
  7796. BuyerOrganizationName string `json:"buyerOrganizationName,omitempty"`
  7797. // Comments: Comments in this order.
  7798. Comments string `json:"comments,omitempty"`
  7799. // Contacts: Contacts for this order.
  7800. Contacts []*OrderContact `json:"contacts,omitempty"`
  7801. // Id: ID of this order. This is a read-only, auto-generated field.
  7802. Id int64 `json:"id,omitempty,string"`
  7803. // Kind: Identifies what kind of resource this is. Value: the fixed
  7804. // string "dfareporting#order".
  7805. Kind string `json:"kind,omitempty"`
  7806. // LastModifiedInfo: Information about the most recent modification of
  7807. // this order.
  7808. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  7809. // Name: Name of this order.
  7810. Name string `json:"name,omitempty"`
  7811. // Notes: Notes of this order.
  7812. Notes string `json:"notes,omitempty"`
  7813. // PlanningTermId: ID of the terms and conditions template used in this
  7814. // order.
  7815. PlanningTermId int64 `json:"planningTermId,omitempty,string"`
  7816. // ProjectId: Project ID of this order.
  7817. ProjectId int64 `json:"projectId,omitempty,string"`
  7818. // SellerOrderId: Seller order ID associated with this order.
  7819. SellerOrderId string `json:"sellerOrderId,omitempty"`
  7820. // SellerOrganizationName: Name of the seller organization.
  7821. SellerOrganizationName string `json:"sellerOrganizationName,omitempty"`
  7822. // SiteId: Site IDs this order is associated with.
  7823. SiteId googleapi.Int64s `json:"siteId,omitempty"`
  7824. // SiteNames: Free-form site names this order is associated with.
  7825. SiteNames []string `json:"siteNames,omitempty"`
  7826. // SubaccountId: Subaccount ID of this order.
  7827. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7828. // TermsAndConditions: Terms and conditions of this order.
  7829. TermsAndConditions string `json:"termsAndConditions,omitempty"`
  7830. // ServerResponse contains the HTTP response code and headers from the
  7831. // server.
  7832. googleapi.ServerResponse `json:"-"`
  7833. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7834. // unconditionally include in API requests. By default, fields with
  7835. // empty values are omitted from API requests. However, any non-pointer,
  7836. // non-interface field appearing in ForceSendFields will be sent to the
  7837. // server regardless of whether the field is empty or not. This may be
  7838. // used to include empty fields in Patch requests.
  7839. ForceSendFields []string `json:"-"`
  7840. // NullFields is a list of field names (e.g. "AccountId") to include in
  7841. // API requests with the JSON null value. By default, fields with empty
  7842. // values are omitted from API requests. However, any field with an
  7843. // empty value appearing in NullFields will be sent to the server as
  7844. // null. It is an error if a field in this list has a non-empty value.
  7845. // This may be used to include null fields in Patch requests.
  7846. NullFields []string `json:"-"`
  7847. }
  7848. func (s *Order) MarshalJSON() ([]byte, error) {
  7849. type NoMethod Order
  7850. raw := NoMethod(*s)
  7851. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7852. }
  7853. // OrderContact: Contact of an order.
  7854. type OrderContact struct {
  7855. // ContactInfo: Free-form information about this contact. It could be
  7856. // any information related to this contact in addition to type, title,
  7857. // name, and signature user profile ID.
  7858. ContactInfo string `json:"contactInfo,omitempty"`
  7859. // ContactName: Name of this contact.
  7860. ContactName string `json:"contactName,omitempty"`
  7861. // ContactTitle: Title of this contact.
  7862. ContactTitle string `json:"contactTitle,omitempty"`
  7863. // ContactType: Type of this contact.
  7864. //
  7865. // Possible values:
  7866. // "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT"
  7867. // "PLANNING_ORDER_CONTACT_BUYER_CONTACT"
  7868. // "PLANNING_ORDER_CONTACT_SELLER_CONTACT"
  7869. ContactType string `json:"contactType,omitempty"`
  7870. // SignatureUserProfileId: ID of the user profile containing the
  7871. // signature that will be embedded into order documents.
  7872. SignatureUserProfileId int64 `json:"signatureUserProfileId,omitempty,string"`
  7873. // ForceSendFields is a list of field names (e.g. "ContactInfo") to
  7874. // unconditionally include in API requests. By default, fields with
  7875. // empty values are omitted from API requests. However, any non-pointer,
  7876. // non-interface field appearing in ForceSendFields will be sent to the
  7877. // server regardless of whether the field is empty or not. This may be
  7878. // used to include empty fields in Patch requests.
  7879. ForceSendFields []string `json:"-"`
  7880. // NullFields is a list of field names (e.g. "ContactInfo") to include
  7881. // in API requests with the JSON null value. By default, fields with
  7882. // empty values are omitted from API requests. However, any field with
  7883. // an empty value appearing in NullFields will be sent to the server as
  7884. // null. It is an error if a field in this list has a non-empty value.
  7885. // This may be used to include null fields in Patch requests.
  7886. NullFields []string `json:"-"`
  7887. }
  7888. func (s *OrderContact) MarshalJSON() ([]byte, error) {
  7889. type NoMethod OrderContact
  7890. raw := NoMethod(*s)
  7891. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7892. }
  7893. // OrderDocument: Contains properties of a DoubleClick Planning order
  7894. // document.
  7895. type OrderDocument struct {
  7896. // AccountId: Account ID of this order document.
  7897. AccountId int64 `json:"accountId,omitempty,string"`
  7898. // AdvertiserId: Advertiser ID of this order document.
  7899. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7900. // AmendedOrderDocumentId: The amended order document ID of this order
  7901. // document. An order document can be created by optionally amending
  7902. // another order document so that the change history can be preserved.
  7903. AmendedOrderDocumentId int64 `json:"amendedOrderDocumentId,omitempty,string"`
  7904. // ApprovedByUserProfileIds: IDs of users who have approved this order
  7905. // document.
  7906. ApprovedByUserProfileIds googleapi.Int64s `json:"approvedByUserProfileIds,omitempty"`
  7907. // Cancelled: Whether this order document is cancelled.
  7908. Cancelled bool `json:"cancelled,omitempty"`
  7909. // CreatedInfo: Information about the creation of this order document.
  7910. CreatedInfo *LastModifiedInfo `json:"createdInfo,omitempty"`
  7911. // EffectiveDate: Effective date of this order document.
  7912. EffectiveDate string `json:"effectiveDate,omitempty"`
  7913. // Id: ID of this order document.
  7914. Id int64 `json:"id,omitempty,string"`
  7915. // Kind: Identifies what kind of resource this is. Value: the fixed
  7916. // string "dfareporting#orderDocument".
  7917. Kind string `json:"kind,omitempty"`
  7918. // LastSentRecipients: List of email addresses that received the last
  7919. // sent document.
  7920. LastSentRecipients []string `json:"lastSentRecipients,omitempty"`
  7921. // LastSentTime: Timestamp of the last email sent with this order
  7922. // document.
  7923. LastSentTime string `json:"lastSentTime,omitempty"`
  7924. // OrderId: ID of the order from which this order document is created.
  7925. OrderId int64 `json:"orderId,omitempty,string"`
  7926. // ProjectId: Project ID of this order document.
  7927. ProjectId int64 `json:"projectId,omitempty,string"`
  7928. // Signed: Whether this order document has been signed.
  7929. Signed bool `json:"signed,omitempty"`
  7930. // SubaccountId: Subaccount ID of this order document.
  7931. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7932. // Title: Title of this order document.
  7933. Title string `json:"title,omitempty"`
  7934. // Type: Type of this order document
  7935. //
  7936. // Possible values:
  7937. // "PLANNING_ORDER_TYPE_CHANGE_ORDER"
  7938. // "PLANNING_ORDER_TYPE_INSERTION_ORDER"
  7939. Type string `json:"type,omitempty"`
  7940. // ServerResponse contains the HTTP response code and headers from the
  7941. // server.
  7942. googleapi.ServerResponse `json:"-"`
  7943. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7944. // unconditionally include in API requests. By default, fields with
  7945. // empty values are omitted from API requests. However, any non-pointer,
  7946. // non-interface field appearing in ForceSendFields will be sent to the
  7947. // server regardless of whether the field is empty or not. This may be
  7948. // used to include empty fields in Patch requests.
  7949. ForceSendFields []string `json:"-"`
  7950. // NullFields is a list of field names (e.g. "AccountId") to include in
  7951. // API requests with the JSON null value. By default, fields with empty
  7952. // values are omitted from API requests. However, any field with an
  7953. // empty value appearing in NullFields will be sent to the server as
  7954. // null. It is an error if a field in this list has a non-empty value.
  7955. // This may be used to include null fields in Patch requests.
  7956. NullFields []string `json:"-"`
  7957. }
  7958. func (s *OrderDocument) MarshalJSON() ([]byte, error) {
  7959. type NoMethod OrderDocument
  7960. raw := NoMethod(*s)
  7961. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7962. }
  7963. // OrderDocumentsListResponse: Order document List Response
  7964. type OrderDocumentsListResponse struct {
  7965. // Kind: Identifies what kind of resource this is. Value: the fixed
  7966. // string "dfareporting#orderDocumentsListResponse".
  7967. Kind string `json:"kind,omitempty"`
  7968. // NextPageToken: Pagination token to be used for the next list
  7969. // operation.
  7970. NextPageToken string `json:"nextPageToken,omitempty"`
  7971. // OrderDocuments: Order document collection
  7972. OrderDocuments []*OrderDocument `json:"orderDocuments,omitempty"`
  7973. // ServerResponse contains the HTTP response code and headers from the
  7974. // server.
  7975. googleapi.ServerResponse `json:"-"`
  7976. // ForceSendFields is a list of field names (e.g. "Kind") to
  7977. // unconditionally include in API requests. By default, fields with
  7978. // empty values are omitted from API requests. However, any non-pointer,
  7979. // non-interface field appearing in ForceSendFields will be sent to the
  7980. // server regardless of whether the field is empty or not. This may be
  7981. // used to include empty fields in Patch requests.
  7982. ForceSendFields []string `json:"-"`
  7983. // NullFields is a list of field names (e.g. "Kind") to include in API
  7984. // requests with the JSON null value. By default, fields with empty
  7985. // values are omitted from API requests. However, any field with an
  7986. // empty value appearing in NullFields will be sent to the server as
  7987. // null. It is an error if a field in this list has a non-empty value.
  7988. // This may be used to include null fields in Patch requests.
  7989. NullFields []string `json:"-"`
  7990. }
  7991. func (s *OrderDocumentsListResponse) MarshalJSON() ([]byte, error) {
  7992. type NoMethod OrderDocumentsListResponse
  7993. raw := NoMethod(*s)
  7994. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7995. }
  7996. // OrdersListResponse: Order List Response
  7997. type OrdersListResponse struct {
  7998. // Kind: Identifies what kind of resource this is. Value: the fixed
  7999. // string "dfareporting#ordersListResponse".
  8000. Kind string `json:"kind,omitempty"`
  8001. // NextPageToken: Pagination token to be used for the next list
  8002. // operation.
  8003. NextPageToken string `json:"nextPageToken,omitempty"`
  8004. // Orders: Order collection.
  8005. Orders []*Order `json:"orders,omitempty"`
  8006. // ServerResponse contains the HTTP response code and headers from the
  8007. // server.
  8008. googleapi.ServerResponse `json:"-"`
  8009. // ForceSendFields is a list of field names (e.g. "Kind") to
  8010. // unconditionally include in API requests. By default, fields with
  8011. // empty values are omitted from API requests. However, any non-pointer,
  8012. // non-interface field appearing in ForceSendFields will be sent to the
  8013. // server regardless of whether the field is empty or not. This may be
  8014. // used to include empty fields in Patch requests.
  8015. ForceSendFields []string `json:"-"`
  8016. // NullFields is a list of field names (e.g. "Kind") to include in API
  8017. // requests with the JSON null value. By default, fields with empty
  8018. // values are omitted from API requests. However, any field with an
  8019. // empty value appearing in NullFields will be sent to the server as
  8020. // null. It is an error if a field in this list has a non-empty value.
  8021. // This may be used to include null fields in Patch requests.
  8022. NullFields []string `json:"-"`
  8023. }
  8024. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  8025. type NoMethod OrdersListResponse
  8026. raw := NoMethod(*s)
  8027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8028. }
  8029. // PathToConversionReportCompatibleFields: Represents fields that are
  8030. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  8031. type PathToConversionReportCompatibleFields struct {
  8032. // ConversionDimensions: Conversion dimensions which are compatible to
  8033. // be selected in the "conversionDimensions" section of the report.
  8034. ConversionDimensions []*Dimension `json:"conversionDimensions,omitempty"`
  8035. // CustomFloodlightVariables: Custom floodlight variables which are
  8036. // compatible to be selected in the "customFloodlightVariables" section
  8037. // of the report.
  8038. CustomFloodlightVariables []*Dimension `json:"customFloodlightVariables,omitempty"`
  8039. // Kind: The kind of resource this is, in this case
  8040. // dfareporting#pathToConversionReportCompatibleFields.
  8041. Kind string `json:"kind,omitempty"`
  8042. // Metrics: Metrics which are compatible to be selected in the
  8043. // "metricNames" section of the report.
  8044. Metrics []*Metric `json:"metrics,omitempty"`
  8045. // PerInteractionDimensions: Per-interaction dimensions which are
  8046. // compatible to be selected in the "perInteractionDimensions" section
  8047. // of the report.
  8048. PerInteractionDimensions []*Dimension `json:"perInteractionDimensions,omitempty"`
  8049. // ForceSendFields is a list of field names (e.g.
  8050. // "ConversionDimensions") to unconditionally include in API requests.
  8051. // By default, fields with empty values are omitted from API requests.
  8052. // However, any non-pointer, non-interface field appearing in
  8053. // ForceSendFields will be sent to the server regardless of whether the
  8054. // field is empty or not. This may be used to include empty fields in
  8055. // Patch requests.
  8056. ForceSendFields []string `json:"-"`
  8057. // NullFields is a list of field names (e.g. "ConversionDimensions") to
  8058. // include in API requests with the JSON null value. By default, fields
  8059. // with empty values are omitted from API requests. However, any field
  8060. // with an empty value appearing in NullFields will be sent to the
  8061. // server as null. It is an error if a field in this list has a
  8062. // non-empty value. This may be used to include null fields in Patch
  8063. // requests.
  8064. NullFields []string `json:"-"`
  8065. }
  8066. func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) {
  8067. type NoMethod PathToConversionReportCompatibleFields
  8068. raw := NoMethod(*s)
  8069. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8070. }
  8071. // Placement: Contains properties of a placement.
  8072. type Placement struct {
  8073. // AccountId: Account ID of this placement. This field can be left
  8074. // blank.
  8075. AccountId int64 `json:"accountId,omitempty,string"`
  8076. // AdBlockingOptOut: Whether this placement opts out of ad blocking.
  8077. // When true, ad blocking is disabled for this placement. When false,
  8078. // the campaign and site settings take effect.
  8079. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  8080. // AdvertiserId: Advertiser ID of this placement. This field can be left
  8081. // blank.
  8082. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8083. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8084. // advertiser. This is a read-only, auto-generated field.
  8085. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8086. // Archived: Whether this placement is archived.
  8087. Archived bool `json:"archived,omitempty"`
  8088. // CampaignId: Campaign ID of this placement. This field is a required
  8089. // field on insertion.
  8090. CampaignId int64 `json:"campaignId,omitempty,string"`
  8091. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8092. // This is a read-only, auto-generated field.
  8093. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8094. // Comment: Comments for this placement.
  8095. Comment string `json:"comment,omitempty"`
  8096. // Compatibility: Placement compatibility. DISPLAY and
  8097. // DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices
  8098. // or in mobile apps for regular or interstitial ads respectively. APP
  8099. // and APP_INTERSTITIAL are no longer allowed for new placement
  8100. // insertions. Instead, use DISPLAY or DISPLAY_INTERSTITIAL.
  8101. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  8102. // with the VAST standard. This field is required on insertion.
  8103. //
  8104. // Possible values:
  8105. // "APP"
  8106. // "APP_INTERSTITIAL"
  8107. // "DISPLAY"
  8108. // "DISPLAY_INTERSTITIAL"
  8109. // "IN_STREAM_AUDIO"
  8110. // "IN_STREAM_VIDEO"
  8111. Compatibility string `json:"compatibility,omitempty"`
  8112. // ContentCategoryId: ID of the content category assigned to this
  8113. // placement.
  8114. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8115. // CreateInfo: Information about the creation of this placement. This is
  8116. // a read-only field.
  8117. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8118. // DirectorySiteId: Directory site ID of this placement. On insert, you
  8119. // must set either this field or the siteId field to specify the site
  8120. // associated with this placement. This is a required field that is
  8121. // read-only after insertion.
  8122. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8123. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8124. // directory site. This is a read-only, auto-generated field.
  8125. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8126. // ExternalId: External ID for this placement.
  8127. ExternalId string `json:"externalId,omitempty"`
  8128. // Id: ID of this placement. This is a read-only, auto-generated field.
  8129. Id int64 `json:"id,omitempty,string"`
  8130. // IdDimensionValue: Dimension value for the ID of this placement. This
  8131. // is a read-only, auto-generated field.
  8132. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8133. // KeyName: Key name of this placement. This is a read-only,
  8134. // auto-generated field.
  8135. KeyName string `json:"keyName,omitempty"`
  8136. // Kind: Identifies what kind of resource this is. Value: the fixed
  8137. // string "dfareporting#placement".
  8138. Kind string `json:"kind,omitempty"`
  8139. // LastModifiedInfo: Information about the most recent modification of
  8140. // this placement. This is a read-only field.
  8141. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8142. // LookbackConfiguration: Lookback window settings for this placement.
  8143. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  8144. // Name: Name of this placement.This is a required field and must be
  8145. // less than 256 characters long.
  8146. Name string `json:"name,omitempty"`
  8147. // PaymentApproved: Whether payment was approved for this placement.
  8148. // This is a read-only field relevant only to publisher-paid placements.
  8149. PaymentApproved bool `json:"paymentApproved,omitempty"`
  8150. // PaymentSource: Payment source for this placement. This is a required
  8151. // field that is read-only after insertion.
  8152. //
  8153. // Possible values:
  8154. // "PLACEMENT_AGENCY_PAID"
  8155. // "PLACEMENT_PUBLISHER_PAID"
  8156. PaymentSource string `json:"paymentSource,omitempty"`
  8157. // PlacementGroupId: ID of this placement's group, if applicable.
  8158. PlacementGroupId int64 `json:"placementGroupId,omitempty,string"`
  8159. // PlacementGroupIdDimensionValue: Dimension value for the ID of the
  8160. // placement group. This is a read-only, auto-generated field.
  8161. PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"`
  8162. // PlacementStrategyId: ID of the placement strategy assigned to this
  8163. // placement.
  8164. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8165. // PricingSchedule: Pricing schedule of this placement. This field is
  8166. // required on insertion, specifically subfields startDate, endDate and
  8167. // pricingType.
  8168. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8169. // Primary: Whether this placement is the primary placement of a
  8170. // roadblock (placement group). You cannot change this field from true
  8171. // to false. Setting this field to true will automatically set the
  8172. // primary field on the original primary placement of the roadblock to
  8173. // false, and it will automatically set the roadblock's
  8174. // primaryPlacementId field to the ID of this placement.
  8175. Primary bool `json:"primary,omitempty"`
  8176. // PublisherUpdateInfo: Information about the last publisher update.
  8177. // This is a read-only field.
  8178. PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"`
  8179. // SiteId: Site ID associated with this placement. On insert, you must
  8180. // set either this field or the directorySiteId field to specify the
  8181. // site associated with this placement. This is a required field that is
  8182. // read-only after insertion.
  8183. SiteId int64 `json:"siteId,omitempty,string"`
  8184. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8185. // a read-only, auto-generated field.
  8186. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8187. // Size: Size associated with this placement. When inserting or updating
  8188. // a placement, only the size ID field is used. This field is required
  8189. // on insertion.
  8190. Size *Size `json:"size,omitempty"`
  8191. // SslRequired: Whether creatives assigned to this placement must be
  8192. // SSL-compliant.
  8193. SslRequired bool `json:"sslRequired,omitempty"`
  8194. // Status: Third-party placement status.
  8195. //
  8196. // Possible values:
  8197. // "ACKNOWLEDGE_ACCEPTANCE"
  8198. // "ACKNOWLEDGE_REJECTION"
  8199. // "DRAFT"
  8200. // "PAYMENT_ACCEPTED"
  8201. // "PAYMENT_REJECTED"
  8202. // "PENDING_REVIEW"
  8203. Status string `json:"status,omitempty"`
  8204. // SubaccountId: Subaccount ID of this placement. This field can be left
  8205. // blank.
  8206. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8207. // TagFormats: Tag formats to generate for this placement. This field is
  8208. // required on insertion.
  8209. // Acceptable values are:
  8210. // - "PLACEMENT_TAG_STANDARD"
  8211. // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8212. // - "PLACEMENT_TAG_IFRAME_ILAYER"
  8213. // - "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8214. // - "PLACEMENT_TAG_JAVASCRIPT"
  8215. // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8216. // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8217. // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8218. // - "PLACEMENT_TAG_CLICK_COMMANDS"
  8219. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8220. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8221. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8222. // - "PLACEMENT_TAG_TRACKING"
  8223. // - "PLACEMENT_TAG_TRACKING_IFRAME"
  8224. // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8225. //
  8226. // Possible values:
  8227. // "PLACEMENT_TAG_CLICK_COMMANDS"
  8228. // "PLACEMENT_TAG_IFRAME_ILAYER"
  8229. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8230. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  8231. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8232. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8233. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8234. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8235. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8236. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  8237. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8238. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8239. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  8240. // "PLACEMENT_TAG_JAVASCRIPT"
  8241. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  8242. // "PLACEMENT_TAG_STANDARD"
  8243. // "PLACEMENT_TAG_TRACKING"
  8244. // "PLACEMENT_TAG_TRACKING_IFRAME"
  8245. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8246. TagFormats []string `json:"tagFormats,omitempty"`
  8247. // TagSetting: Tag settings for this placement.
  8248. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  8249. // VideoActiveViewOptOut: Whether Verification and ActiveView are
  8250. // disabled for in-stream video creatives for this placement. The same
  8251. // setting videoActiveViewOptOut exists on the site level -- the opt out
  8252. // occurs if either of these settings are true. These settings are
  8253. // distinct from DirectorySites.settings.activeViewOptOut or
  8254. // Sites.siteSettings.activeViewOptOut which only apply to display ads.
  8255. // However, Accounts.activeViewOptOut opts out both video traffic, as
  8256. // well as display ads, from Verification and ActiveView.
  8257. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  8258. // VideoSettings: A collection of settings which affect video creatives
  8259. // served through this placement. Applicable to placements with
  8260. // IN_STREAM_VIDEO compatibility.
  8261. VideoSettings *VideoSettings `json:"videoSettings,omitempty"`
  8262. // VpaidAdapterChoice: VPAID adapter setting for this placement.
  8263. // Controls which VPAID format the measurement adapter will use for
  8264. // in-stream video creatives assigned to this placement.
  8265. //
  8266. // Note: Flash is no longer supported. This field now defaults to HTML5
  8267. // when the following values are provided: FLASH, BOTH.
  8268. //
  8269. // Possible values:
  8270. // "BOTH"
  8271. // "DEFAULT"
  8272. // "FLASH"
  8273. // "HTML5"
  8274. VpaidAdapterChoice string `json:"vpaidAdapterChoice,omitempty"`
  8275. // ServerResponse contains the HTTP response code and headers from the
  8276. // server.
  8277. googleapi.ServerResponse `json:"-"`
  8278. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8279. // unconditionally include in API requests. By default, fields with
  8280. // empty values are omitted from API requests. However, any non-pointer,
  8281. // non-interface field appearing in ForceSendFields will be sent to the
  8282. // server regardless of whether the field is empty or not. This may be
  8283. // used to include empty fields in Patch requests.
  8284. ForceSendFields []string `json:"-"`
  8285. // NullFields is a list of field names (e.g. "AccountId") to include in
  8286. // API requests with the JSON null value. By default, fields with empty
  8287. // values are omitted from API requests. However, any field with an
  8288. // empty value appearing in NullFields will be sent to the server as
  8289. // null. It is an error if a field in this list has a non-empty value.
  8290. // This may be used to include null fields in Patch requests.
  8291. NullFields []string `json:"-"`
  8292. }
  8293. func (s *Placement) MarshalJSON() ([]byte, error) {
  8294. type NoMethod Placement
  8295. raw := NoMethod(*s)
  8296. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8297. }
  8298. // PlacementAssignment: Placement Assignment.
  8299. type PlacementAssignment struct {
  8300. // Active: Whether this placement assignment is active. When true, the
  8301. // placement will be included in the ad's rotation.
  8302. Active bool `json:"active,omitempty"`
  8303. // PlacementId: ID of the placement to be assigned. This is a required
  8304. // field.
  8305. PlacementId int64 `json:"placementId,omitempty,string"`
  8306. // PlacementIdDimensionValue: Dimension value for the ID of the
  8307. // placement. This is a read-only, auto-generated field.
  8308. PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"`
  8309. // SslRequired: Whether the placement to be assigned requires SSL. This
  8310. // is a read-only field that is auto-generated when the ad is inserted
  8311. // or updated.
  8312. SslRequired bool `json:"sslRequired,omitempty"`
  8313. // ForceSendFields is a list of field names (e.g. "Active") to
  8314. // unconditionally include in API requests. By default, fields with
  8315. // empty values are omitted from API requests. However, any non-pointer,
  8316. // non-interface field appearing in ForceSendFields will be sent to the
  8317. // server regardless of whether the field is empty or not. This may be
  8318. // used to include empty fields in Patch requests.
  8319. ForceSendFields []string `json:"-"`
  8320. // NullFields is a list of field names (e.g. "Active") to include in API
  8321. // requests with the JSON null value. By default, fields with empty
  8322. // values are omitted from API requests. However, any field with an
  8323. // empty value appearing in NullFields will be sent to the server as
  8324. // null. It is an error if a field in this list has a non-empty value.
  8325. // This may be used to include null fields in Patch requests.
  8326. NullFields []string `json:"-"`
  8327. }
  8328. func (s *PlacementAssignment) MarshalJSON() ([]byte, error) {
  8329. type NoMethod PlacementAssignment
  8330. raw := NoMethod(*s)
  8331. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8332. }
  8333. // PlacementGroup: Contains properties of a package or roadblock.
  8334. type PlacementGroup struct {
  8335. // AccountId: Account ID of this placement group. This is a read-only
  8336. // field that can be left blank.
  8337. AccountId int64 `json:"accountId,omitempty,string"`
  8338. // AdvertiserId: Advertiser ID of this placement group. This is a
  8339. // required field on insertion.
  8340. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8341. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8342. // advertiser. This is a read-only, auto-generated field.
  8343. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8344. // Archived: Whether this placement group is archived.
  8345. Archived bool `json:"archived,omitempty"`
  8346. // CampaignId: Campaign ID of this placement group. This field is
  8347. // required on insertion.
  8348. CampaignId int64 `json:"campaignId,omitempty,string"`
  8349. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8350. // This is a read-only, auto-generated field.
  8351. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8352. // ChildPlacementIds: IDs of placements which are assigned to this
  8353. // placement group. This is a read-only, auto-generated field.
  8354. ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"`
  8355. // Comment: Comments for this placement group.
  8356. Comment string `json:"comment,omitempty"`
  8357. // ContentCategoryId: ID of the content category assigned to this
  8358. // placement group.
  8359. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8360. // CreateInfo: Information about the creation of this placement group.
  8361. // This is a read-only field.
  8362. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8363. // DirectorySiteId: Directory site ID associated with this placement
  8364. // group. On insert, you must set either this field or the site_id field
  8365. // to specify the site associated with this placement group. This is a
  8366. // required field that is read-only after insertion.
  8367. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8368. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8369. // directory site. This is a read-only, auto-generated field.
  8370. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8371. // ExternalId: External ID for this placement.
  8372. ExternalId string `json:"externalId,omitempty"`
  8373. // Id: ID of this placement group. This is a read-only, auto-generated
  8374. // field.
  8375. Id int64 `json:"id,omitempty,string"`
  8376. // IdDimensionValue: Dimension value for the ID of this placement group.
  8377. // This is a read-only, auto-generated field.
  8378. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8379. // Kind: Identifies what kind of resource this is. Value: the fixed
  8380. // string "dfareporting#placementGroup".
  8381. Kind string `json:"kind,omitempty"`
  8382. // LastModifiedInfo: Information about the most recent modification of
  8383. // this placement group. This is a read-only field.
  8384. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8385. // Name: Name of this placement group. This is a required field and must
  8386. // be less than 256 characters long.
  8387. Name string `json:"name,omitempty"`
  8388. // PlacementGroupType: Type of this placement group. A package is a
  8389. // simple group of placements that acts as a single pricing point for a
  8390. // group of tags. A roadblock is a group of placements that not only
  8391. // acts as a single pricing point, but also assumes that all the tags in
  8392. // it will be served at the same time. A roadblock requires one of its
  8393. // assigned placements to be marked as primary for reporting. This field
  8394. // is required on insertion.
  8395. //
  8396. // Possible values:
  8397. // "PLACEMENT_PACKAGE"
  8398. // "PLACEMENT_ROADBLOCK"
  8399. PlacementGroupType string `json:"placementGroupType,omitempty"`
  8400. // PlacementStrategyId: ID of the placement strategy assigned to this
  8401. // placement group.
  8402. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8403. // PricingSchedule: Pricing schedule of this placement group. This field
  8404. // is required on insertion.
  8405. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8406. // PrimaryPlacementId: ID of the primary placement, used to calculate
  8407. // the media cost of a roadblock (placement group). Modifying this field
  8408. // will automatically modify the primary field on all affected roadblock
  8409. // child placements.
  8410. PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"`
  8411. // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the
  8412. // primary placement. This is a read-only, auto-generated field.
  8413. PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"`
  8414. // SiteId: Site ID associated with this placement group. On insert, you
  8415. // must set either this field or the directorySiteId field to specify
  8416. // the site associated with this placement group. This is a required
  8417. // field that is read-only after insertion.
  8418. SiteId int64 `json:"siteId,omitempty,string"`
  8419. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8420. // a read-only, auto-generated field.
  8421. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8422. // SubaccountId: Subaccount ID of this placement group. This is a
  8423. // read-only field that can be left blank.
  8424. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8425. // ServerResponse contains the HTTP response code and headers from the
  8426. // server.
  8427. googleapi.ServerResponse `json:"-"`
  8428. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8429. // unconditionally include in API requests. By default, fields with
  8430. // empty values are omitted from API requests. However, any non-pointer,
  8431. // non-interface field appearing in ForceSendFields will be sent to the
  8432. // server regardless of whether the field is empty or not. This may be
  8433. // used to include empty fields in Patch requests.
  8434. ForceSendFields []string `json:"-"`
  8435. // NullFields is a list of field names (e.g. "AccountId") to include in
  8436. // API requests with the JSON null value. By default, fields with empty
  8437. // values are omitted from API requests. However, any field with an
  8438. // empty value appearing in NullFields will be sent to the server as
  8439. // null. It is an error if a field in this list has a non-empty value.
  8440. // This may be used to include null fields in Patch requests.
  8441. NullFields []string `json:"-"`
  8442. }
  8443. func (s *PlacementGroup) MarshalJSON() ([]byte, error) {
  8444. type NoMethod PlacementGroup
  8445. raw := NoMethod(*s)
  8446. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8447. }
  8448. // PlacementGroupsListResponse: Placement Group List Response
  8449. type PlacementGroupsListResponse struct {
  8450. // Kind: Identifies what kind of resource this is. Value: the fixed
  8451. // string "dfareporting#placementGroupsListResponse".
  8452. Kind string `json:"kind,omitempty"`
  8453. // NextPageToken: Pagination token to be used for the next list
  8454. // operation.
  8455. NextPageToken string `json:"nextPageToken,omitempty"`
  8456. // PlacementGroups: Placement group collection.
  8457. PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"`
  8458. // ServerResponse contains the HTTP response code and headers from the
  8459. // server.
  8460. googleapi.ServerResponse `json:"-"`
  8461. // ForceSendFields is a list of field names (e.g. "Kind") to
  8462. // unconditionally include in API requests. By default, fields with
  8463. // empty values are omitted from API requests. However, any non-pointer,
  8464. // non-interface field appearing in ForceSendFields will be sent to the
  8465. // server regardless of whether the field is empty or not. This may be
  8466. // used to include empty fields in Patch requests.
  8467. ForceSendFields []string `json:"-"`
  8468. // NullFields is a list of field names (e.g. "Kind") to include in API
  8469. // requests with the JSON null value. By default, fields with empty
  8470. // values are omitted from API requests. However, any field with an
  8471. // empty value appearing in NullFields will be sent to the server as
  8472. // null. It is an error if a field in this list has a non-empty value.
  8473. // This may be used to include null fields in Patch requests.
  8474. NullFields []string `json:"-"`
  8475. }
  8476. func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) {
  8477. type NoMethod PlacementGroupsListResponse
  8478. raw := NoMethod(*s)
  8479. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8480. }
  8481. // PlacementStrategiesListResponse: Placement Strategy List Response
  8482. type PlacementStrategiesListResponse struct {
  8483. // Kind: Identifies what kind of resource this is. Value: the fixed
  8484. // string "dfareporting#placementStrategiesListResponse".
  8485. Kind string `json:"kind,omitempty"`
  8486. // NextPageToken: Pagination token to be used for the next list
  8487. // operation.
  8488. NextPageToken string `json:"nextPageToken,omitempty"`
  8489. // PlacementStrategies: Placement strategy collection.
  8490. PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"`
  8491. // ServerResponse contains the HTTP response code and headers from the
  8492. // server.
  8493. googleapi.ServerResponse `json:"-"`
  8494. // ForceSendFields is a list of field names (e.g. "Kind") to
  8495. // unconditionally include in API requests. By default, fields with
  8496. // empty values are omitted from API requests. However, any non-pointer,
  8497. // non-interface field appearing in ForceSendFields will be sent to the
  8498. // server regardless of whether the field is empty or not. This may be
  8499. // used to include empty fields in Patch requests.
  8500. ForceSendFields []string `json:"-"`
  8501. // NullFields is a list of field names (e.g. "Kind") to include in API
  8502. // requests with the JSON null value. By default, fields with empty
  8503. // values are omitted from API requests. However, any field with an
  8504. // empty value appearing in NullFields will be sent to the server as
  8505. // null. It is an error if a field in this list has a non-empty value.
  8506. // This may be used to include null fields in Patch requests.
  8507. NullFields []string `json:"-"`
  8508. }
  8509. func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) {
  8510. type NoMethod PlacementStrategiesListResponse
  8511. raw := NoMethod(*s)
  8512. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8513. }
  8514. // PlacementStrategy: Contains properties of a placement strategy.
  8515. type PlacementStrategy struct {
  8516. // AccountId: Account ID of this placement strategy.This is a read-only
  8517. // field that can be left blank.
  8518. AccountId int64 `json:"accountId,omitempty,string"`
  8519. // Id: ID of this placement strategy. This is a read-only,
  8520. // auto-generated field.
  8521. Id int64 `json:"id,omitempty,string"`
  8522. // Kind: Identifies what kind of resource this is. Value: the fixed
  8523. // string "dfareporting#placementStrategy".
  8524. Kind string `json:"kind,omitempty"`
  8525. // Name: Name of this placement strategy. This is a required field. It
  8526. // must be less than 256 characters long and unique among placement
  8527. // strategies of the same account.
  8528. Name string `json:"name,omitempty"`
  8529. // ServerResponse contains the HTTP response code and headers from the
  8530. // server.
  8531. googleapi.ServerResponse `json:"-"`
  8532. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8533. // unconditionally include in API requests. By default, fields with
  8534. // empty values are omitted from API requests. However, any non-pointer,
  8535. // non-interface field appearing in ForceSendFields will be sent to the
  8536. // server regardless of whether the field is empty or not. This may be
  8537. // used to include empty fields in Patch requests.
  8538. ForceSendFields []string `json:"-"`
  8539. // NullFields is a list of field names (e.g. "AccountId") to include in
  8540. // API requests with the JSON null value. By default, fields with empty
  8541. // values are omitted from API requests. However, any field with an
  8542. // empty value appearing in NullFields will be sent to the server as
  8543. // null. It is an error if a field in this list has a non-empty value.
  8544. // This may be used to include null fields in Patch requests.
  8545. NullFields []string `json:"-"`
  8546. }
  8547. func (s *PlacementStrategy) MarshalJSON() ([]byte, error) {
  8548. type NoMethod PlacementStrategy
  8549. raw := NoMethod(*s)
  8550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8551. }
  8552. // PlacementTag: Placement Tag
  8553. type PlacementTag struct {
  8554. // PlacementId: Placement ID
  8555. PlacementId int64 `json:"placementId,omitempty,string"`
  8556. // TagDatas: Tags generated for this placement.
  8557. TagDatas []*TagData `json:"tagDatas,omitempty"`
  8558. // ForceSendFields is a list of field names (e.g. "PlacementId") to
  8559. // unconditionally include in API requests. By default, fields with
  8560. // empty values are omitted from API requests. However, any non-pointer,
  8561. // non-interface field appearing in ForceSendFields will be sent to the
  8562. // server regardless of whether the field is empty or not. This may be
  8563. // used to include empty fields in Patch requests.
  8564. ForceSendFields []string `json:"-"`
  8565. // NullFields is a list of field names (e.g. "PlacementId") to include
  8566. // in API requests with the JSON null value. By default, fields with
  8567. // empty values are omitted from API requests. However, any field with
  8568. // an empty value appearing in NullFields will be sent to the server as
  8569. // null. It is an error if a field in this list has a non-empty value.
  8570. // This may be used to include null fields in Patch requests.
  8571. NullFields []string `json:"-"`
  8572. }
  8573. func (s *PlacementTag) MarshalJSON() ([]byte, error) {
  8574. type NoMethod PlacementTag
  8575. raw := NoMethod(*s)
  8576. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8577. }
  8578. // PlacementsGenerateTagsResponse: Placement GenerateTags Response
  8579. type PlacementsGenerateTagsResponse struct {
  8580. // Kind: Identifies what kind of resource this is. Value: the fixed
  8581. // string "dfareporting#placementsGenerateTagsResponse".
  8582. Kind string `json:"kind,omitempty"`
  8583. // PlacementTags: Set of generated tags for the specified placements.
  8584. PlacementTags []*PlacementTag `json:"placementTags,omitempty"`
  8585. // ServerResponse contains the HTTP response code and headers from the
  8586. // server.
  8587. googleapi.ServerResponse `json:"-"`
  8588. // ForceSendFields is a list of field names (e.g. "Kind") to
  8589. // unconditionally include in API requests. By default, fields with
  8590. // empty values are omitted from API requests. However, any non-pointer,
  8591. // non-interface field appearing in ForceSendFields will be sent to the
  8592. // server regardless of whether the field is empty or not. This may be
  8593. // used to include empty fields in Patch requests.
  8594. ForceSendFields []string `json:"-"`
  8595. // NullFields is a list of field names (e.g. "Kind") to include in API
  8596. // requests with the JSON null value. By default, fields with empty
  8597. // values are omitted from API requests. However, any field with an
  8598. // empty value appearing in NullFields will be sent to the server as
  8599. // null. It is an error if a field in this list has a non-empty value.
  8600. // This may be used to include null fields in Patch requests.
  8601. NullFields []string `json:"-"`
  8602. }
  8603. func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) {
  8604. type NoMethod PlacementsGenerateTagsResponse
  8605. raw := NoMethod(*s)
  8606. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8607. }
  8608. // PlacementsListResponse: Placement List Response
  8609. type PlacementsListResponse struct {
  8610. // Kind: Identifies what kind of resource this is. Value: the fixed
  8611. // string "dfareporting#placementsListResponse".
  8612. Kind string `json:"kind,omitempty"`
  8613. // NextPageToken: Pagination token to be used for the next list
  8614. // operation.
  8615. NextPageToken string `json:"nextPageToken,omitempty"`
  8616. // Placements: Placement collection.
  8617. Placements []*Placement `json:"placements,omitempty"`
  8618. // ServerResponse contains the HTTP response code and headers from the
  8619. // server.
  8620. googleapi.ServerResponse `json:"-"`
  8621. // ForceSendFields is a list of field names (e.g. "Kind") to
  8622. // unconditionally include in API requests. By default, fields with
  8623. // empty values are omitted from API requests. However, any non-pointer,
  8624. // non-interface field appearing in ForceSendFields will be sent to the
  8625. // server regardless of whether the field is empty or not. This may be
  8626. // used to include empty fields in Patch requests.
  8627. ForceSendFields []string `json:"-"`
  8628. // NullFields is a list of field names (e.g. "Kind") to include in API
  8629. // requests with the JSON null value. By default, fields with empty
  8630. // values are omitted from API requests. However, any field with an
  8631. // empty value appearing in NullFields will be sent to the server as
  8632. // null. It is an error if a field in this list has a non-empty value.
  8633. // This may be used to include null fields in Patch requests.
  8634. NullFields []string `json:"-"`
  8635. }
  8636. func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) {
  8637. type NoMethod PlacementsListResponse
  8638. raw := NoMethod(*s)
  8639. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8640. }
  8641. // PlatformType: Contains information about a platform type that can be
  8642. // targeted by ads.
  8643. type PlatformType struct {
  8644. // Id: ID of this platform type.
  8645. Id int64 `json:"id,omitempty,string"`
  8646. // Kind: Identifies what kind of resource this is. Value: the fixed
  8647. // string "dfareporting#platformType".
  8648. Kind string `json:"kind,omitempty"`
  8649. // Name: Name of this platform type.
  8650. Name string `json:"name,omitempty"`
  8651. // ServerResponse contains the HTTP response code and headers from the
  8652. // server.
  8653. googleapi.ServerResponse `json:"-"`
  8654. // ForceSendFields is a list of field names (e.g. "Id") to
  8655. // unconditionally include in API requests. By default, fields with
  8656. // empty values are omitted from API requests. However, any non-pointer,
  8657. // non-interface field appearing in ForceSendFields will be sent to the
  8658. // server regardless of whether the field is empty or not. This may be
  8659. // used to include empty fields in Patch requests.
  8660. ForceSendFields []string `json:"-"`
  8661. // NullFields is a list of field names (e.g. "Id") to include in API
  8662. // requests with the JSON null value. By default, fields with empty
  8663. // values are omitted from API requests. However, any field with an
  8664. // empty value appearing in NullFields will be sent to the server as
  8665. // null. It is an error if a field in this list has a non-empty value.
  8666. // This may be used to include null fields in Patch requests.
  8667. NullFields []string `json:"-"`
  8668. }
  8669. func (s *PlatformType) MarshalJSON() ([]byte, error) {
  8670. type NoMethod PlatformType
  8671. raw := NoMethod(*s)
  8672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8673. }
  8674. // PlatformTypesListResponse: Platform Type List Response
  8675. type PlatformTypesListResponse struct {
  8676. // Kind: Identifies what kind of resource this is. Value: the fixed
  8677. // string "dfareporting#platformTypesListResponse".
  8678. Kind string `json:"kind,omitempty"`
  8679. // PlatformTypes: Platform type collection.
  8680. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  8681. // ServerResponse contains the HTTP response code and headers from the
  8682. // server.
  8683. googleapi.ServerResponse `json:"-"`
  8684. // ForceSendFields is a list of field names (e.g. "Kind") to
  8685. // unconditionally include in API requests. By default, fields with
  8686. // empty values are omitted from API requests. However, any non-pointer,
  8687. // non-interface field appearing in ForceSendFields will be sent to the
  8688. // server regardless of whether the field is empty or not. This may be
  8689. // used to include empty fields in Patch requests.
  8690. ForceSendFields []string `json:"-"`
  8691. // NullFields is a list of field names (e.g. "Kind") to include in API
  8692. // requests with the JSON null value. By default, fields with empty
  8693. // values are omitted from API requests. However, any field with an
  8694. // empty value appearing in NullFields will be sent to the server as
  8695. // null. It is an error if a field in this list has a non-empty value.
  8696. // This may be used to include null fields in Patch requests.
  8697. NullFields []string `json:"-"`
  8698. }
  8699. func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) {
  8700. type NoMethod PlatformTypesListResponse
  8701. raw := NoMethod(*s)
  8702. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8703. }
  8704. // PopupWindowProperties: Popup Window Properties.
  8705. type PopupWindowProperties struct {
  8706. // Dimension: Popup dimension for a creative. This is a read-only field.
  8707. // Applicable to the following creative types: all RICH_MEDIA and all
  8708. // VPAID
  8709. Dimension *Size `json:"dimension,omitempty"`
  8710. // Offset: Upper-left corner coordinates of the popup window. Applicable
  8711. // if positionType is COORDINATES.
  8712. Offset *OffsetPosition `json:"offset,omitempty"`
  8713. // PositionType: Popup window position either centered or at specific
  8714. // coordinate.
  8715. //
  8716. // Possible values:
  8717. // "CENTER"
  8718. // "COORDINATES"
  8719. PositionType string `json:"positionType,omitempty"`
  8720. // ShowAddressBar: Whether to display the browser address bar.
  8721. ShowAddressBar bool `json:"showAddressBar,omitempty"`
  8722. // ShowMenuBar: Whether to display the browser menu bar.
  8723. ShowMenuBar bool `json:"showMenuBar,omitempty"`
  8724. // ShowScrollBar: Whether to display the browser scroll bar.
  8725. ShowScrollBar bool `json:"showScrollBar,omitempty"`
  8726. // ShowStatusBar: Whether to display the browser status bar.
  8727. ShowStatusBar bool `json:"showStatusBar,omitempty"`
  8728. // ShowToolBar: Whether to display the browser tool bar.
  8729. ShowToolBar bool `json:"showToolBar,omitempty"`
  8730. // Title: Title of popup window.
  8731. Title string `json:"title,omitempty"`
  8732. // ForceSendFields is a list of field names (e.g. "Dimension") to
  8733. // unconditionally include in API requests. By default, fields with
  8734. // empty values are omitted from API requests. However, any non-pointer,
  8735. // non-interface field appearing in ForceSendFields will be sent to the
  8736. // server regardless of whether the field is empty or not. This may be
  8737. // used to include empty fields in Patch requests.
  8738. ForceSendFields []string `json:"-"`
  8739. // NullFields is a list of field names (e.g. "Dimension") to include in
  8740. // API requests with the JSON null value. By default, fields with empty
  8741. // values are omitted from API requests. However, any field with an
  8742. // empty value appearing in NullFields will be sent to the server as
  8743. // null. It is an error if a field in this list has a non-empty value.
  8744. // This may be used to include null fields in Patch requests.
  8745. NullFields []string `json:"-"`
  8746. }
  8747. func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) {
  8748. type NoMethod PopupWindowProperties
  8749. raw := NoMethod(*s)
  8750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8751. }
  8752. // PostalCode: Contains information about a postal code that can be
  8753. // targeted by ads.
  8754. type PostalCode struct {
  8755. // Code: Postal code. This is equivalent to the id field.
  8756. Code string `json:"code,omitempty"`
  8757. // CountryCode: Country code of the country to which this postal code
  8758. // belongs.
  8759. CountryCode string `json:"countryCode,omitempty"`
  8760. // CountryDartId: DART ID of the country to which this postal code
  8761. // belongs.
  8762. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  8763. // Id: ID of this postal code.
  8764. Id string `json:"id,omitempty"`
  8765. // Kind: Identifies what kind of resource this is. Value: the fixed
  8766. // string "dfareporting#postalCode".
  8767. Kind string `json:"kind,omitempty"`
  8768. // ServerResponse contains the HTTP response code and headers from the
  8769. // server.
  8770. googleapi.ServerResponse `json:"-"`
  8771. // ForceSendFields is a list of field names (e.g. "Code") to
  8772. // unconditionally include in API requests. By default, fields with
  8773. // empty values are omitted from API requests. However, any non-pointer,
  8774. // non-interface field appearing in ForceSendFields will be sent to the
  8775. // server regardless of whether the field is empty or not. This may be
  8776. // used to include empty fields in Patch requests.
  8777. ForceSendFields []string `json:"-"`
  8778. // NullFields is a list of field names (e.g. "Code") to include in API
  8779. // requests with the JSON null value. By default, fields with empty
  8780. // values are omitted from API requests. However, any field with an
  8781. // empty value appearing in NullFields will be sent to the server as
  8782. // null. It is an error if a field in this list has a non-empty value.
  8783. // This may be used to include null fields in Patch requests.
  8784. NullFields []string `json:"-"`
  8785. }
  8786. func (s *PostalCode) MarshalJSON() ([]byte, error) {
  8787. type NoMethod PostalCode
  8788. raw := NoMethod(*s)
  8789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8790. }
  8791. // PostalCodesListResponse: Postal Code List Response
  8792. type PostalCodesListResponse struct {
  8793. // Kind: Identifies what kind of resource this is. Value: the fixed
  8794. // string "dfareporting#postalCodesListResponse".
  8795. Kind string `json:"kind,omitempty"`
  8796. // PostalCodes: Postal code collection.
  8797. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  8798. // ServerResponse contains the HTTP response code and headers from the
  8799. // server.
  8800. googleapi.ServerResponse `json:"-"`
  8801. // ForceSendFields is a list of field names (e.g. "Kind") to
  8802. // unconditionally include in API requests. By default, fields with
  8803. // empty values are omitted from API requests. However, any non-pointer,
  8804. // non-interface field appearing in ForceSendFields will be sent to the
  8805. // server regardless of whether the field is empty or not. This may be
  8806. // used to include empty fields in Patch requests.
  8807. ForceSendFields []string `json:"-"`
  8808. // NullFields is a list of field names (e.g. "Kind") to include in API
  8809. // requests with the JSON null value. By default, fields with empty
  8810. // values are omitted from API requests. However, any field with an
  8811. // empty value appearing in NullFields will be sent to the server as
  8812. // null. It is an error if a field in this list has a non-empty value.
  8813. // This may be used to include null fields in Patch requests.
  8814. NullFields []string `json:"-"`
  8815. }
  8816. func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) {
  8817. type NoMethod PostalCodesListResponse
  8818. raw := NoMethod(*s)
  8819. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8820. }
  8821. // Pricing: Pricing Information
  8822. type Pricing struct {
  8823. // CapCostType: Cap cost type of this inventory item.
  8824. //
  8825. // Possible values:
  8826. // "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE"
  8827. // "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY"
  8828. // "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE"
  8829. CapCostType string `json:"capCostType,omitempty"`
  8830. // EndDate: End date of this inventory item.
  8831. EndDate string `json:"endDate,omitempty"`
  8832. // Flights: Flights of this inventory item. A flight (a.k.a. pricing
  8833. // period) represents the inventory item pricing information for a
  8834. // specific period of time.
  8835. Flights []*Flight `json:"flights,omitempty"`
  8836. // GroupType: Group type of this inventory item if it represents a
  8837. // placement group. Is null otherwise. There are two type of placement
  8838. // groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of
  8839. // inventory items that acts as a single pricing point for a group of
  8840. // tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory
  8841. // items that not only acts as a single pricing point, but also assumes
  8842. // that all the tags in it will be served at the same time. A roadblock
  8843. // requires one of its assigned inventory items to be marked as primary.
  8844. //
  8845. // Possible values:
  8846. // "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE"
  8847. // "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK"
  8848. GroupType string `json:"groupType,omitempty"`
  8849. // PricingType: Pricing type of this inventory item.
  8850. //
  8851. // Possible values:
  8852. // "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS"
  8853. // "PLANNING_PLACEMENT_PRICING_TYPE_CPA"
  8854. // "PLANNING_PLACEMENT_PRICING_TYPE_CPC"
  8855. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM"
  8856. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM_ACTIVEVIEW"
  8857. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS"
  8858. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8859. // "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS"
  8860. PricingType string `json:"pricingType,omitempty"`
  8861. // StartDate: Start date of this inventory item.
  8862. StartDate string `json:"startDate,omitempty"`
  8863. // ForceSendFields is a list of field names (e.g. "CapCostType") to
  8864. // unconditionally include in API requests. By default, fields with
  8865. // empty values are omitted from API requests. However, any non-pointer,
  8866. // non-interface field appearing in ForceSendFields will be sent to the
  8867. // server regardless of whether the field is empty or not. This may be
  8868. // used to include empty fields in Patch requests.
  8869. ForceSendFields []string `json:"-"`
  8870. // NullFields is a list of field names (e.g. "CapCostType") to include
  8871. // in API requests with the JSON null value. By default, fields with
  8872. // empty values are omitted from API requests. However, any field with
  8873. // an empty value appearing in NullFields will be sent to the server as
  8874. // null. It is an error if a field in this list has a non-empty value.
  8875. // This may be used to include null fields in Patch requests.
  8876. NullFields []string `json:"-"`
  8877. }
  8878. func (s *Pricing) MarshalJSON() ([]byte, error) {
  8879. type NoMethod Pricing
  8880. raw := NoMethod(*s)
  8881. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8882. }
  8883. // PricingSchedule: Pricing Schedule
  8884. type PricingSchedule struct {
  8885. // CapCostOption: Placement cap cost option.
  8886. //
  8887. // Possible values:
  8888. // "CAP_COST_CUMULATIVE"
  8889. // "CAP_COST_MONTHLY"
  8890. // "CAP_COST_NONE"
  8891. CapCostOption string `json:"capCostOption,omitempty"`
  8892. // DisregardOverdelivery: Whether cap costs are ignored by ad serving.
  8893. DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"`
  8894. // EndDate: Placement end date. This date must be later than, or the
  8895. // same day as, the placement start date, but not later than the
  8896. // campaign end date. If, for example, you set 6/25/2015 as both the
  8897. // start and end dates, the effective placement date is just that day
  8898. // only, 6/25/2015. The hours, minutes, and seconds of the end date
  8899. // should not be set, as doing so will result in an error. This field is
  8900. // required on insertion.
  8901. EndDate string `json:"endDate,omitempty"`
  8902. // Flighted: Whether this placement is flighted. If true, pricing
  8903. // periods will be computed automatically.
  8904. Flighted bool `json:"flighted,omitempty"`
  8905. // FloodlightActivityId: Floodlight activity ID associated with this
  8906. // placement. This field should be set when placement pricing type is
  8907. // set to PRICING_TYPE_CPA.
  8908. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  8909. // PricingPeriods: Pricing periods for this placement.
  8910. PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"`
  8911. // PricingType: Placement pricing type. This field is required on
  8912. // insertion.
  8913. //
  8914. // Possible values:
  8915. // "PRICING_TYPE_CPA"
  8916. // "PRICING_TYPE_CPC"
  8917. // "PRICING_TYPE_CPM"
  8918. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  8919. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  8920. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8921. PricingType string `json:"pricingType,omitempty"`
  8922. // StartDate: Placement start date. This date must be later than, or the
  8923. // same day as, the campaign start date. The hours, minutes, and seconds
  8924. // of the start date should not be set, as doing so will result in an
  8925. // error. This field is required on insertion.
  8926. StartDate string `json:"startDate,omitempty"`
  8927. // TestingStartDate: Testing start date of this placement. The hours,
  8928. // minutes, and seconds of the start date should not be set, as doing so
  8929. // will result in an error.
  8930. TestingStartDate string `json:"testingStartDate,omitempty"`
  8931. // ForceSendFields is a list of field names (e.g. "CapCostOption") to
  8932. // unconditionally include in API requests. By default, fields with
  8933. // empty values are omitted from API requests. However, any non-pointer,
  8934. // non-interface field appearing in ForceSendFields will be sent to the
  8935. // server regardless of whether the field is empty or not. This may be
  8936. // used to include empty fields in Patch requests.
  8937. ForceSendFields []string `json:"-"`
  8938. // NullFields is a list of field names (e.g. "CapCostOption") to include
  8939. // in API requests with the JSON null value. By default, fields with
  8940. // empty values are omitted from API requests. However, any field with
  8941. // an empty value appearing in NullFields will be sent to the server as
  8942. // null. It is an error if a field in this list has a non-empty value.
  8943. // This may be used to include null fields in Patch requests.
  8944. NullFields []string `json:"-"`
  8945. }
  8946. func (s *PricingSchedule) MarshalJSON() ([]byte, error) {
  8947. type NoMethod PricingSchedule
  8948. raw := NoMethod(*s)
  8949. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8950. }
  8951. // PricingSchedulePricingPeriod: Pricing Period
  8952. type PricingSchedulePricingPeriod struct {
  8953. // EndDate: Pricing period end date. This date must be later than, or
  8954. // the same day as, the pricing period start date, but not later than
  8955. // the placement end date. The period end date can be the same date as
  8956. // the period start date. If, for example, you set 6/25/2015 as both the
  8957. // start and end dates, the effective pricing period date is just that
  8958. // day only, 6/25/2015. The hours, minutes, and seconds of the end date
  8959. // should not be set, as doing so will result in an error.
  8960. EndDate string `json:"endDate,omitempty"`
  8961. // PricingComment: Comments for this pricing period.
  8962. PricingComment string `json:"pricingComment,omitempty"`
  8963. // RateOrCostNanos: Rate or cost of this pricing period in nanos (i.e.,
  8964. // multipled by 1000000000). Acceptable values are 0 to
  8965. // 1000000000000000000, inclusive.
  8966. RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"`
  8967. // StartDate: Pricing period start date. This date must be later than,
  8968. // or the same day as, the placement start date. The hours, minutes, and
  8969. // seconds of the start date should not be set, as doing so will result
  8970. // in an error.
  8971. StartDate string `json:"startDate,omitempty"`
  8972. // Units: Units of this pricing period. Acceptable values are 0 to
  8973. // 10000000000, inclusive.
  8974. Units int64 `json:"units,omitempty,string"`
  8975. // ForceSendFields is a list of field names (e.g. "EndDate") to
  8976. // unconditionally include in API requests. By default, fields with
  8977. // empty values are omitted from API requests. However, any non-pointer,
  8978. // non-interface field appearing in ForceSendFields will be sent to the
  8979. // server regardless of whether the field is empty or not. This may be
  8980. // used to include empty fields in Patch requests.
  8981. ForceSendFields []string `json:"-"`
  8982. // NullFields is a list of field names (e.g. "EndDate") to include in
  8983. // API requests with the JSON null value. By default, fields with empty
  8984. // values are omitted from API requests. However, any field with an
  8985. // empty value appearing in NullFields will be sent to the server as
  8986. // null. It is an error if a field in this list has a non-empty value.
  8987. // This may be used to include null fields in Patch requests.
  8988. NullFields []string `json:"-"`
  8989. }
  8990. func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) {
  8991. type NoMethod PricingSchedulePricingPeriod
  8992. raw := NoMethod(*s)
  8993. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8994. }
  8995. // Project: Contains properties of a DoubleClick Planning project.
  8996. type Project struct {
  8997. // AccountId: Account ID of this project.
  8998. AccountId int64 `json:"accountId,omitempty,string"`
  8999. // AdvertiserId: Advertiser ID of this project.
  9000. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9001. // AudienceAgeGroup: Audience age group of this project.
  9002. //
  9003. // Possible values:
  9004. // "PLANNING_AUDIENCE_AGE_18_24"
  9005. // "PLANNING_AUDIENCE_AGE_25_34"
  9006. // "PLANNING_AUDIENCE_AGE_35_44"
  9007. // "PLANNING_AUDIENCE_AGE_45_54"
  9008. // "PLANNING_AUDIENCE_AGE_55_64"
  9009. // "PLANNING_AUDIENCE_AGE_65_OR_MORE"
  9010. // "PLANNING_AUDIENCE_AGE_UNKNOWN"
  9011. AudienceAgeGroup string `json:"audienceAgeGroup,omitempty"`
  9012. // AudienceGender: Audience gender of this project.
  9013. //
  9014. // Possible values:
  9015. // "PLANNING_AUDIENCE_GENDER_FEMALE"
  9016. // "PLANNING_AUDIENCE_GENDER_MALE"
  9017. AudienceGender string `json:"audienceGender,omitempty"`
  9018. // Budget: Budget of this project in the currency specified by the
  9019. // current account. The value stored in this field represents only the
  9020. // non-fractional amount. For example, for USD, the smallest value that
  9021. // can be represented by this field is 1 US dollar.
  9022. Budget int64 `json:"budget,omitempty,string"`
  9023. // ClientBillingCode: Client billing code of this project.
  9024. ClientBillingCode string `json:"clientBillingCode,omitempty"`
  9025. // ClientName: Name of the project client.
  9026. ClientName string `json:"clientName,omitempty"`
  9027. // EndDate: End date of the project.
  9028. EndDate string `json:"endDate,omitempty"`
  9029. // Id: ID of this project. This is a read-only, auto-generated field.
  9030. Id int64 `json:"id,omitempty,string"`
  9031. // Kind: Identifies what kind of resource this is. Value: the fixed
  9032. // string "dfareporting#project".
  9033. Kind string `json:"kind,omitempty"`
  9034. // LastModifiedInfo: Information about the most recent modification of
  9035. // this project.
  9036. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  9037. // Name: Name of this project.
  9038. Name string `json:"name,omitempty"`
  9039. // Overview: Overview of this project.
  9040. Overview string `json:"overview,omitempty"`
  9041. // StartDate: Start date of the project.
  9042. StartDate string `json:"startDate,omitempty"`
  9043. // SubaccountId: Subaccount ID of this project.
  9044. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9045. // TargetClicks: Number of clicks that the advertiser is targeting.
  9046. TargetClicks int64 `json:"targetClicks,omitempty,string"`
  9047. // TargetConversions: Number of conversions that the advertiser is
  9048. // targeting.
  9049. TargetConversions int64 `json:"targetConversions,omitempty,string"`
  9050. // TargetCpaNanos: CPA that the advertiser is targeting.
  9051. TargetCpaNanos int64 `json:"targetCpaNanos,omitempty,string"`
  9052. // TargetCpcNanos: CPC that the advertiser is targeting.
  9053. TargetCpcNanos int64 `json:"targetCpcNanos,omitempty,string"`
  9054. // TargetCpmActiveViewNanos: vCPM from Active View that the advertiser
  9055. // is targeting.
  9056. TargetCpmActiveViewNanos int64 `json:"targetCpmActiveViewNanos,omitempty,string"`
  9057. // TargetCpmNanos: CPM that the advertiser is targeting.
  9058. TargetCpmNanos int64 `json:"targetCpmNanos,omitempty,string"`
  9059. // TargetImpressions: Number of impressions that the advertiser is
  9060. // targeting.
  9061. TargetImpressions int64 `json:"targetImpressions,omitempty,string"`
  9062. // ServerResponse contains the HTTP response code and headers from the
  9063. // server.
  9064. googleapi.ServerResponse `json:"-"`
  9065. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9066. // unconditionally include in API requests. By default, fields with
  9067. // empty values are omitted from API requests. However, any non-pointer,
  9068. // non-interface field appearing in ForceSendFields will be sent to the
  9069. // server regardless of whether the field is empty or not. This may be
  9070. // used to include empty fields in Patch requests.
  9071. ForceSendFields []string `json:"-"`
  9072. // NullFields is a list of field names (e.g. "AccountId") to include in
  9073. // API requests with the JSON null value. By default, fields with empty
  9074. // values are omitted from API requests. However, any field with an
  9075. // empty value appearing in NullFields will be sent to the server as
  9076. // null. It is an error if a field in this list has a non-empty value.
  9077. // This may be used to include null fields in Patch requests.
  9078. NullFields []string `json:"-"`
  9079. }
  9080. func (s *Project) MarshalJSON() ([]byte, error) {
  9081. type NoMethod Project
  9082. raw := NoMethod(*s)
  9083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9084. }
  9085. // ProjectsListResponse: Project List Response
  9086. type ProjectsListResponse struct {
  9087. // Kind: Identifies what kind of resource this is. Value: the fixed
  9088. // string "dfareporting#projectsListResponse".
  9089. Kind string `json:"kind,omitempty"`
  9090. // NextPageToken: Pagination token to be used for the next list
  9091. // operation.
  9092. NextPageToken string `json:"nextPageToken,omitempty"`
  9093. // Projects: Project collection.
  9094. Projects []*Project `json:"projects,omitempty"`
  9095. // ServerResponse contains the HTTP response code and headers from the
  9096. // server.
  9097. googleapi.ServerResponse `json:"-"`
  9098. // ForceSendFields is a list of field names (e.g. "Kind") to
  9099. // unconditionally include in API requests. By default, fields with
  9100. // empty values are omitted from API requests. However, any non-pointer,
  9101. // non-interface field appearing in ForceSendFields will be sent to the
  9102. // server regardless of whether the field is empty or not. This may be
  9103. // used to include empty fields in Patch requests.
  9104. ForceSendFields []string `json:"-"`
  9105. // NullFields is a list of field names (e.g. "Kind") to include in API
  9106. // requests with the JSON null value. By default, fields with empty
  9107. // values are omitted from API requests. However, any field with an
  9108. // empty value appearing in NullFields will be sent to the server as
  9109. // null. It is an error if a field in this list has a non-empty value.
  9110. // This may be used to include null fields in Patch requests.
  9111. NullFields []string `json:"-"`
  9112. }
  9113. func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) {
  9114. type NoMethod ProjectsListResponse
  9115. raw := NoMethod(*s)
  9116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9117. }
  9118. // ReachReportCompatibleFields: Represents fields that are compatible to
  9119. // be selected for a report of type "REACH".
  9120. type ReachReportCompatibleFields struct {
  9121. // DimensionFilters: Dimensions which are compatible to be selected in
  9122. // the "dimensionFilters" section of the report.
  9123. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9124. // Dimensions: Dimensions which are compatible to be selected in the
  9125. // "dimensions" section of the report.
  9126. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9127. // Kind: The kind of resource this is, in this case
  9128. // dfareporting#reachReportCompatibleFields.
  9129. Kind string `json:"kind,omitempty"`
  9130. // Metrics: Metrics which are compatible to be selected in the
  9131. // "metricNames" section of the report.
  9132. Metrics []*Metric `json:"metrics,omitempty"`
  9133. // PivotedActivityMetrics: Metrics which are compatible to be selected
  9134. // as activity metrics to pivot on in the "activities" section of the
  9135. // report.
  9136. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  9137. // ReachByFrequencyMetrics: Metrics which are compatible to be selected
  9138. // in the "reachByFrequencyMetricNames" section of the report.
  9139. ReachByFrequencyMetrics []*Metric `json:"reachByFrequencyMetrics,omitempty"`
  9140. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  9141. // unconditionally include in API requests. By default, fields with
  9142. // empty values are omitted from API requests. However, any non-pointer,
  9143. // non-interface field appearing in ForceSendFields will be sent to the
  9144. // server regardless of whether the field is empty or not. This may be
  9145. // used to include empty fields in Patch requests.
  9146. ForceSendFields []string `json:"-"`
  9147. // NullFields is a list of field names (e.g. "DimensionFilters") to
  9148. // include in API requests with the JSON null value. By default, fields
  9149. // with empty values are omitted from API requests. However, any field
  9150. // with an empty value appearing in NullFields will be sent to the
  9151. // server as null. It is an error if a field in this list has a
  9152. // non-empty value. This may be used to include null fields in Patch
  9153. // requests.
  9154. NullFields []string `json:"-"`
  9155. }
  9156. func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  9157. type NoMethod ReachReportCompatibleFields
  9158. raw := NoMethod(*s)
  9159. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9160. }
  9161. // Recipient: Represents a recipient.
  9162. type Recipient struct {
  9163. // DeliveryType: The delivery type for the recipient.
  9164. //
  9165. // Possible values:
  9166. // "ATTACHMENT"
  9167. // "LINK"
  9168. DeliveryType string `json:"deliveryType,omitempty"`
  9169. // Email: The email address of the recipient.
  9170. Email string `json:"email,omitempty"`
  9171. // Kind: The kind of resource this is, in this case
  9172. // dfareporting#recipient.
  9173. Kind string `json:"kind,omitempty"`
  9174. // ForceSendFields is a list of field names (e.g. "DeliveryType") to
  9175. // unconditionally include in API requests. By default, fields with
  9176. // empty values are omitted from API requests. However, any non-pointer,
  9177. // non-interface field appearing in ForceSendFields will be sent to the
  9178. // server regardless of whether the field is empty or not. This may be
  9179. // used to include empty fields in Patch requests.
  9180. ForceSendFields []string `json:"-"`
  9181. // NullFields is a list of field names (e.g. "DeliveryType") to include
  9182. // in API requests with the JSON null value. By default, fields with
  9183. // empty values are omitted from API requests. However, any field with
  9184. // an empty value appearing in NullFields will be sent to the server as
  9185. // null. It is an error if a field in this list has a non-empty value.
  9186. // This may be used to include null fields in Patch requests.
  9187. NullFields []string `json:"-"`
  9188. }
  9189. func (s *Recipient) MarshalJSON() ([]byte, error) {
  9190. type NoMethod Recipient
  9191. raw := NoMethod(*s)
  9192. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9193. }
  9194. // Region: Contains information about a region that can be targeted by
  9195. // ads.
  9196. type Region struct {
  9197. // CountryCode: Country code of the country to which this region
  9198. // belongs.
  9199. CountryCode string `json:"countryCode,omitempty"`
  9200. // CountryDartId: DART ID of the country to which this region belongs.
  9201. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  9202. // DartId: DART ID of this region.
  9203. DartId int64 `json:"dartId,omitempty,string"`
  9204. // Kind: Identifies what kind of resource this is. Value: the fixed
  9205. // string "dfareporting#region".
  9206. Kind string `json:"kind,omitempty"`
  9207. // Name: Name of this region.
  9208. Name string `json:"name,omitempty"`
  9209. // RegionCode: Region code.
  9210. RegionCode string `json:"regionCode,omitempty"`
  9211. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  9212. // unconditionally include in API requests. By default, fields with
  9213. // empty values are omitted from API requests. However, any non-pointer,
  9214. // non-interface field appearing in ForceSendFields will be sent to the
  9215. // server regardless of whether the field is empty or not. This may be
  9216. // used to include empty fields in Patch requests.
  9217. ForceSendFields []string `json:"-"`
  9218. // NullFields is a list of field names (e.g. "CountryCode") to include
  9219. // in API requests with the JSON null value. By default, fields with
  9220. // empty values are omitted from API requests. However, any field with
  9221. // an empty value appearing in NullFields will be sent to the server as
  9222. // null. It is an error if a field in this list has a non-empty value.
  9223. // This may be used to include null fields in Patch requests.
  9224. NullFields []string `json:"-"`
  9225. }
  9226. func (s *Region) MarshalJSON() ([]byte, error) {
  9227. type NoMethod Region
  9228. raw := NoMethod(*s)
  9229. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9230. }
  9231. // RegionsListResponse: Region List Response
  9232. type RegionsListResponse struct {
  9233. // Kind: Identifies what kind of resource this is. Value: the fixed
  9234. // string "dfareporting#regionsListResponse".
  9235. Kind string `json:"kind,omitempty"`
  9236. // Regions: Region collection.
  9237. Regions []*Region `json:"regions,omitempty"`
  9238. // ServerResponse contains the HTTP response code and headers from the
  9239. // server.
  9240. googleapi.ServerResponse `json:"-"`
  9241. // ForceSendFields is a list of field names (e.g. "Kind") to
  9242. // unconditionally include in API requests. By default, fields with
  9243. // empty values are omitted from API requests. However, any non-pointer,
  9244. // non-interface field appearing in ForceSendFields will be sent to the
  9245. // server regardless of whether the field is empty or not. This may be
  9246. // used to include empty fields in Patch requests.
  9247. ForceSendFields []string `json:"-"`
  9248. // NullFields is a list of field names (e.g. "Kind") to include in API
  9249. // requests with the JSON null value. By default, fields with empty
  9250. // values are omitted from API requests. However, any field with an
  9251. // empty value appearing in NullFields will be sent to the server as
  9252. // null. It is an error if a field in this list has a non-empty value.
  9253. // This may be used to include null fields in Patch requests.
  9254. NullFields []string `json:"-"`
  9255. }
  9256. func (s *RegionsListResponse) MarshalJSON() ([]byte, error) {
  9257. type NoMethod RegionsListResponse
  9258. raw := NoMethod(*s)
  9259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9260. }
  9261. // RemarketingList: Contains properties of a remarketing list.
  9262. // Remarketing enables you to create lists of users who have performed
  9263. // specific actions on a site, then target ads to members of those
  9264. // lists. This resource can be used to manage remarketing lists that are
  9265. // owned by your advertisers. To see all remarketing lists that are
  9266. // visible to your advertisers, including those that are shared to your
  9267. // advertiser or account, use the TargetableRemarketingLists resource.
  9268. type RemarketingList struct {
  9269. // AccountId: Account ID of this remarketing list. This is a read-only,
  9270. // auto-generated field that is only returned in GET requests.
  9271. AccountId int64 `json:"accountId,omitempty,string"`
  9272. // Active: Whether this remarketing list is active.
  9273. Active bool `json:"active,omitempty"`
  9274. // AdvertiserId: Dimension value for the advertiser ID that owns this
  9275. // remarketing list. This is a required field.
  9276. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9277. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  9278. // advertiser. This is a read-only, auto-generated field.
  9279. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  9280. // Description: Remarketing list description.
  9281. Description string `json:"description,omitempty"`
  9282. // Id: Remarketing list ID. This is a read-only, auto-generated field.
  9283. Id int64 `json:"id,omitempty,string"`
  9284. // Kind: Identifies what kind of resource this is. Value: the fixed
  9285. // string "dfareporting#remarketingList".
  9286. Kind string `json:"kind,omitempty"`
  9287. // LifeSpan: Number of days that a user should remain in the remarketing
  9288. // list without an impression. Acceptable values are 1 to 540,
  9289. // inclusive.
  9290. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  9291. // ListPopulationRule: Rule used to populate the remarketing list with
  9292. // users.
  9293. ListPopulationRule *ListPopulationRule `json:"listPopulationRule,omitempty"`
  9294. // ListSize: Number of users currently in the list. This is a read-only
  9295. // field.
  9296. ListSize int64 `json:"listSize,omitempty,string"`
  9297. // ListSource: Product from which this remarketing list was originated.
  9298. //
  9299. // Possible values:
  9300. // "REMARKETING_LIST_SOURCE_ADX"
  9301. // "REMARKETING_LIST_SOURCE_DBM"
  9302. // "REMARKETING_LIST_SOURCE_DFA"
  9303. // "REMARKETING_LIST_SOURCE_DFP"
  9304. // "REMARKETING_LIST_SOURCE_DMP"
  9305. // "REMARKETING_LIST_SOURCE_GA"
  9306. // "REMARKETING_LIST_SOURCE_GPLUS"
  9307. // "REMARKETING_LIST_SOURCE_OTHER"
  9308. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  9309. // "REMARKETING_LIST_SOURCE_XFP"
  9310. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  9311. ListSource string `json:"listSource,omitempty"`
  9312. // Name: Name of the remarketing list. This is a required field. Must be
  9313. // no greater than 128 characters long.
  9314. Name string `json:"name,omitempty"`
  9315. // SubaccountId: Subaccount ID of this remarketing list. This is a
  9316. // read-only, auto-generated field that is only returned in GET
  9317. // requests.
  9318. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9319. // ServerResponse contains the HTTP response code and headers from the
  9320. // server.
  9321. googleapi.ServerResponse `json:"-"`
  9322. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9323. // unconditionally include in API requests. By default, fields with
  9324. // empty values are omitted from API requests. However, any non-pointer,
  9325. // non-interface field appearing in ForceSendFields will be sent to the
  9326. // server regardless of whether the field is empty or not. This may be
  9327. // used to include empty fields in Patch requests.
  9328. ForceSendFields []string `json:"-"`
  9329. // NullFields is a list of field names (e.g. "AccountId") to include in
  9330. // API requests with the JSON null value. By default, fields with empty
  9331. // values are omitted from API requests. However, any field with an
  9332. // empty value appearing in NullFields will be sent to the server as
  9333. // null. It is an error if a field in this list has a non-empty value.
  9334. // This may be used to include null fields in Patch requests.
  9335. NullFields []string `json:"-"`
  9336. }
  9337. func (s *RemarketingList) MarshalJSON() ([]byte, error) {
  9338. type NoMethod RemarketingList
  9339. raw := NoMethod(*s)
  9340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9341. }
  9342. // RemarketingListShare: Contains properties of a remarketing list's
  9343. // sharing information. Sharing allows other accounts or advertisers to
  9344. // target to your remarketing lists. This resource can be used to manage
  9345. // remarketing list sharing to other accounts and advertisers.
  9346. type RemarketingListShare struct {
  9347. // Kind: Identifies what kind of resource this is. Value: the fixed
  9348. // string "dfareporting#remarketingListShare".
  9349. Kind string `json:"kind,omitempty"`
  9350. // RemarketingListId: Remarketing list ID. This is a read-only,
  9351. // auto-generated field.
  9352. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  9353. // SharedAccountIds: Accounts that the remarketing list is shared with.
  9354. SharedAccountIds googleapi.Int64s `json:"sharedAccountIds,omitempty"`
  9355. // SharedAdvertiserIds: Advertisers that the remarketing list is shared
  9356. // with.
  9357. SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"`
  9358. // ServerResponse contains the HTTP response code and headers from the
  9359. // server.
  9360. googleapi.ServerResponse `json:"-"`
  9361. // ForceSendFields is a list of field names (e.g. "Kind") to
  9362. // unconditionally include in API requests. By default, fields with
  9363. // empty values are omitted from API requests. However, any non-pointer,
  9364. // non-interface field appearing in ForceSendFields will be sent to the
  9365. // server regardless of whether the field is empty or not. This may be
  9366. // used to include empty fields in Patch requests.
  9367. ForceSendFields []string `json:"-"`
  9368. // NullFields is a list of field names (e.g. "Kind") to include in API
  9369. // requests with the JSON null value. By default, fields with empty
  9370. // values are omitted from API requests. However, any field with an
  9371. // empty value appearing in NullFields will be sent to the server as
  9372. // null. It is an error if a field in this list has a non-empty value.
  9373. // This may be used to include null fields in Patch requests.
  9374. NullFields []string `json:"-"`
  9375. }
  9376. func (s *RemarketingListShare) MarshalJSON() ([]byte, error) {
  9377. type NoMethod RemarketingListShare
  9378. raw := NoMethod(*s)
  9379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9380. }
  9381. // RemarketingListsListResponse: Remarketing list response
  9382. type RemarketingListsListResponse struct {
  9383. // Kind: Identifies what kind of resource this is. Value: the fixed
  9384. // string "dfareporting#remarketingListsListResponse".
  9385. Kind string `json:"kind,omitempty"`
  9386. // NextPageToken: Pagination token to be used for the next list
  9387. // operation.
  9388. NextPageToken string `json:"nextPageToken,omitempty"`
  9389. // RemarketingLists: Remarketing list collection.
  9390. RemarketingLists []*RemarketingList `json:"remarketingLists,omitempty"`
  9391. // ServerResponse contains the HTTP response code and headers from the
  9392. // server.
  9393. googleapi.ServerResponse `json:"-"`
  9394. // ForceSendFields is a list of field names (e.g. "Kind") to
  9395. // unconditionally include in API requests. By default, fields with
  9396. // empty values are omitted from API requests. However, any non-pointer,
  9397. // non-interface field appearing in ForceSendFields will be sent to the
  9398. // server regardless of whether the field is empty or not. This may be
  9399. // used to include empty fields in Patch requests.
  9400. ForceSendFields []string `json:"-"`
  9401. // NullFields is a list of field names (e.g. "Kind") to include in API
  9402. // requests with the JSON null value. By default, fields with empty
  9403. // values are omitted from API requests. However, any field with an
  9404. // empty value appearing in NullFields will be sent to the server as
  9405. // null. It is an error if a field in this list has a non-empty value.
  9406. // This may be used to include null fields in Patch requests.
  9407. NullFields []string `json:"-"`
  9408. }
  9409. func (s *RemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  9410. type NoMethod RemarketingListsListResponse
  9411. raw := NoMethod(*s)
  9412. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9413. }
  9414. // Report: Represents a Report resource.
  9415. type Report struct {
  9416. // AccountId: The account ID to which this report belongs.
  9417. AccountId int64 `json:"accountId,omitempty,string"`
  9418. // Criteria: The report criteria for a report of type "STANDARD".
  9419. Criteria *ReportCriteria `json:"criteria,omitempty"`
  9420. // CrossDimensionReachCriteria: The report criteria for a report of type
  9421. // "CROSS_DIMENSION_REACH".
  9422. CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"`
  9423. // Delivery: The report's email delivery settings.
  9424. Delivery *ReportDelivery `json:"delivery,omitempty"`
  9425. // Etag: The eTag of this response for caching purposes.
  9426. Etag string `json:"etag,omitempty"`
  9427. // FileName: The filename used when generating report files for this
  9428. // report.
  9429. FileName string `json:"fileName,omitempty"`
  9430. // FloodlightCriteria: The report criteria for a report of type
  9431. // "FLOODLIGHT".
  9432. FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"`
  9433. // Format: The output format of the report. If not specified, default
  9434. // format is "CSV". Note that the actual format in the completed report
  9435. // file might differ if for instance the report's size exceeds the
  9436. // format's capabilities. "CSV" will then be the fallback format.
  9437. //
  9438. // Possible values:
  9439. // "CSV"
  9440. // "EXCEL"
  9441. Format string `json:"format,omitempty"`
  9442. // Id: The unique ID identifying this report resource.
  9443. Id int64 `json:"id,omitempty,string"`
  9444. // Kind: The kind of resource this is, in this case dfareporting#report.
  9445. Kind string `json:"kind,omitempty"`
  9446. // LastModifiedTime: The timestamp (in milliseconds since epoch) of when
  9447. // this report was last modified.
  9448. LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"`
  9449. // Name: The name of the report.
  9450. Name string `json:"name,omitempty"`
  9451. // OwnerProfileId: The user profile id of the owner of this report.
  9452. OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"`
  9453. // PathToConversionCriteria: The report criteria for a report of type
  9454. // "PATH_TO_CONVERSION".
  9455. PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"`
  9456. // ReachCriteria: The report criteria for a report of type "REACH".
  9457. ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"`
  9458. // Schedule: The report's schedule. Can only be set if the report's
  9459. // 'dateRange' is a relative date range and the relative date range is
  9460. // not "TODAY".
  9461. Schedule *ReportSchedule `json:"schedule,omitempty"`
  9462. // SubAccountId: The subaccount ID to which this report belongs if
  9463. // applicable.
  9464. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  9465. // Type: The type of the report.
  9466. //
  9467. // Possible values:
  9468. // "CROSS_DIMENSION_REACH"
  9469. // "FLOODLIGHT"
  9470. // "PATH_TO_CONVERSION"
  9471. // "REACH"
  9472. // "STANDARD"
  9473. Type string `json:"type,omitempty"`
  9474. // ServerResponse contains the HTTP response code and headers from the
  9475. // server.
  9476. googleapi.ServerResponse `json:"-"`
  9477. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9478. // unconditionally include in API requests. By default, fields with
  9479. // empty values are omitted from API requests. However, any non-pointer,
  9480. // non-interface field appearing in ForceSendFields will be sent to the
  9481. // server regardless of whether the field is empty or not. This may be
  9482. // used to include empty fields in Patch requests.
  9483. ForceSendFields []string `json:"-"`
  9484. // NullFields is a list of field names (e.g. "AccountId") to include in
  9485. // API requests with the JSON null value. By default, fields with empty
  9486. // values are omitted from API requests. However, any field with an
  9487. // empty value appearing in NullFields will be sent to the server as
  9488. // null. It is an error if a field in this list has a non-empty value.
  9489. // This may be used to include null fields in Patch requests.
  9490. NullFields []string `json:"-"`
  9491. }
  9492. func (s *Report) MarshalJSON() ([]byte, error) {
  9493. type NoMethod Report
  9494. raw := NoMethod(*s)
  9495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9496. }
  9497. // ReportCriteria: The report criteria for a report of type "STANDARD".
  9498. type ReportCriteria struct {
  9499. // Activities: Activity group.
  9500. Activities *Activities `json:"activities,omitempty"`
  9501. // CustomRichMediaEvents: Custom Rich Media Events group.
  9502. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9503. // DateRange: The date range for which this report should be run.
  9504. DateRange *DateRange `json:"dateRange,omitempty"`
  9505. // DimensionFilters: The list of filters on which dimensions are
  9506. // filtered.
  9507. // Filters for different dimensions are ANDed, filters for the same
  9508. // dimension are grouped together and ORed.
  9509. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9510. // Dimensions: The list of standard dimensions the report should
  9511. // include.
  9512. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9513. // MetricNames: The list of names of metrics the report should include.
  9514. MetricNames []string `json:"metricNames,omitempty"`
  9515. // ForceSendFields is a list of field names (e.g. "Activities") to
  9516. // unconditionally include in API requests. By default, fields with
  9517. // empty values are omitted from API requests. However, any non-pointer,
  9518. // non-interface field appearing in ForceSendFields will be sent to the
  9519. // server regardless of whether the field is empty or not. This may be
  9520. // used to include empty fields in Patch requests.
  9521. ForceSendFields []string `json:"-"`
  9522. // NullFields is a list of field names (e.g. "Activities") to include in
  9523. // API requests with the JSON null value. By default, fields with empty
  9524. // values are omitted from API requests. However, any field with an
  9525. // empty value appearing in NullFields will be sent to the server as
  9526. // null. It is an error if a field in this list has a non-empty value.
  9527. // This may be used to include null fields in Patch requests.
  9528. NullFields []string `json:"-"`
  9529. }
  9530. func (s *ReportCriteria) MarshalJSON() ([]byte, error) {
  9531. type NoMethod ReportCriteria
  9532. raw := NoMethod(*s)
  9533. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9534. }
  9535. // ReportCrossDimensionReachCriteria: The report criteria for a report
  9536. // of type "CROSS_DIMENSION_REACH".
  9537. type ReportCrossDimensionReachCriteria struct {
  9538. // Breakdown: The list of dimensions the report should include.
  9539. Breakdown []*SortedDimension `json:"breakdown,omitempty"`
  9540. // DateRange: The date range this report should be run for.
  9541. DateRange *DateRange `json:"dateRange,omitempty"`
  9542. // Dimension: The dimension option.
  9543. //
  9544. // Possible values:
  9545. // "ADVERTISER"
  9546. // "CAMPAIGN"
  9547. // "SITE_BY_ADVERTISER"
  9548. // "SITE_BY_CAMPAIGN"
  9549. Dimension string `json:"dimension,omitempty"`
  9550. // DimensionFilters: The list of filters on which dimensions are
  9551. // filtered.
  9552. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9553. // MetricNames: The list of names of metrics the report should include.
  9554. MetricNames []string `json:"metricNames,omitempty"`
  9555. // OverlapMetricNames: The list of names of overlap metrics the report
  9556. // should include.
  9557. OverlapMetricNames []string `json:"overlapMetricNames,omitempty"`
  9558. // Pivoted: Whether the report is pivoted or not. Defaults to true.
  9559. Pivoted bool `json:"pivoted,omitempty"`
  9560. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  9561. // unconditionally include in API requests. By default, fields with
  9562. // empty values are omitted from API requests. However, any non-pointer,
  9563. // non-interface field appearing in ForceSendFields will be sent to the
  9564. // server regardless of whether the field is empty or not. This may be
  9565. // used to include empty fields in Patch requests.
  9566. ForceSendFields []string `json:"-"`
  9567. // NullFields is a list of field names (e.g. "Breakdown") to include in
  9568. // API requests with the JSON null value. By default, fields with empty
  9569. // values are omitted from API requests. However, any field with an
  9570. // empty value appearing in NullFields will be sent to the server as
  9571. // null. It is an error if a field in this list has a non-empty value.
  9572. // This may be used to include null fields in Patch requests.
  9573. NullFields []string `json:"-"`
  9574. }
  9575. func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) {
  9576. type NoMethod ReportCrossDimensionReachCriteria
  9577. raw := NoMethod(*s)
  9578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9579. }
  9580. // ReportDelivery: The report's email delivery settings.
  9581. type ReportDelivery struct {
  9582. // EmailOwner: Whether the report should be emailed to the report owner.
  9583. EmailOwner bool `json:"emailOwner,omitempty"`
  9584. // EmailOwnerDeliveryType: The type of delivery for the owner to
  9585. // receive, if enabled.
  9586. //
  9587. // Possible values:
  9588. // "ATTACHMENT"
  9589. // "LINK"
  9590. EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"`
  9591. // Message: The message to be sent with each email.
  9592. Message string `json:"message,omitempty"`
  9593. // Recipients: The list of recipients to which to email the report.
  9594. Recipients []*Recipient `json:"recipients,omitempty"`
  9595. // ForceSendFields is a list of field names (e.g. "EmailOwner") to
  9596. // unconditionally include in API requests. By default, fields with
  9597. // empty values are omitted from API requests. However, any non-pointer,
  9598. // non-interface field appearing in ForceSendFields will be sent to the
  9599. // server regardless of whether the field is empty or not. This may be
  9600. // used to include empty fields in Patch requests.
  9601. ForceSendFields []string `json:"-"`
  9602. // NullFields is a list of field names (e.g. "EmailOwner") to include in
  9603. // API requests with the JSON null value. By default, fields with empty
  9604. // values are omitted from API requests. However, any field with an
  9605. // empty value appearing in NullFields will be sent to the server as
  9606. // null. It is an error if a field in this list has a non-empty value.
  9607. // This may be used to include null fields in Patch requests.
  9608. NullFields []string `json:"-"`
  9609. }
  9610. func (s *ReportDelivery) MarshalJSON() ([]byte, error) {
  9611. type NoMethod ReportDelivery
  9612. raw := NoMethod(*s)
  9613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9614. }
  9615. // ReportFloodlightCriteria: The report criteria for a report of type
  9616. // "FLOODLIGHT".
  9617. type ReportFloodlightCriteria struct {
  9618. // CustomRichMediaEvents: The list of custom rich media events to
  9619. // include.
  9620. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9621. // DateRange: The date range this report should be run for.
  9622. DateRange *DateRange `json:"dateRange,omitempty"`
  9623. // DimensionFilters: The list of filters on which dimensions are
  9624. // filtered.
  9625. // Filters for different dimensions are ANDed, filters for the same
  9626. // dimension are grouped together and ORed.
  9627. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9628. // Dimensions: The list of dimensions the report should include.
  9629. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9630. // FloodlightConfigId: The floodlight ID for which to show data in this
  9631. // report. All advertisers associated with that ID will automatically be
  9632. // added. The dimension of the value needs to be
  9633. // 'dfa:floodlightConfigId'.
  9634. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9635. // MetricNames: The list of names of metrics the report should include.
  9636. MetricNames []string `json:"metricNames,omitempty"`
  9637. // ReportProperties: The properties of the report.
  9638. ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"`
  9639. // ForceSendFields is a list of field names (e.g.
  9640. // "CustomRichMediaEvents") to unconditionally include in API requests.
  9641. // By default, fields with empty values are omitted from API requests.
  9642. // However, any non-pointer, non-interface field appearing in
  9643. // ForceSendFields will be sent to the server regardless of whether the
  9644. // field is empty or not. This may be used to include empty fields in
  9645. // Patch requests.
  9646. ForceSendFields []string `json:"-"`
  9647. // NullFields is a list of field names (e.g. "CustomRichMediaEvents") to
  9648. // include in API requests with the JSON null value. By default, fields
  9649. // with empty values are omitted from API requests. However, any field
  9650. // with an empty value appearing in NullFields will be sent to the
  9651. // server as null. It is an error if a field in this list has a
  9652. // non-empty value. This may be used to include null fields in Patch
  9653. // requests.
  9654. NullFields []string `json:"-"`
  9655. }
  9656. func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) {
  9657. type NoMethod ReportFloodlightCriteria
  9658. raw := NoMethod(*s)
  9659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9660. }
  9661. // ReportFloodlightCriteriaReportProperties: The properties of the
  9662. // report.
  9663. type ReportFloodlightCriteriaReportProperties struct {
  9664. // IncludeAttributedIPConversions: Include conversions that have no
  9665. // cookie, but do have an exposure path.
  9666. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9667. // IncludeUnattributedCookieConversions: Include conversions of users
  9668. // with a DoubleClick cookie but without an exposure. That means the
  9669. // user did not click or see an ad from the advertiser within the
  9670. // Floodlight group, or that the interaction happened outside the
  9671. // lookback window.
  9672. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9673. // IncludeUnattributedIPConversions: Include conversions that have no
  9674. // associated cookies and no exposures. It’s therefore impossible to
  9675. // know how the user was exposed to your ads during the lookback window
  9676. // prior to a conversion.
  9677. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9678. // ForceSendFields is a list of field names (e.g.
  9679. // "IncludeAttributedIPConversions") to unconditionally include in API
  9680. // requests. By default, fields with empty values are omitted from API
  9681. // requests. However, any non-pointer, non-interface field appearing in
  9682. // ForceSendFields will be sent to the server regardless of whether the
  9683. // field is empty or not. This may be used to include empty fields in
  9684. // Patch requests.
  9685. ForceSendFields []string `json:"-"`
  9686. // NullFields is a list of field names (e.g.
  9687. // "IncludeAttributedIPConversions") to include in API requests with the
  9688. // JSON null value. By default, fields with empty values are omitted
  9689. // from API requests. However, any field with an empty value appearing
  9690. // in NullFields will be sent to the server as null. It is an error if a
  9691. // field in this list has a non-empty value. This may be used to include
  9692. // null fields in Patch requests.
  9693. NullFields []string `json:"-"`
  9694. }
  9695. func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9696. type NoMethod ReportFloodlightCriteriaReportProperties
  9697. raw := NoMethod(*s)
  9698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9699. }
  9700. // ReportPathToConversionCriteria: The report criteria for a report of
  9701. // type "PATH_TO_CONVERSION".
  9702. type ReportPathToConversionCriteria struct {
  9703. // ActivityFilters: The list of 'dfa:activity' values to filter on.
  9704. ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"`
  9705. // ConversionDimensions: The list of conversion dimensions the report
  9706. // should include.
  9707. ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"`
  9708. // CustomFloodlightVariables: The list of custom floodlight variables
  9709. // the report should include.
  9710. CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"`
  9711. // CustomRichMediaEvents: The list of custom rich media events to
  9712. // include.
  9713. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9714. // DateRange: The date range this report should be run for.
  9715. DateRange *DateRange `json:"dateRange,omitempty"`
  9716. // FloodlightConfigId: The floodlight ID for which to show data in this
  9717. // report. All advertisers associated with that ID will automatically be
  9718. // added. The dimension of the value needs to be
  9719. // 'dfa:floodlightConfigId'.
  9720. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9721. // MetricNames: The list of names of metrics the report should include.
  9722. MetricNames []string `json:"metricNames,omitempty"`
  9723. // PerInteractionDimensions: The list of per interaction dimensions the
  9724. // report should include.
  9725. PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"`
  9726. // ReportProperties: The properties of the report.
  9727. ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"`
  9728. // ForceSendFields is a list of field names (e.g. "ActivityFilters") to
  9729. // unconditionally include in API requests. By default, fields with
  9730. // empty values are omitted from API requests. However, any non-pointer,
  9731. // non-interface field appearing in ForceSendFields will be sent to the
  9732. // server regardless of whether the field is empty or not. This may be
  9733. // used to include empty fields in Patch requests.
  9734. ForceSendFields []string `json:"-"`
  9735. // NullFields is a list of field names (e.g. "ActivityFilters") to
  9736. // include in API requests with the JSON null value. By default, fields
  9737. // with empty values are omitted from API requests. However, any field
  9738. // with an empty value appearing in NullFields will be sent to the
  9739. // server as null. It is an error if a field in this list has a
  9740. // non-empty value. This may be used to include null fields in Patch
  9741. // requests.
  9742. NullFields []string `json:"-"`
  9743. }
  9744. func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) {
  9745. type NoMethod ReportPathToConversionCriteria
  9746. raw := NoMethod(*s)
  9747. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9748. }
  9749. // ReportPathToConversionCriteriaReportProperties: The properties of the
  9750. // report.
  9751. type ReportPathToConversionCriteriaReportProperties struct {
  9752. // ClicksLookbackWindow: DFA checks to see if a click interaction
  9753. // occurred within the specified period of time before a conversion. By
  9754. // default the value is pulled from Floodlight or you can manually enter
  9755. // a custom value. Valid values: 1-90.
  9756. ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"`
  9757. // ImpressionsLookbackWindow: DFA checks to see if an impression
  9758. // interaction occurred within the specified period of time before a
  9759. // conversion. By default the value is pulled from Floodlight or you can
  9760. // manually enter a custom value. Valid values: 1-90.
  9761. ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"`
  9762. // IncludeAttributedIPConversions: Deprecated: has no effect.
  9763. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9764. // IncludeUnattributedCookieConversions: Include conversions of users
  9765. // with a DoubleClick cookie but without an exposure. That means the
  9766. // user did not click or see an ad from the advertiser within the
  9767. // Floodlight group, or that the interaction happened outside the
  9768. // lookback window.
  9769. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9770. // IncludeUnattributedIPConversions: Include conversions that have no
  9771. // associated cookies and no exposures. It’s therefore impossible to
  9772. // know how the user was exposed to your ads during the lookback window
  9773. // prior to a conversion.
  9774. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9775. // MaximumClickInteractions: The maximum number of click interactions to
  9776. // include in the report. Advertisers currently paying for E2C reports
  9777. // get up to 200 (100 clicks, 100 impressions). If another advertiser in
  9778. // your network is paying for E2C, you can have up to 5 total exposures
  9779. // per report.
  9780. MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"`
  9781. // MaximumImpressionInteractions: The maximum number of click
  9782. // interactions to include in the report. Advertisers currently paying
  9783. // for E2C reports get up to 200 (100 clicks, 100 impressions). If
  9784. // another advertiser in your network is paying for E2C, you can have up
  9785. // to 5 total exposures per report.
  9786. MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"`
  9787. // MaximumInteractionGap: The maximum amount of time that can take place
  9788. // between interactions (clicks or impressions) by the same user. Valid
  9789. // values: 1-90.
  9790. MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"`
  9791. // PivotOnInteractionPath: Enable pivoting on interaction path.
  9792. PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"`
  9793. // ForceSendFields is a list of field names (e.g.
  9794. // "ClicksLookbackWindow") to unconditionally include in API requests.
  9795. // By default, fields with empty values are omitted from API requests.
  9796. // However, any non-pointer, non-interface field appearing in
  9797. // ForceSendFields will be sent to the server regardless of whether the
  9798. // field is empty or not. This may be used to include empty fields in
  9799. // Patch requests.
  9800. ForceSendFields []string `json:"-"`
  9801. // NullFields is a list of field names (e.g. "ClicksLookbackWindow") to
  9802. // include in API requests with the JSON null value. By default, fields
  9803. // with empty values are omitted from API requests. However, any field
  9804. // with an empty value appearing in NullFields will be sent to the
  9805. // server as null. It is an error if a field in this list has a
  9806. // non-empty value. This may be used to include null fields in Patch
  9807. // requests.
  9808. NullFields []string `json:"-"`
  9809. }
  9810. func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9811. type NoMethod ReportPathToConversionCriteriaReportProperties
  9812. raw := NoMethod(*s)
  9813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9814. }
  9815. // ReportReachCriteria: The report criteria for a report of type
  9816. // "REACH".
  9817. type ReportReachCriteria struct {
  9818. // Activities: Activity group.
  9819. Activities *Activities `json:"activities,omitempty"`
  9820. // CustomRichMediaEvents: Custom Rich Media Events group.
  9821. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9822. // DateRange: The date range this report should be run for.
  9823. DateRange *DateRange `json:"dateRange,omitempty"`
  9824. // DimensionFilters: The list of filters on which dimensions are
  9825. // filtered.
  9826. // Filters for different dimensions are ANDed, filters for the same
  9827. // dimension are grouped together and ORed.
  9828. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9829. // Dimensions: The list of dimensions the report should include.
  9830. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9831. // EnableAllDimensionCombinations: Whether to enable all reach dimension
  9832. // combinations in the report. Defaults to false. If enabled, the date
  9833. // range of the report should be within the last 42 days.
  9834. EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,omitempty"`
  9835. // MetricNames: The list of names of metrics the report should include.
  9836. MetricNames []string `json:"metricNames,omitempty"`
  9837. // ReachByFrequencyMetricNames: The list of names of Reach By Frequency
  9838. // metrics the report should include.
  9839. ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"`
  9840. // ForceSendFields is a list of field names (e.g. "Activities") to
  9841. // unconditionally include in API requests. By default, fields with
  9842. // empty values are omitted from API requests. However, any non-pointer,
  9843. // non-interface field appearing in ForceSendFields will be sent to the
  9844. // server regardless of whether the field is empty or not. This may be
  9845. // used to include empty fields in Patch requests.
  9846. ForceSendFields []string `json:"-"`
  9847. // NullFields is a list of field names (e.g. "Activities") to include in
  9848. // API requests with the JSON null value. By default, fields with empty
  9849. // values are omitted from API requests. However, any field with an
  9850. // empty value appearing in NullFields will be sent to the server as
  9851. // null. It is an error if a field in this list has a non-empty value.
  9852. // This may be used to include null fields in Patch requests.
  9853. NullFields []string `json:"-"`
  9854. }
  9855. func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) {
  9856. type NoMethod ReportReachCriteria
  9857. raw := NoMethod(*s)
  9858. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9859. }
  9860. // ReportSchedule: The report's schedule. Can only be set if the
  9861. // report's 'dateRange' is a relative date range and the relative date
  9862. // range is not "TODAY".
  9863. type ReportSchedule struct {
  9864. // Active: Whether the schedule is active or not. Must be set to either
  9865. // true or false.
  9866. Active bool `json:"active,omitempty"`
  9867. // Every: Defines every how many days, weeks or months the report should
  9868. // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or
  9869. // "MONTHLY".
  9870. Every int64 `json:"every,omitempty"`
  9871. // ExpirationDate: The expiration date when the scheduled report stops
  9872. // running.
  9873. ExpirationDate string `json:"expirationDate,omitempty"`
  9874. // Repeats: The interval for which the report is repeated. Note:
  9875. // - "DAILY" also requires field "every" to be set.
  9876. // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be
  9877. // set.
  9878. // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be
  9879. // set.
  9880. Repeats string `json:"repeats,omitempty"`
  9881. // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled
  9882. // reports should run.
  9883. //
  9884. // Possible values:
  9885. // "FRIDAY"
  9886. // "MONDAY"
  9887. // "SATURDAY"
  9888. // "SUNDAY"
  9889. // "THURSDAY"
  9890. // "TUESDAY"
  9891. // "WEDNESDAY"
  9892. RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"`
  9893. // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports
  9894. // whether reports should be repeated on the same day of the month as
  9895. // "startDate" or the same day of the week of the month.
  9896. // Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02),
  9897. // "DAY_OF_MONTH" would run subsequent reports on the 2nd of every
  9898. // Month, and "WEEK_OF_MONTH" would run subsequent reports on the first
  9899. // Monday of the month.
  9900. //
  9901. // Possible values:
  9902. // "DAY_OF_MONTH"
  9903. // "WEEK_OF_MONTH"
  9904. RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"`
  9905. // StartDate: Start date of date range for which scheduled reports
  9906. // should be run.
  9907. StartDate string `json:"startDate,omitempty"`
  9908. // ForceSendFields is a list of field names (e.g. "Active") to
  9909. // unconditionally include in API requests. By default, fields with
  9910. // empty values are omitted from API requests. However, any non-pointer,
  9911. // non-interface field appearing in ForceSendFields will be sent to the
  9912. // server regardless of whether the field is empty or not. This may be
  9913. // used to include empty fields in Patch requests.
  9914. ForceSendFields []string `json:"-"`
  9915. // NullFields is a list of field names (e.g. "Active") to include in API
  9916. // requests with the JSON null value. By default, fields with empty
  9917. // values are omitted from API requests. However, any field with an
  9918. // empty value appearing in NullFields will be sent to the server as
  9919. // null. It is an error if a field in this list has a non-empty value.
  9920. // This may be used to include null fields in Patch requests.
  9921. NullFields []string `json:"-"`
  9922. }
  9923. func (s *ReportSchedule) MarshalJSON() ([]byte, error) {
  9924. type NoMethod ReportSchedule
  9925. raw := NoMethod(*s)
  9926. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9927. }
  9928. // ReportCompatibleFields: Represents fields that are compatible to be
  9929. // selected for a report of type "STANDARD".
  9930. type ReportCompatibleFields struct {
  9931. // DimensionFilters: Dimensions which are compatible to be selected in
  9932. // the "dimensionFilters" section of the report.
  9933. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9934. // Dimensions: Dimensions which are compatible to be selected in the
  9935. // "dimensions" section of the report.
  9936. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9937. // Kind: The kind of resource this is, in this case
  9938. // dfareporting#reportCompatibleFields.
  9939. Kind string `json:"kind,omitempty"`
  9940. // Metrics: Metrics which are compatible to be selected in the
  9941. // "metricNames" section of the report.
  9942. Metrics []*Metric `json:"metrics,omitempty"`
  9943. // PivotedActivityMetrics: Metrics which are compatible to be selected
  9944. // as activity metrics to pivot on in the "activities" section of the
  9945. // report.
  9946. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  9947. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  9948. // unconditionally include in API requests. By default, fields with
  9949. // empty values are omitted from API requests. However, any non-pointer,
  9950. // non-interface field appearing in ForceSendFields will be sent to the
  9951. // server regardless of whether the field is empty or not. This may be
  9952. // used to include empty fields in Patch requests.
  9953. ForceSendFields []string `json:"-"`
  9954. // NullFields is a list of field names (e.g. "DimensionFilters") to
  9955. // include in API requests with the JSON null value. By default, fields
  9956. // with empty values are omitted from API requests. However, any field
  9957. // with an empty value appearing in NullFields will be sent to the
  9958. // server as null. It is an error if a field in this list has a
  9959. // non-empty value. This may be used to include null fields in Patch
  9960. // requests.
  9961. NullFields []string `json:"-"`
  9962. }
  9963. func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) {
  9964. type NoMethod ReportCompatibleFields
  9965. raw := NoMethod(*s)
  9966. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9967. }
  9968. // ReportList: Represents the list of reports.
  9969. type ReportList struct {
  9970. // Etag: The eTag of this response for caching purposes.
  9971. Etag string `json:"etag,omitempty"`
  9972. // Items: The reports returned in this response.
  9973. Items []*Report `json:"items,omitempty"`
  9974. // Kind: The kind of list this is, in this case dfareporting#reportList.
  9975. Kind string `json:"kind,omitempty"`
  9976. // NextPageToken: Continuation token used to page through reports. To
  9977. // retrieve the next page of results, set the next request's "pageToken"
  9978. // to the value of this field. The page token is only valid for a
  9979. // limited amount of time and should not be persisted.
  9980. NextPageToken string `json:"nextPageToken,omitempty"`
  9981. // ServerResponse contains the HTTP response code and headers from the
  9982. // server.
  9983. googleapi.ServerResponse `json:"-"`
  9984. // ForceSendFields is a list of field names (e.g. "Etag") to
  9985. // unconditionally include in API requests. By default, fields with
  9986. // empty values are omitted from API requests. However, any non-pointer,
  9987. // non-interface field appearing in ForceSendFields will be sent to the
  9988. // server regardless of whether the field is empty or not. This may be
  9989. // used to include empty fields in Patch requests.
  9990. ForceSendFields []string `json:"-"`
  9991. // NullFields is a list of field names (e.g. "Etag") to include in API
  9992. // requests with the JSON null value. By default, fields with empty
  9993. // values are omitted from API requests. However, any field with an
  9994. // empty value appearing in NullFields will be sent to the server as
  9995. // null. It is an error if a field in this list has a non-empty value.
  9996. // This may be used to include null fields in Patch requests.
  9997. NullFields []string `json:"-"`
  9998. }
  9999. func (s *ReportList) MarshalJSON() ([]byte, error) {
  10000. type NoMethod ReportList
  10001. raw := NoMethod(*s)
  10002. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10003. }
  10004. // ReportsConfiguration: Reporting Configuration
  10005. type ReportsConfiguration struct {
  10006. // ExposureToConversionEnabled: Whether the exposure to conversion
  10007. // report is enabled. This report shows detailed pathway information on
  10008. // up to 10 of the most recent ad exposures seen by a user before
  10009. // converting.
  10010. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  10011. // LookbackConfiguration: Default lookback windows for new advertisers
  10012. // in this account.
  10013. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10014. // ReportGenerationTimeZoneId: Report generation time zone ID of this
  10015. // account. This is a required field that can only be changed by a
  10016. // superuser.
  10017. // Acceptable values are:
  10018. //
  10019. // - "1" for "America/New_York"
  10020. // - "2" for "Europe/London"
  10021. // - "3" for "Europe/Paris"
  10022. // - "4" for "Africa/Johannesburg"
  10023. // - "5" for "Asia/Jerusalem"
  10024. // - "6" for "Asia/Shanghai"
  10025. // - "7" for "Asia/Hong_Kong"
  10026. // - "8" for "Asia/Tokyo"
  10027. // - "9" for "Australia/Sydney"
  10028. // - "10" for "Asia/Dubai"
  10029. // - "11" for "America/Los_Angeles"
  10030. // - "12" for "Pacific/Auckland"
  10031. // - "13" for "America/Sao_Paulo"
  10032. ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"`
  10033. // ForceSendFields is a list of field names (e.g.
  10034. // "ExposureToConversionEnabled") to unconditionally include in API
  10035. // requests. By default, fields with empty values are omitted from API
  10036. // requests. However, any non-pointer, non-interface field appearing in
  10037. // ForceSendFields will be sent to the server regardless of whether the
  10038. // field is empty or not. This may be used to include empty fields in
  10039. // Patch requests.
  10040. ForceSendFields []string `json:"-"`
  10041. // NullFields is a list of field names (e.g.
  10042. // "ExposureToConversionEnabled") to include in API requests with the
  10043. // JSON null value. By default, fields with empty values are omitted
  10044. // from API requests. However, any field with an empty value appearing
  10045. // in NullFields will be sent to the server as null. It is an error if a
  10046. // field in this list has a non-empty value. This may be used to include
  10047. // null fields in Patch requests.
  10048. NullFields []string `json:"-"`
  10049. }
  10050. func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) {
  10051. type NoMethod ReportsConfiguration
  10052. raw := NoMethod(*s)
  10053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10054. }
  10055. // RichMediaExitOverride: Rich Media Exit Override.
  10056. type RichMediaExitOverride struct {
  10057. // ClickThroughUrl: Click-through URL of this rich media exit override.
  10058. // Applicable if the enabled field is set to true.
  10059. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  10060. // Enabled: Whether to use the clickThroughUrl. If false, the
  10061. // creative-level exit will be used.
  10062. Enabled bool `json:"enabled,omitempty"`
  10063. // ExitId: ID for the override to refer to a specific exit in the
  10064. // creative.
  10065. ExitId int64 `json:"exitId,omitempty,string"`
  10066. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  10067. // unconditionally include in API requests. By default, fields with
  10068. // empty values are omitted from API requests. However, any non-pointer,
  10069. // non-interface field appearing in ForceSendFields will be sent to the
  10070. // server regardless of whether the field is empty or not. This may be
  10071. // used to include empty fields in Patch requests.
  10072. ForceSendFields []string `json:"-"`
  10073. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  10074. // include in API requests with the JSON null value. By default, fields
  10075. // with empty values are omitted from API requests. However, any field
  10076. // with an empty value appearing in NullFields will be sent to the
  10077. // server as null. It is an error if a field in this list has a
  10078. // non-empty value. This may be used to include null fields in Patch
  10079. // requests.
  10080. NullFields []string `json:"-"`
  10081. }
  10082. func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) {
  10083. type NoMethod RichMediaExitOverride
  10084. raw := NoMethod(*s)
  10085. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10086. }
  10087. // Rule: A rule associates an asset with a targeting template for
  10088. // asset-level targeting. Applicable to INSTREAM_VIDEO creatives.
  10089. type Rule struct {
  10090. // AssetId: A creativeAssets[].id. This should refer to one of the
  10091. // parent assets in this creative. This is a required field.
  10092. AssetId int64 `json:"assetId,omitempty,string"`
  10093. // Name: A user-friendly name for this rule. This is a required field.
  10094. Name string `json:"name,omitempty"`
  10095. // TargetingTemplateId: A targeting template ID. The targeting from the
  10096. // targeting template will be used to determine whether this asset
  10097. // should be served. This is a required field.
  10098. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  10099. // ForceSendFields is a list of field names (e.g. "AssetId") to
  10100. // unconditionally include in API requests. By default, fields with
  10101. // empty values are omitted from API requests. However, any non-pointer,
  10102. // non-interface field appearing in ForceSendFields will be sent to the
  10103. // server regardless of whether the field is empty or not. This may be
  10104. // used to include empty fields in Patch requests.
  10105. ForceSendFields []string `json:"-"`
  10106. // NullFields is a list of field names (e.g. "AssetId") to include in
  10107. // API requests with the JSON null value. By default, fields with empty
  10108. // values are omitted from API requests. However, any field with an
  10109. // empty value appearing in NullFields will be sent to the server as
  10110. // null. It is an error if a field in this list has a non-empty value.
  10111. // This may be used to include null fields in Patch requests.
  10112. NullFields []string `json:"-"`
  10113. }
  10114. func (s *Rule) MarshalJSON() ([]byte, error) {
  10115. type NoMethod Rule
  10116. raw := NoMethod(*s)
  10117. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10118. }
  10119. // Site: Contains properties of a site.
  10120. type Site struct {
  10121. // AccountId: Account ID of this site. This is a read-only field that
  10122. // can be left blank.
  10123. AccountId int64 `json:"accountId,omitempty,string"`
  10124. // Approved: Whether this site is approved.
  10125. Approved bool `json:"approved,omitempty"`
  10126. // DirectorySiteId: Directory site associated with this site. This is a
  10127. // required field that is read-only after insertion.
  10128. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  10129. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  10130. // directory site. This is a read-only, auto-generated field.
  10131. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  10132. // Id: ID of this site. This is a read-only, auto-generated field.
  10133. Id int64 `json:"id,omitempty,string"`
  10134. // IdDimensionValue: Dimension value for the ID of this site. This is a
  10135. // read-only, auto-generated field.
  10136. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  10137. // KeyName: Key name of this site. This is a read-only, auto-generated
  10138. // field.
  10139. KeyName string `json:"keyName,omitempty"`
  10140. // Kind: Identifies what kind of resource this is. Value: the fixed
  10141. // string "dfareporting#site".
  10142. Kind string `json:"kind,omitempty"`
  10143. // Name: Name of this site.This is a required field. Must be less than
  10144. // 128 characters long. If this site is under a subaccount, the name
  10145. // must be unique among sites of the same subaccount. Otherwise, this
  10146. // site is a top-level site, and the name must be unique among top-level
  10147. // sites of the same account.
  10148. Name string `json:"name,omitempty"`
  10149. // SiteContacts: Site contacts.
  10150. SiteContacts []*SiteContact `json:"siteContacts,omitempty"`
  10151. // SiteSettings: Site-wide settings.
  10152. SiteSettings *SiteSettings `json:"siteSettings,omitempty"`
  10153. // SubaccountId: Subaccount ID of this site. This is a read-only field
  10154. // that can be left blank.
  10155. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10156. // ServerResponse contains the HTTP response code and headers from the
  10157. // server.
  10158. googleapi.ServerResponse `json:"-"`
  10159. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10160. // unconditionally include in API requests. By default, fields with
  10161. // empty values are omitted from API requests. However, any non-pointer,
  10162. // non-interface field appearing in ForceSendFields will be sent to the
  10163. // server regardless of whether the field is empty or not. This may be
  10164. // used to include empty fields in Patch requests.
  10165. ForceSendFields []string `json:"-"`
  10166. // NullFields is a list of field names (e.g. "AccountId") to include in
  10167. // API requests with the JSON null value. By default, fields with empty
  10168. // values are omitted from API requests. However, any field with an
  10169. // empty value appearing in NullFields will be sent to the server as
  10170. // null. It is an error if a field in this list has a non-empty value.
  10171. // This may be used to include null fields in Patch requests.
  10172. NullFields []string `json:"-"`
  10173. }
  10174. func (s *Site) MarshalJSON() ([]byte, error) {
  10175. type NoMethod Site
  10176. raw := NoMethod(*s)
  10177. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10178. }
  10179. // SiteContact: Site Contact
  10180. type SiteContact struct {
  10181. // Address: Address of this site contact.
  10182. Address string `json:"address,omitempty"`
  10183. // ContactType: Site contact type.
  10184. //
  10185. // Possible values:
  10186. // "SALES_PERSON"
  10187. // "TRAFFICKER"
  10188. ContactType string `json:"contactType,omitempty"`
  10189. // Email: Email address of this site contact. This is a required field.
  10190. Email string `json:"email,omitempty"`
  10191. // FirstName: First name of this site contact.
  10192. FirstName string `json:"firstName,omitempty"`
  10193. // Id: ID of this site contact. This is a read-only, auto-generated
  10194. // field.
  10195. Id int64 `json:"id,omitempty,string"`
  10196. // LastName: Last name of this site contact.
  10197. LastName string `json:"lastName,omitempty"`
  10198. // Phone: Primary phone number of this site contact.
  10199. Phone string `json:"phone,omitempty"`
  10200. // Title: Title or designation of this site contact.
  10201. Title string `json:"title,omitempty"`
  10202. // ForceSendFields is a list of field names (e.g. "Address") to
  10203. // unconditionally include in API requests. By default, fields with
  10204. // empty values are omitted from API requests. However, any non-pointer,
  10205. // non-interface field appearing in ForceSendFields will be sent to the
  10206. // server regardless of whether the field is empty or not. This may be
  10207. // used to include empty fields in Patch requests.
  10208. ForceSendFields []string `json:"-"`
  10209. // NullFields is a list of field names (e.g. "Address") to include in
  10210. // API requests with the JSON null value. By default, fields with empty
  10211. // values are omitted from API requests. However, any field with an
  10212. // empty value appearing in NullFields will be sent to the server as
  10213. // null. It is an error if a field in this list has a non-empty value.
  10214. // This may be used to include null fields in Patch requests.
  10215. NullFields []string `json:"-"`
  10216. }
  10217. func (s *SiteContact) MarshalJSON() ([]byte, error) {
  10218. type NoMethod SiteContact
  10219. raw := NoMethod(*s)
  10220. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10221. }
  10222. // SiteSettings: Site Settings
  10223. type SiteSettings struct {
  10224. // ActiveViewOptOut: Whether active view creatives are disabled for this
  10225. // site.
  10226. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  10227. // AdBlockingOptOut: Whether this site opts out of ad blocking. When
  10228. // true, ad blocking is disabled for all placements under the site,
  10229. // regardless of the individual placement settings. When false, the
  10230. // campaign and placement settings take effect.
  10231. AdBlockingOptOut bool `json:"adBlockingOptOut,omitempty"`
  10232. // CreativeSettings: Site-wide creative settings.
  10233. CreativeSettings *CreativeSettings `json:"creativeSettings,omitempty"`
  10234. // DisableNewCookie: Whether new cookies are disabled for this site.
  10235. DisableNewCookie bool `json:"disableNewCookie,omitempty"`
  10236. // LookbackConfiguration: Lookback window settings for this site.
  10237. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10238. // TagSetting: Configuration settings for dynamic and image floodlight
  10239. // tags.
  10240. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  10241. // VideoActiveViewOptOutTemplate: Whether Verification and ActiveView
  10242. // for in-stream video creatives are disabled by default for new
  10243. // placements created under this site. This value will be used to
  10244. // populate the placement.videoActiveViewOptOut field, when no value is
  10245. // specified for the new placement.
  10246. VideoActiveViewOptOutTemplate bool `json:"videoActiveViewOptOutTemplate,omitempty"`
  10247. // VpaidAdapterChoiceTemplate: Default VPAID adapter setting for new
  10248. // placements created under this site. This value will be used to
  10249. // populate the placements.vpaidAdapterChoice field, when no value is
  10250. // specified for the new placement. Controls which VPAID format the
  10251. // measurement adapter will use for in-stream video creatives assigned
  10252. // to the placement. The publisher's specifications will typically
  10253. // determine this setting. For VPAID creatives, the adapter format will
  10254. // match the VPAID format (HTML5 VPAID creatives use the HTML5
  10255. // adapter).
  10256. //
  10257. // Note: Flash is no longer supported. This field now defaults to HTML5
  10258. // when the following values are provided: FLASH, BOTH.
  10259. //
  10260. // Possible values:
  10261. // "BOTH"
  10262. // "DEFAULT"
  10263. // "FLASH"
  10264. // "HTML5"
  10265. VpaidAdapterChoiceTemplate string `json:"vpaidAdapterChoiceTemplate,omitempty"`
  10266. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  10267. // unconditionally include in API requests. By default, fields with
  10268. // empty values are omitted from API requests. However, any non-pointer,
  10269. // non-interface field appearing in ForceSendFields will be sent to the
  10270. // server regardless of whether the field is empty or not. This may be
  10271. // used to include empty fields in Patch requests.
  10272. ForceSendFields []string `json:"-"`
  10273. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  10274. // include in API requests with the JSON null value. By default, fields
  10275. // with empty values are omitted from API requests. However, any field
  10276. // with an empty value appearing in NullFields will be sent to the
  10277. // server as null. It is an error if a field in this list has a
  10278. // non-empty value. This may be used to include null fields in Patch
  10279. // requests.
  10280. NullFields []string `json:"-"`
  10281. }
  10282. func (s *SiteSettings) MarshalJSON() ([]byte, error) {
  10283. type NoMethod SiteSettings
  10284. raw := NoMethod(*s)
  10285. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10286. }
  10287. // SitesListResponse: Site List Response
  10288. type SitesListResponse struct {
  10289. // Kind: Identifies what kind of resource this is. Value: the fixed
  10290. // string "dfareporting#sitesListResponse".
  10291. Kind string `json:"kind,omitempty"`
  10292. // NextPageToken: Pagination token to be used for the next list
  10293. // operation.
  10294. NextPageToken string `json:"nextPageToken,omitempty"`
  10295. // Sites: Site collection.
  10296. Sites []*Site `json:"sites,omitempty"`
  10297. // ServerResponse contains the HTTP response code and headers from the
  10298. // server.
  10299. googleapi.ServerResponse `json:"-"`
  10300. // ForceSendFields is a list of field names (e.g. "Kind") to
  10301. // unconditionally include in API requests. By default, fields with
  10302. // empty values are omitted from API requests. However, any non-pointer,
  10303. // non-interface field appearing in ForceSendFields will be sent to the
  10304. // server regardless of whether the field is empty or not. This may be
  10305. // used to include empty fields in Patch requests.
  10306. ForceSendFields []string `json:"-"`
  10307. // NullFields is a list of field names (e.g. "Kind") to include in API
  10308. // requests with the JSON null value. By default, fields with empty
  10309. // values are omitted from API requests. However, any field with an
  10310. // empty value appearing in NullFields will be sent to the server as
  10311. // null. It is an error if a field in this list has a non-empty value.
  10312. // This may be used to include null fields in Patch requests.
  10313. NullFields []string `json:"-"`
  10314. }
  10315. func (s *SitesListResponse) MarshalJSON() ([]byte, error) {
  10316. type NoMethod SitesListResponse
  10317. raw := NoMethod(*s)
  10318. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10319. }
  10320. // Size: Represents the dimensions of ads, placements, creatives, or
  10321. // creative assets.
  10322. type Size struct {
  10323. // Height: Height of this size. Acceptable values are 0 to 32767,
  10324. // inclusive.
  10325. Height int64 `json:"height,omitempty"`
  10326. // Iab: IAB standard size. This is a read-only, auto-generated field.
  10327. Iab bool `json:"iab,omitempty"`
  10328. // Id: ID of this size. This is a read-only, auto-generated field.
  10329. Id int64 `json:"id,omitempty,string"`
  10330. // Kind: Identifies what kind of resource this is. Value: the fixed
  10331. // string "dfareporting#size".
  10332. Kind string `json:"kind,omitempty"`
  10333. // Width: Width of this size. Acceptable values are 0 to 32767,
  10334. // inclusive.
  10335. Width int64 `json:"width,omitempty"`
  10336. // ServerResponse contains the HTTP response code and headers from the
  10337. // server.
  10338. googleapi.ServerResponse `json:"-"`
  10339. // ForceSendFields is a list of field names (e.g. "Height") to
  10340. // unconditionally include in API requests. By default, fields with
  10341. // empty values are omitted from API requests. However, any non-pointer,
  10342. // non-interface field appearing in ForceSendFields will be sent to the
  10343. // server regardless of whether the field is empty or not. This may be
  10344. // used to include empty fields in Patch requests.
  10345. ForceSendFields []string `json:"-"`
  10346. // NullFields is a list of field names (e.g. "Height") to include in API
  10347. // requests with the JSON null value. By default, fields with empty
  10348. // values are omitted from API requests. However, any field with an
  10349. // empty value appearing in NullFields will be sent to the server as
  10350. // null. It is an error if a field in this list has a non-empty value.
  10351. // This may be used to include null fields in Patch requests.
  10352. NullFields []string `json:"-"`
  10353. }
  10354. func (s *Size) MarshalJSON() ([]byte, error) {
  10355. type NoMethod Size
  10356. raw := NoMethod(*s)
  10357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10358. }
  10359. // SizesListResponse: Size List Response
  10360. type SizesListResponse struct {
  10361. // Kind: Identifies what kind of resource this is. Value: the fixed
  10362. // string "dfareporting#sizesListResponse".
  10363. Kind string `json:"kind,omitempty"`
  10364. // Sizes: Size collection.
  10365. Sizes []*Size `json:"sizes,omitempty"`
  10366. // ServerResponse contains the HTTP response code and headers from the
  10367. // server.
  10368. googleapi.ServerResponse `json:"-"`
  10369. // ForceSendFields is a list of field names (e.g. "Kind") to
  10370. // unconditionally include in API requests. By default, fields with
  10371. // empty values are omitted from API requests. However, any non-pointer,
  10372. // non-interface field appearing in ForceSendFields will be sent to the
  10373. // server regardless of whether the field is empty or not. This may be
  10374. // used to include empty fields in Patch requests.
  10375. ForceSendFields []string `json:"-"`
  10376. // NullFields is a list of field names (e.g. "Kind") to include in API
  10377. // requests with the JSON null value. By default, fields with empty
  10378. // values are omitted from API requests. However, any field with an
  10379. // empty value appearing in NullFields will be sent to the server as
  10380. // null. It is an error if a field in this list has a non-empty value.
  10381. // This may be used to include null fields in Patch requests.
  10382. NullFields []string `json:"-"`
  10383. }
  10384. func (s *SizesListResponse) MarshalJSON() ([]byte, error) {
  10385. type NoMethod SizesListResponse
  10386. raw := NoMethod(*s)
  10387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10388. }
  10389. // SkippableSetting: Skippable Settings
  10390. type SkippableSetting struct {
  10391. // Kind: Identifies what kind of resource this is. Value: the fixed
  10392. // string "dfareporting#skippableSetting".
  10393. Kind string `json:"kind,omitempty"`
  10394. // ProgressOffset: Amount of time to play videos served to this
  10395. // placement before counting a view. Applicable when skippable is true.
  10396. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  10397. // SkipOffset: Amount of time to play videos served to this placement
  10398. // before the skip button should appear. Applicable when skippable is
  10399. // true.
  10400. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  10401. // Skippable: Whether the user can skip creatives served to this
  10402. // placement.
  10403. Skippable bool `json:"skippable,omitempty"`
  10404. // ForceSendFields is a list of field names (e.g. "Kind") to
  10405. // unconditionally include in API requests. By default, fields with
  10406. // empty values are omitted from API requests. However, any non-pointer,
  10407. // non-interface field appearing in ForceSendFields will be sent to the
  10408. // server regardless of whether the field is empty or not. This may be
  10409. // used to include empty fields in Patch requests.
  10410. ForceSendFields []string `json:"-"`
  10411. // NullFields is a list of field names (e.g. "Kind") to include in API
  10412. // requests with the JSON null value. By default, fields with empty
  10413. // values are omitted from API requests. However, any field with an
  10414. // empty value appearing in NullFields will be sent to the server as
  10415. // null. It is an error if a field in this list has a non-empty value.
  10416. // This may be used to include null fields in Patch requests.
  10417. NullFields []string `json:"-"`
  10418. }
  10419. func (s *SkippableSetting) MarshalJSON() ([]byte, error) {
  10420. type NoMethod SkippableSetting
  10421. raw := NoMethod(*s)
  10422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10423. }
  10424. // SortedDimension: Represents a sorted dimension.
  10425. type SortedDimension struct {
  10426. // Kind: The kind of resource this is, in this case
  10427. // dfareporting#sortedDimension.
  10428. Kind string `json:"kind,omitempty"`
  10429. // Name: The name of the dimension.
  10430. Name string `json:"name,omitempty"`
  10431. // SortOrder: An optional sort order for the dimension column.
  10432. //
  10433. // Possible values:
  10434. // "ASCENDING"
  10435. // "DESCENDING"
  10436. SortOrder string `json:"sortOrder,omitempty"`
  10437. // ForceSendFields is a list of field names (e.g. "Kind") to
  10438. // unconditionally include in API requests. By default, fields with
  10439. // empty values are omitted from API requests. However, any non-pointer,
  10440. // non-interface field appearing in ForceSendFields will be sent to the
  10441. // server regardless of whether the field is empty or not. This may be
  10442. // used to include empty fields in Patch requests.
  10443. ForceSendFields []string `json:"-"`
  10444. // NullFields is a list of field names (e.g. "Kind") to include in API
  10445. // requests with the JSON null value. By default, fields with empty
  10446. // values are omitted from API requests. However, any field with an
  10447. // empty value appearing in NullFields will be sent to the server as
  10448. // null. It is an error if a field in this list has a non-empty value.
  10449. // This may be used to include null fields in Patch requests.
  10450. NullFields []string `json:"-"`
  10451. }
  10452. func (s *SortedDimension) MarshalJSON() ([]byte, error) {
  10453. type NoMethod SortedDimension
  10454. raw := NoMethod(*s)
  10455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10456. }
  10457. // Subaccount: Contains properties of a DCM subaccount.
  10458. type Subaccount struct {
  10459. // AccountId: ID of the account that contains this subaccount. This is a
  10460. // read-only field that can be left blank.
  10461. AccountId int64 `json:"accountId,omitempty,string"`
  10462. // AvailablePermissionIds: IDs of the available user role permissions
  10463. // for this subaccount.
  10464. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  10465. // Id: ID of this subaccount. This is a read-only, auto-generated field.
  10466. Id int64 `json:"id,omitempty,string"`
  10467. // Kind: Identifies what kind of resource this is. Value: the fixed
  10468. // string "dfareporting#subaccount".
  10469. Kind string `json:"kind,omitempty"`
  10470. // Name: Name of this subaccount. This is a required field. Must be less
  10471. // than 128 characters long and be unique among subaccounts of the same
  10472. // account.
  10473. Name string `json:"name,omitempty"`
  10474. // ServerResponse contains the HTTP response code and headers from the
  10475. // server.
  10476. googleapi.ServerResponse `json:"-"`
  10477. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10478. // unconditionally include in API requests. By default, fields with
  10479. // empty values are omitted from API requests. However, any non-pointer,
  10480. // non-interface field appearing in ForceSendFields will be sent to the
  10481. // server regardless of whether the field is empty or not. This may be
  10482. // used to include empty fields in Patch requests.
  10483. ForceSendFields []string `json:"-"`
  10484. // NullFields is a list of field names (e.g. "AccountId") to include in
  10485. // API requests with the JSON null value. By default, fields with empty
  10486. // values are omitted from API requests. However, any field with an
  10487. // empty value appearing in NullFields will be sent to the server as
  10488. // null. It is an error if a field in this list has a non-empty value.
  10489. // This may be used to include null fields in Patch requests.
  10490. NullFields []string `json:"-"`
  10491. }
  10492. func (s *Subaccount) MarshalJSON() ([]byte, error) {
  10493. type NoMethod Subaccount
  10494. raw := NoMethod(*s)
  10495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10496. }
  10497. // SubaccountsListResponse: Subaccount List Response
  10498. type SubaccountsListResponse struct {
  10499. // Kind: Identifies what kind of resource this is. Value: the fixed
  10500. // string "dfareporting#subaccountsListResponse".
  10501. Kind string `json:"kind,omitempty"`
  10502. // NextPageToken: Pagination token to be used for the next list
  10503. // operation.
  10504. NextPageToken string `json:"nextPageToken,omitempty"`
  10505. // Subaccounts: Subaccount collection.
  10506. Subaccounts []*Subaccount `json:"subaccounts,omitempty"`
  10507. // ServerResponse contains the HTTP response code and headers from the
  10508. // server.
  10509. googleapi.ServerResponse `json:"-"`
  10510. // ForceSendFields is a list of field names (e.g. "Kind") to
  10511. // unconditionally include in API requests. By default, fields with
  10512. // empty values are omitted from API requests. However, any non-pointer,
  10513. // non-interface field appearing in ForceSendFields will be sent to the
  10514. // server regardless of whether the field is empty or not. This may be
  10515. // used to include empty fields in Patch requests.
  10516. ForceSendFields []string `json:"-"`
  10517. // NullFields is a list of field names (e.g. "Kind") to include in API
  10518. // requests with the JSON null value. By default, fields with empty
  10519. // values are omitted from API requests. However, any field with an
  10520. // empty value appearing in NullFields will be sent to the server as
  10521. // null. It is an error if a field in this list has a non-empty value.
  10522. // This may be used to include null fields in Patch requests.
  10523. NullFields []string `json:"-"`
  10524. }
  10525. func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) {
  10526. type NoMethod SubaccountsListResponse
  10527. raw := NoMethod(*s)
  10528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10529. }
  10530. // TagData: Placement Tag Data
  10531. type TagData struct {
  10532. // AdId: Ad associated with this placement tag. Applicable only when
  10533. // format is PLACEMENT_TAG_TRACKING.
  10534. AdId int64 `json:"adId,omitempty,string"`
  10535. // ClickTag: Tag string to record a click.
  10536. ClickTag string `json:"clickTag,omitempty"`
  10537. // CreativeId: Creative associated with this placement tag. Applicable
  10538. // only when format is PLACEMENT_TAG_TRACKING.
  10539. CreativeId int64 `json:"creativeId,omitempty,string"`
  10540. // Format: TagData tag format of this tag.
  10541. //
  10542. // Possible values:
  10543. // "PLACEMENT_TAG_CLICK_COMMANDS"
  10544. // "PLACEMENT_TAG_IFRAME_ILAYER"
  10545. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  10546. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  10547. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  10548. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  10549. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  10550. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  10551. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  10552. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  10553. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  10554. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  10555. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  10556. // "PLACEMENT_TAG_JAVASCRIPT"
  10557. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  10558. // "PLACEMENT_TAG_STANDARD"
  10559. // "PLACEMENT_TAG_TRACKING"
  10560. // "PLACEMENT_TAG_TRACKING_IFRAME"
  10561. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  10562. Format string `json:"format,omitempty"`
  10563. // ImpressionTag: Tag string for serving an ad.
  10564. ImpressionTag string `json:"impressionTag,omitempty"`
  10565. // ForceSendFields is a list of field names (e.g. "AdId") to
  10566. // unconditionally include in API requests. By default, fields with
  10567. // empty values are omitted from API requests. However, any non-pointer,
  10568. // non-interface field appearing in ForceSendFields will be sent to the
  10569. // server regardless of whether the field is empty or not. This may be
  10570. // used to include empty fields in Patch requests.
  10571. ForceSendFields []string `json:"-"`
  10572. // NullFields is a list of field names (e.g. "AdId") to include in API
  10573. // requests with the JSON null value. By default, fields with empty
  10574. // values are omitted from API requests. However, any field with an
  10575. // empty value appearing in NullFields will be sent to the server as
  10576. // null. It is an error if a field in this list has a non-empty value.
  10577. // This may be used to include null fields in Patch requests.
  10578. NullFields []string `json:"-"`
  10579. }
  10580. func (s *TagData) MarshalJSON() ([]byte, error) {
  10581. type NoMethod TagData
  10582. raw := NoMethod(*s)
  10583. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10584. }
  10585. // TagSetting: Tag Settings
  10586. type TagSetting struct {
  10587. // AdditionalKeyValues: Additional key-values to be included in tags.
  10588. // Each key-value pair must be of the form key=value, and pairs must be
  10589. // separated by a semicolon (;). Keys and values must not contain
  10590. // commas. For example, id=2;color=red is a valid value for this field.
  10591. AdditionalKeyValues string `json:"additionalKeyValues,omitempty"`
  10592. // IncludeClickThroughUrls: Whether static landing page URLs should be
  10593. // included in the tags. This setting applies only to placements.
  10594. IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"`
  10595. // IncludeClickTracking: Whether click-tracking string should be
  10596. // included in the tags.
  10597. IncludeClickTracking bool `json:"includeClickTracking,omitempty"`
  10598. // KeywordOption: Option specifying how keywords are embedded in ad
  10599. // tags. This setting can be used to specify whether keyword
  10600. // placeholders are inserted in placement tags for this site. Publishers
  10601. // can then add keywords to those placeholders.
  10602. //
  10603. // Possible values:
  10604. // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD"
  10605. // "IGNORE"
  10606. // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS"
  10607. KeywordOption string `json:"keywordOption,omitempty"`
  10608. // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues")
  10609. // to unconditionally include in API requests. By default, fields with
  10610. // empty values are omitted from API requests. However, any non-pointer,
  10611. // non-interface field appearing in ForceSendFields will be sent to the
  10612. // server regardless of whether the field is empty or not. This may be
  10613. // used to include empty fields in Patch requests.
  10614. ForceSendFields []string `json:"-"`
  10615. // NullFields is a list of field names (e.g. "AdditionalKeyValues") to
  10616. // include in API requests with the JSON null value. By default, fields
  10617. // with empty values are omitted from API requests. However, any field
  10618. // with an empty value appearing in NullFields will be sent to the
  10619. // server as null. It is an error if a field in this list has a
  10620. // non-empty value. This may be used to include null fields in Patch
  10621. // requests.
  10622. NullFields []string `json:"-"`
  10623. }
  10624. func (s *TagSetting) MarshalJSON() ([]byte, error) {
  10625. type NoMethod TagSetting
  10626. raw := NoMethod(*s)
  10627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10628. }
  10629. // TagSettings: Dynamic and Image Tag Settings.
  10630. type TagSettings struct {
  10631. // DynamicTagEnabled: Whether dynamic floodlight tags are enabled.
  10632. DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"`
  10633. // ImageTagEnabled: Whether image tags are enabled.
  10634. ImageTagEnabled bool `json:"imageTagEnabled,omitempty"`
  10635. // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled")
  10636. // to 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. "DynamicTagEnabled") to
  10643. // include in API requests with the JSON null value. By default, fields
  10644. // with empty values are omitted from API requests. However, any field
  10645. // with an empty value appearing in NullFields will be sent to the
  10646. // server as null. It is an error if a field in this list has a
  10647. // non-empty value. This may be used to include null fields in Patch
  10648. // requests.
  10649. NullFields []string `json:"-"`
  10650. }
  10651. func (s *TagSettings) MarshalJSON() ([]byte, error) {
  10652. type NoMethod TagSettings
  10653. raw := NoMethod(*s)
  10654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10655. }
  10656. // TargetWindow: Target Window.
  10657. type TargetWindow struct {
  10658. // CustomHtml: User-entered value.
  10659. CustomHtml string `json:"customHtml,omitempty"`
  10660. // TargetWindowOption: Type of browser window for which the backup image
  10661. // of the flash creative can be displayed.
  10662. //
  10663. // Possible values:
  10664. // "CURRENT_WINDOW"
  10665. // "CUSTOM"
  10666. // "NEW_WINDOW"
  10667. TargetWindowOption string `json:"targetWindowOption,omitempty"`
  10668. // ForceSendFields is a list of field names (e.g. "CustomHtml") to
  10669. // unconditionally include in API requests. By default, fields with
  10670. // empty values are omitted from API requests. However, any non-pointer,
  10671. // non-interface field appearing in ForceSendFields will be sent to the
  10672. // server regardless of whether the field is empty or not. This may be
  10673. // used to include empty fields in Patch requests.
  10674. ForceSendFields []string `json:"-"`
  10675. // NullFields is a list of field names (e.g. "CustomHtml") to include in
  10676. // API requests with the JSON null value. By default, fields with empty
  10677. // values are omitted from API requests. However, any field with an
  10678. // empty value appearing in NullFields will be sent to the server as
  10679. // null. It is an error if a field in this list has a non-empty value.
  10680. // This may be used to include null fields in Patch requests.
  10681. NullFields []string `json:"-"`
  10682. }
  10683. func (s *TargetWindow) MarshalJSON() ([]byte, error) {
  10684. type NoMethod TargetWindow
  10685. raw := NoMethod(*s)
  10686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10687. }
  10688. // TargetableRemarketingList: Contains properties of a targetable
  10689. // remarketing list. Remarketing enables you to create lists of users
  10690. // who have performed specific actions on a site, then target ads to
  10691. // members of those lists. This resource is a read-only view of a
  10692. // remarketing list to be used to faciliate targeting ads to specific
  10693. // lists. Remarketing lists that are owned by your advertisers and those
  10694. // that are shared to your advertisers or account are accessible via
  10695. // this resource. To manage remarketing lists that are owned by your
  10696. // advertisers, use the RemarketingLists resource.
  10697. type TargetableRemarketingList struct {
  10698. // AccountId: Account ID of this remarketing list. This is a read-only,
  10699. // auto-generated field that is only returned in GET requests.
  10700. AccountId int64 `json:"accountId,omitempty,string"`
  10701. // Active: Whether this targetable remarketing list is active.
  10702. Active bool `json:"active,omitempty"`
  10703. // AdvertiserId: Dimension value for the advertiser ID that owns this
  10704. // targetable remarketing list.
  10705. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10706. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10707. // advertiser.
  10708. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10709. // Description: Targetable remarketing list description.
  10710. Description string `json:"description,omitempty"`
  10711. // Id: Targetable remarketing list ID.
  10712. Id int64 `json:"id,omitempty,string"`
  10713. // Kind: Identifies what kind of resource this is. Value: the fixed
  10714. // string "dfareporting#targetableRemarketingList".
  10715. Kind string `json:"kind,omitempty"`
  10716. // LifeSpan: Number of days that a user should remain in the targetable
  10717. // remarketing list without an impression.
  10718. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  10719. // ListSize: Number of users currently in the list. This is a read-only
  10720. // field.
  10721. ListSize int64 `json:"listSize,omitempty,string"`
  10722. // ListSource: Product from which this targetable remarketing list was
  10723. // originated.
  10724. //
  10725. // Possible values:
  10726. // "REMARKETING_LIST_SOURCE_ADX"
  10727. // "REMARKETING_LIST_SOURCE_DBM"
  10728. // "REMARKETING_LIST_SOURCE_DFA"
  10729. // "REMARKETING_LIST_SOURCE_DFP"
  10730. // "REMARKETING_LIST_SOURCE_DMP"
  10731. // "REMARKETING_LIST_SOURCE_GA"
  10732. // "REMARKETING_LIST_SOURCE_GPLUS"
  10733. // "REMARKETING_LIST_SOURCE_OTHER"
  10734. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  10735. // "REMARKETING_LIST_SOURCE_XFP"
  10736. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  10737. ListSource string `json:"listSource,omitempty"`
  10738. // Name: Name of the targetable remarketing list. Is no greater than 128
  10739. // characters long.
  10740. Name string `json:"name,omitempty"`
  10741. // SubaccountId: Subaccount ID of this remarketing list. This is a
  10742. // read-only, auto-generated field that is only returned in GET
  10743. // requests.
  10744. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10745. // ServerResponse contains the HTTP response code and headers from the
  10746. // server.
  10747. googleapi.ServerResponse `json:"-"`
  10748. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10749. // unconditionally include in API requests. By default, fields with
  10750. // empty values are omitted from API requests. However, any non-pointer,
  10751. // non-interface field appearing in ForceSendFields will be sent to the
  10752. // server regardless of whether the field is empty or not. This may be
  10753. // used to include empty fields in Patch requests.
  10754. ForceSendFields []string `json:"-"`
  10755. // NullFields is a list of field names (e.g. "AccountId") to include in
  10756. // API requests with the JSON null value. By default, fields with empty
  10757. // values are omitted from API requests. However, any field with an
  10758. // empty value appearing in NullFields will be sent to the server as
  10759. // null. It is an error if a field in this list has a non-empty value.
  10760. // This may be used to include null fields in Patch requests.
  10761. NullFields []string `json:"-"`
  10762. }
  10763. func (s *TargetableRemarketingList) MarshalJSON() ([]byte, error) {
  10764. type NoMethod TargetableRemarketingList
  10765. raw := NoMethod(*s)
  10766. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10767. }
  10768. // TargetableRemarketingListsListResponse: Targetable remarketing list
  10769. // response
  10770. type TargetableRemarketingListsListResponse struct {
  10771. // Kind: Identifies what kind of resource this is. Value: the fixed
  10772. // string "dfareporting#targetableRemarketingListsListResponse".
  10773. Kind string `json:"kind,omitempty"`
  10774. // NextPageToken: Pagination token to be used for the next list
  10775. // operation.
  10776. NextPageToken string `json:"nextPageToken,omitempty"`
  10777. // TargetableRemarketingLists: Targetable remarketing list collection.
  10778. TargetableRemarketingLists []*TargetableRemarketingList `json:"targetableRemarketingLists,omitempty"`
  10779. // ServerResponse contains the HTTP response code and headers from the
  10780. // server.
  10781. googleapi.ServerResponse `json:"-"`
  10782. // ForceSendFields is a list of field names (e.g. "Kind") to
  10783. // unconditionally include in API requests. By default, fields with
  10784. // empty values are omitted from API requests. However, any non-pointer,
  10785. // non-interface field appearing in ForceSendFields will be sent to the
  10786. // server regardless of whether the field is empty or not. This may be
  10787. // used to include empty fields in Patch requests.
  10788. ForceSendFields []string `json:"-"`
  10789. // NullFields is a list of field names (e.g. "Kind") to include in API
  10790. // requests with the JSON null value. By default, fields with empty
  10791. // values are omitted from API requests. However, any field with an
  10792. // empty value appearing in NullFields will be sent to the server as
  10793. // null. It is an error if a field in this list has a non-empty value.
  10794. // This may be used to include null fields in Patch requests.
  10795. NullFields []string `json:"-"`
  10796. }
  10797. func (s *TargetableRemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  10798. type NoMethod TargetableRemarketingListsListResponse
  10799. raw := NoMethod(*s)
  10800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10801. }
  10802. // TargetingTemplate: Contains properties of a targeting template. A
  10803. // targeting template encapsulates targeting information which can be
  10804. // reused across multiple ads.
  10805. type TargetingTemplate struct {
  10806. // AccountId: Account ID of this targeting template. This field, if left
  10807. // unset, will be auto-generated on insert and is read-only after
  10808. // insert.
  10809. AccountId int64 `json:"accountId,omitempty,string"`
  10810. // AdvertiserId: Advertiser ID of this targeting template. This is a
  10811. // required field on insert and is read-only after insert.
  10812. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10813. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10814. // advertiser. This is a read-only, auto-generated field.
  10815. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10816. // DayPartTargeting: Time and day targeting criteria.
  10817. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  10818. // GeoTargeting: Geographical targeting criteria.
  10819. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  10820. // Id: ID of this targeting template. This is a read-only,
  10821. // auto-generated field.
  10822. Id int64 `json:"id,omitempty,string"`
  10823. // KeyValueTargetingExpression: Key-value targeting criteria.
  10824. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  10825. // Kind: Identifies what kind of resource this is. Value: the fixed
  10826. // string "dfareporting#targetingTemplate".
  10827. Kind string `json:"kind,omitempty"`
  10828. // LanguageTargeting: Language targeting criteria.
  10829. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  10830. // ListTargetingExpression: Remarketing list targeting criteria.
  10831. ListTargetingExpression *ListTargetingExpression `json:"listTargetingExpression,omitempty"`
  10832. // Name: Name of this targeting template. This field is required. It
  10833. // must be less than 256 characters long and unique within an
  10834. // advertiser.
  10835. Name string `json:"name,omitempty"`
  10836. // SubaccountId: Subaccount ID of this targeting template. This field,
  10837. // if left unset, will be auto-generated on insert and is read-only
  10838. // after insert.
  10839. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10840. // TechnologyTargeting: Technology platform targeting criteria.
  10841. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  10842. // ServerResponse contains the HTTP response code and headers from the
  10843. // server.
  10844. googleapi.ServerResponse `json:"-"`
  10845. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10846. // unconditionally include in API requests. By default, fields with
  10847. // empty values are omitted from API requests. However, any non-pointer,
  10848. // non-interface field appearing in ForceSendFields will be sent to the
  10849. // server regardless of whether the field is empty or not. This may be
  10850. // used to include empty fields in Patch requests.
  10851. ForceSendFields []string `json:"-"`
  10852. // NullFields is a list of field names (e.g. "AccountId") to include in
  10853. // API requests with the JSON null value. By default, fields with empty
  10854. // values are omitted from API requests. However, any field with an
  10855. // empty value appearing in NullFields will be sent to the server as
  10856. // null. It is an error if a field in this list has a non-empty value.
  10857. // This may be used to include null fields in Patch requests.
  10858. NullFields []string `json:"-"`
  10859. }
  10860. func (s *TargetingTemplate) MarshalJSON() ([]byte, error) {
  10861. type NoMethod TargetingTemplate
  10862. raw := NoMethod(*s)
  10863. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10864. }
  10865. // TargetingTemplatesListResponse: Targeting Template List Response
  10866. type TargetingTemplatesListResponse struct {
  10867. // Kind: Identifies what kind of resource this is. Value: the fixed
  10868. // string "dfareporting#targetingTemplatesListResponse".
  10869. Kind string `json:"kind,omitempty"`
  10870. // NextPageToken: Pagination token to be used for the next list
  10871. // operation.
  10872. NextPageToken string `json:"nextPageToken,omitempty"`
  10873. // TargetingTemplates: Targeting template collection.
  10874. TargetingTemplates []*TargetingTemplate `json:"targetingTemplates,omitempty"`
  10875. // ServerResponse contains the HTTP response code and headers from the
  10876. // server.
  10877. googleapi.ServerResponse `json:"-"`
  10878. // ForceSendFields is a list of field names (e.g. "Kind") to
  10879. // unconditionally include in API requests. By default, fields with
  10880. // empty values are omitted from API requests. However, any non-pointer,
  10881. // non-interface field appearing in ForceSendFields will be sent to the
  10882. // server regardless of whether the field is empty or not. This may be
  10883. // used to include empty fields in Patch requests.
  10884. ForceSendFields []string `json:"-"`
  10885. // NullFields is a list of field names (e.g. "Kind") to include in API
  10886. // requests with the JSON null value. By default, fields with empty
  10887. // values are omitted from API requests. However, any field with an
  10888. // empty value appearing in NullFields will be sent to the server as
  10889. // null. It is an error if a field in this list has a non-empty value.
  10890. // This may be used to include null fields in Patch requests.
  10891. NullFields []string `json:"-"`
  10892. }
  10893. func (s *TargetingTemplatesListResponse) MarshalJSON() ([]byte, error) {
  10894. type NoMethod TargetingTemplatesListResponse
  10895. raw := NoMethod(*s)
  10896. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10897. }
  10898. // TechnologyTargeting: Technology Targeting.
  10899. type TechnologyTargeting struct {
  10900. // Browsers: Browsers that this ad targets. For each browser either set
  10901. // browserVersionId or dartId along with the version numbers. If both
  10902. // are specified, only browserVersionId will be used. The other fields
  10903. // are populated automatically when the ad is inserted or updated.
  10904. Browsers []*Browser `json:"browsers,omitempty"`
  10905. // ConnectionTypes: Connection types that this ad targets. For each
  10906. // connection type only id is required. The other fields are populated
  10907. // automatically when the ad is inserted or updated.
  10908. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  10909. // MobileCarriers: Mobile carriers that this ad targets. For each mobile
  10910. // carrier only id is required, and the other fields are populated
  10911. // automatically when the ad is inserted or updated. If targeting a
  10912. // mobile carrier, do not set targeting for any zip codes.
  10913. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  10914. // OperatingSystemVersions: Operating system versions that this ad
  10915. // targets. To target all versions, use operatingSystems. For each
  10916. // operating system version, only id is required. The other fields are
  10917. // populated automatically when the ad is inserted or updated. If
  10918. // targeting an operating system version, do not set targeting for the
  10919. // corresponding operating system in operatingSystems.
  10920. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  10921. // OperatingSystems: Operating systems that this ad targets. To target
  10922. // specific versions, use operatingSystemVersions. For each operating
  10923. // system only dartId is required. The other fields are populated
  10924. // automatically when the ad is inserted or updated. If targeting an
  10925. // operating system, do not set targeting for operating system versions
  10926. // for the same operating system.
  10927. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  10928. // PlatformTypes: Platform types that this ad targets. For example,
  10929. // desktop, mobile, or tablet. For each platform type, only id is
  10930. // required, and the other fields are populated automatically when the
  10931. // ad is inserted or updated.
  10932. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  10933. // ForceSendFields is a list of field names (e.g. "Browsers") to
  10934. // unconditionally include in API requests. By default, fields with
  10935. // empty values are omitted from API requests. However, any non-pointer,
  10936. // non-interface field appearing in ForceSendFields will be sent to the
  10937. // server regardless of whether the field is empty or not. This may be
  10938. // used to include empty fields in Patch requests.
  10939. ForceSendFields []string `json:"-"`
  10940. // NullFields is a list of field names (e.g. "Browsers") to include in
  10941. // API requests with the JSON null value. By default, fields with empty
  10942. // values are omitted from API requests. However, any field with an
  10943. // empty value appearing in NullFields will be sent to the server as
  10944. // null. It is an error if a field in this list has a non-empty value.
  10945. // This may be used to include null fields in Patch requests.
  10946. NullFields []string `json:"-"`
  10947. }
  10948. func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) {
  10949. type NoMethod TechnologyTargeting
  10950. raw := NoMethod(*s)
  10951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10952. }
  10953. // ThirdPartyAuthenticationToken: Third Party Authentication Token
  10954. type ThirdPartyAuthenticationToken struct {
  10955. // Name: Name of the third-party authentication token.
  10956. Name string `json:"name,omitempty"`
  10957. // Value: Value of the third-party authentication token. This is a
  10958. // read-only, auto-generated field.
  10959. Value string `json:"value,omitempty"`
  10960. // ForceSendFields is a list of field names (e.g. "Name") to
  10961. // unconditionally include in API requests. By default, fields with
  10962. // empty values are omitted from API requests. However, any non-pointer,
  10963. // non-interface field appearing in ForceSendFields will be sent to the
  10964. // server regardless of whether the field is empty or not. This may be
  10965. // used to include empty fields in Patch requests.
  10966. ForceSendFields []string `json:"-"`
  10967. // NullFields is a list of field names (e.g. "Name") to include in API
  10968. // requests with the JSON null value. By default, fields with empty
  10969. // values are omitted from API requests. However, any field with an
  10970. // empty value appearing in NullFields will be sent to the server as
  10971. // null. It is an error if a field in this list has a non-empty value.
  10972. // This may be used to include null fields in Patch requests.
  10973. NullFields []string `json:"-"`
  10974. }
  10975. func (s *ThirdPartyAuthenticationToken) MarshalJSON() ([]byte, error) {
  10976. type NoMethod ThirdPartyAuthenticationToken
  10977. raw := NoMethod(*s)
  10978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10979. }
  10980. // ThirdPartyTrackingUrl: Third-party Tracking URL.
  10981. type ThirdPartyTrackingUrl struct {
  10982. // ThirdPartyUrlType: Third-party URL type for in-stream video
  10983. // creatives.
  10984. //
  10985. // Possible values:
  10986. // "CLICK_TRACKING"
  10987. // "IMPRESSION"
  10988. // "RICH_MEDIA_BACKUP_IMPRESSION"
  10989. // "RICH_MEDIA_IMPRESSION"
  10990. // "RICH_MEDIA_RM_IMPRESSION"
  10991. // "SURVEY"
  10992. // "VIDEO_COMPLETE"
  10993. // "VIDEO_CUSTOM"
  10994. // "VIDEO_FIRST_QUARTILE"
  10995. // "VIDEO_FULLSCREEN"
  10996. // "VIDEO_MIDPOINT"
  10997. // "VIDEO_MUTE"
  10998. // "VIDEO_PAUSE"
  10999. // "VIDEO_PROGRESS"
  11000. // "VIDEO_REWIND"
  11001. // "VIDEO_SKIP"
  11002. // "VIDEO_START"
  11003. // "VIDEO_STOP"
  11004. // "VIDEO_THIRD_QUARTILE"
  11005. ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"`
  11006. // Url: URL for the specified third-party URL type.
  11007. Url string `json:"url,omitempty"`
  11008. // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType")
  11009. // to unconditionally include in API requests. By default, fields with
  11010. // empty values are omitted from API requests. However, any non-pointer,
  11011. // non-interface field appearing in ForceSendFields will be sent to the
  11012. // server regardless of whether the field is empty or not. This may be
  11013. // used to include empty fields in Patch requests.
  11014. ForceSendFields []string `json:"-"`
  11015. // NullFields is a list of field names (e.g. "ThirdPartyUrlType") to
  11016. // include in API requests with the JSON null value. By default, fields
  11017. // with empty values are omitted from API requests. However, any field
  11018. // with an empty value appearing in NullFields will be sent to the
  11019. // server as null. It is an error if a field in this list has a
  11020. // non-empty value. This may be used to include null fields in Patch
  11021. // requests.
  11022. NullFields []string `json:"-"`
  11023. }
  11024. func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) {
  11025. type NoMethod ThirdPartyTrackingUrl
  11026. raw := NoMethod(*s)
  11027. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11028. }
  11029. // TranscodeSetting: Transcode Settings
  11030. type TranscodeSetting struct {
  11031. // EnabledVideoFormats: Whitelist of video formats to be served to this
  11032. // placement. Set this list to null or empty to serve all video formats.
  11033. EnabledVideoFormats []int64 `json:"enabledVideoFormats,omitempty"`
  11034. // Kind: Identifies what kind of resource this is. Value: the fixed
  11035. // string "dfareporting#transcodeSetting".
  11036. Kind string `json:"kind,omitempty"`
  11037. // ForceSendFields is a list of field names (e.g. "EnabledVideoFormats")
  11038. // to unconditionally include in API requests. By default, fields with
  11039. // empty values are omitted from API requests. However, any non-pointer,
  11040. // non-interface field appearing in ForceSendFields will be sent to the
  11041. // server regardless of whether the field is empty or not. This may be
  11042. // used to include empty fields in Patch requests.
  11043. ForceSendFields []string `json:"-"`
  11044. // NullFields is a list of field names (e.g. "EnabledVideoFormats") to
  11045. // include in API requests with the JSON null value. By default, fields
  11046. // with empty values are omitted from API requests. However, any field
  11047. // with an empty value appearing in NullFields will be sent to the
  11048. // server as null. It is an error if a field in this list has a
  11049. // non-empty value. This may be used to include null fields in Patch
  11050. // requests.
  11051. NullFields []string `json:"-"`
  11052. }
  11053. func (s *TranscodeSetting) MarshalJSON() ([]byte, error) {
  11054. type NoMethod TranscodeSetting
  11055. raw := NoMethod(*s)
  11056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11057. }
  11058. // UniversalAdId: A Universal Ad ID as per the VAST 4.0 spec. Applicable
  11059. // to the following creative types: INSTREAM_VIDEO and VPAID.
  11060. type UniversalAdId struct {
  11061. // Registry: Registry used for the Ad ID value.
  11062. //
  11063. // Possible values:
  11064. // "AD_ID.ORG"
  11065. // "CLEARCAST"
  11066. // "DCM"
  11067. // "OTHER"
  11068. Registry string `json:"registry,omitempty"`
  11069. // Value: ID value for this creative. Only alphanumeric characters and
  11070. // the following symbols are valid: "_/\-". Maximum length is 64
  11071. // characters. Read only when registry is DCM.
  11072. Value string `json:"value,omitempty"`
  11073. // ForceSendFields is a list of field names (e.g. "Registry") to
  11074. // unconditionally include in API requests. By default, fields with
  11075. // empty values are omitted from API requests. However, any non-pointer,
  11076. // non-interface field appearing in ForceSendFields will be sent to the
  11077. // server regardless of whether the field is empty or not. This may be
  11078. // used to include empty fields in Patch requests.
  11079. ForceSendFields []string `json:"-"`
  11080. // NullFields is a list of field names (e.g. "Registry") to include in
  11081. // API requests with the JSON null value. By default, fields with empty
  11082. // values are omitted from API requests. However, any field with an
  11083. // empty value appearing in NullFields will be sent to the server as
  11084. // null. It is an error if a field in this list has a non-empty value.
  11085. // This may be used to include null fields in Patch requests.
  11086. NullFields []string `json:"-"`
  11087. }
  11088. func (s *UniversalAdId) MarshalJSON() ([]byte, error) {
  11089. type NoMethod UniversalAdId
  11090. raw := NoMethod(*s)
  11091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11092. }
  11093. // UserDefinedVariableConfiguration: User Defined Variable
  11094. // configuration.
  11095. type UserDefinedVariableConfiguration struct {
  11096. // DataType: Data type for the variable. This is a required field.
  11097. //
  11098. // Possible values:
  11099. // "NUMBER"
  11100. // "STRING"
  11101. DataType string `json:"dataType,omitempty"`
  11102. // ReportName: User-friendly name for the variable which will appear in
  11103. // reports. This is a required field, must be less than 64 characters
  11104. // long, and cannot contain the following characters: ""<>".
  11105. ReportName string `json:"reportName,omitempty"`
  11106. // VariableType: Variable name in the tag. This is a required field.
  11107. //
  11108. // Possible values:
  11109. // "U1"
  11110. // "U10"
  11111. // "U100"
  11112. // "U11"
  11113. // "U12"
  11114. // "U13"
  11115. // "U14"
  11116. // "U15"
  11117. // "U16"
  11118. // "U17"
  11119. // "U18"
  11120. // "U19"
  11121. // "U2"
  11122. // "U20"
  11123. // "U21"
  11124. // "U22"
  11125. // "U23"
  11126. // "U24"
  11127. // "U25"
  11128. // "U26"
  11129. // "U27"
  11130. // "U28"
  11131. // "U29"
  11132. // "U3"
  11133. // "U30"
  11134. // "U31"
  11135. // "U32"
  11136. // "U33"
  11137. // "U34"
  11138. // "U35"
  11139. // "U36"
  11140. // "U37"
  11141. // "U38"
  11142. // "U39"
  11143. // "U4"
  11144. // "U40"
  11145. // "U41"
  11146. // "U42"
  11147. // "U43"
  11148. // "U44"
  11149. // "U45"
  11150. // "U46"
  11151. // "U47"
  11152. // "U48"
  11153. // "U49"
  11154. // "U5"
  11155. // "U50"
  11156. // "U51"
  11157. // "U52"
  11158. // "U53"
  11159. // "U54"
  11160. // "U55"
  11161. // "U56"
  11162. // "U57"
  11163. // "U58"
  11164. // "U59"
  11165. // "U6"
  11166. // "U60"
  11167. // "U61"
  11168. // "U62"
  11169. // "U63"
  11170. // "U64"
  11171. // "U65"
  11172. // "U66"
  11173. // "U67"
  11174. // "U68"
  11175. // "U69"
  11176. // "U7"
  11177. // "U70"
  11178. // "U71"
  11179. // "U72"
  11180. // "U73"
  11181. // "U74"
  11182. // "U75"
  11183. // "U76"
  11184. // "U77"
  11185. // "U78"
  11186. // "U79"
  11187. // "U8"
  11188. // "U80"
  11189. // "U81"
  11190. // "U82"
  11191. // "U83"
  11192. // "U84"
  11193. // "U85"
  11194. // "U86"
  11195. // "U87"
  11196. // "U88"
  11197. // "U89"
  11198. // "U9"
  11199. // "U90"
  11200. // "U91"
  11201. // "U92"
  11202. // "U93"
  11203. // "U94"
  11204. // "U95"
  11205. // "U96"
  11206. // "U97"
  11207. // "U98"
  11208. // "U99"
  11209. VariableType string `json:"variableType,omitempty"`
  11210. // ForceSendFields is a list of field names (e.g. "DataType") to
  11211. // unconditionally include in API requests. By default, fields with
  11212. // empty values are omitted from API requests. However, any non-pointer,
  11213. // non-interface field appearing in ForceSendFields will be sent to the
  11214. // server regardless of whether the field is empty or not. This may be
  11215. // used to include empty fields in Patch requests.
  11216. ForceSendFields []string `json:"-"`
  11217. // NullFields is a list of field names (e.g. "DataType") to include in
  11218. // API requests with the JSON null value. By default, fields with empty
  11219. // values are omitted from API requests. However, any field with an
  11220. // empty value appearing in NullFields will be sent to the server as
  11221. // null. It is an error if a field in this list has a non-empty value.
  11222. // This may be used to include null fields in Patch requests.
  11223. NullFields []string `json:"-"`
  11224. }
  11225. func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) {
  11226. type NoMethod UserDefinedVariableConfiguration
  11227. raw := NoMethod(*s)
  11228. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11229. }
  11230. // UserProfile: Represents a UserProfile resource.
  11231. type UserProfile struct {
  11232. // AccountId: The account ID to which this profile belongs.
  11233. AccountId int64 `json:"accountId,omitempty,string"`
  11234. // AccountName: The account name this profile belongs to.
  11235. AccountName string `json:"accountName,omitempty"`
  11236. // Etag: The eTag of this response for caching purposes.
  11237. Etag string `json:"etag,omitempty"`
  11238. // Kind: The kind of resource this is, in this case
  11239. // dfareporting#userProfile.
  11240. Kind string `json:"kind,omitempty"`
  11241. // ProfileId: The unique ID of the user profile.
  11242. ProfileId int64 `json:"profileId,omitempty,string"`
  11243. // SubAccountId: The sub account ID this profile belongs to if
  11244. // applicable.
  11245. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  11246. // SubAccountName: The sub account name this profile belongs to if
  11247. // applicable.
  11248. SubAccountName string `json:"subAccountName,omitempty"`
  11249. // UserName: The user name.
  11250. UserName string `json:"userName,omitempty"`
  11251. // ServerResponse contains the HTTP response code and headers from the
  11252. // server.
  11253. googleapi.ServerResponse `json:"-"`
  11254. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11255. // unconditionally include in API requests. By default, fields with
  11256. // empty values are omitted from API requests. However, any non-pointer,
  11257. // non-interface field appearing in ForceSendFields will be sent to the
  11258. // server regardless of whether the field is empty or not. This may be
  11259. // used to include empty fields in Patch requests.
  11260. ForceSendFields []string `json:"-"`
  11261. // NullFields is a list of field names (e.g. "AccountId") to include in
  11262. // API requests with the JSON null value. By default, fields with empty
  11263. // values are omitted from API requests. However, any field with an
  11264. // empty value appearing in NullFields will be sent to the server as
  11265. // null. It is an error if a field in this list has a non-empty value.
  11266. // This may be used to include null fields in Patch requests.
  11267. NullFields []string `json:"-"`
  11268. }
  11269. func (s *UserProfile) MarshalJSON() ([]byte, error) {
  11270. type NoMethod UserProfile
  11271. raw := NoMethod(*s)
  11272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11273. }
  11274. // UserProfileList: Represents the list of user profiles.
  11275. type UserProfileList struct {
  11276. // Etag: The eTag of this response for caching purposes.
  11277. Etag string `json:"etag,omitempty"`
  11278. // Items: The user profiles returned in this response.
  11279. Items []*UserProfile `json:"items,omitempty"`
  11280. // Kind: The kind of list this is, in this case
  11281. // dfareporting#userProfileList.
  11282. Kind string `json:"kind,omitempty"`
  11283. // ServerResponse contains the HTTP response code and headers from the
  11284. // server.
  11285. googleapi.ServerResponse `json:"-"`
  11286. // ForceSendFields is a list of field names (e.g. "Etag") to
  11287. // unconditionally include in API requests. By default, fields with
  11288. // empty values are omitted from API requests. However, any non-pointer,
  11289. // non-interface field appearing in ForceSendFields will be sent to the
  11290. // server regardless of whether the field is empty or not. This may be
  11291. // used to include empty fields in Patch requests.
  11292. ForceSendFields []string `json:"-"`
  11293. // NullFields is a list of field names (e.g. "Etag") to include in API
  11294. // requests with the JSON null value. By default, fields with empty
  11295. // values are omitted from API requests. However, any field with an
  11296. // empty value appearing in NullFields will be sent to the server as
  11297. // null. It is an error if a field in this list has a non-empty value.
  11298. // This may be used to include null fields in Patch requests.
  11299. NullFields []string `json:"-"`
  11300. }
  11301. func (s *UserProfileList) MarshalJSON() ([]byte, error) {
  11302. type NoMethod UserProfileList
  11303. raw := NoMethod(*s)
  11304. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11305. }
  11306. // UserRole: Contains properties of auser role, which is used to manage
  11307. // user access.
  11308. type UserRole struct {
  11309. // AccountId: Account ID of this user role. This is a read-only field
  11310. // that can be left blank.
  11311. AccountId int64 `json:"accountId,omitempty,string"`
  11312. // DefaultUserRole: Whether this is a default user role. Default user
  11313. // roles are created by the system for the account/subaccount and cannot
  11314. // be modified or deleted. Each default user role comes with a basic set
  11315. // of preassigned permissions.
  11316. DefaultUserRole bool `json:"defaultUserRole,omitempty"`
  11317. // Id: ID of this user role. This is a read-only, auto-generated field.
  11318. Id int64 `json:"id,omitempty,string"`
  11319. // Kind: Identifies what kind of resource this is. Value: the fixed
  11320. // string "dfareporting#userRole".
  11321. Kind string `json:"kind,omitempty"`
  11322. // Name: Name of this user role. This is a required field. Must be less
  11323. // than 256 characters long. If this user role is under a subaccount,
  11324. // the name must be unique among sites of the same subaccount.
  11325. // Otherwise, this user role is a top-level user role, and the name must
  11326. // be unique among top-level user roles of the same account.
  11327. Name string `json:"name,omitempty"`
  11328. // ParentUserRoleId: ID of the user role that this user role is based on
  11329. // or copied from. This is a required field.
  11330. ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"`
  11331. // Permissions: List of permissions associated with this user role.
  11332. Permissions []*UserRolePermission `json:"permissions,omitempty"`
  11333. // SubaccountId: Subaccount ID of this user role. This is a read-only
  11334. // field that can be left blank.
  11335. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11336. // ServerResponse contains the HTTP response code and headers from the
  11337. // server.
  11338. googleapi.ServerResponse `json:"-"`
  11339. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11340. // unconditionally include in API requests. By default, fields with
  11341. // empty values are omitted from API requests. However, any non-pointer,
  11342. // non-interface field appearing in ForceSendFields will be sent to the
  11343. // server regardless of whether the field is empty or not. This may be
  11344. // used to include empty fields in Patch requests.
  11345. ForceSendFields []string `json:"-"`
  11346. // NullFields is a list of field names (e.g. "AccountId") to include in
  11347. // API requests with the JSON null value. By default, fields with empty
  11348. // values are omitted from API requests. However, any field with an
  11349. // empty value appearing in NullFields will be sent to the server as
  11350. // null. It is an error if a field in this list has a non-empty value.
  11351. // This may be used to include null fields in Patch requests.
  11352. NullFields []string `json:"-"`
  11353. }
  11354. func (s *UserRole) MarshalJSON() ([]byte, error) {
  11355. type NoMethod UserRole
  11356. raw := NoMethod(*s)
  11357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11358. }
  11359. // UserRolePermission: Contains properties of a user role permission.
  11360. type UserRolePermission struct {
  11361. // Availability: Levels of availability for a user role permission.
  11362. //
  11363. // Possible values:
  11364. // "ACCOUNT_ALWAYS"
  11365. // "ACCOUNT_BY_DEFAULT"
  11366. // "NOT_AVAILABLE_BY_DEFAULT"
  11367. // "SUBACCOUNT_AND_ACCOUNT_ALWAYS"
  11368. // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT"
  11369. Availability string `json:"availability,omitempty"`
  11370. // Id: ID of this user role permission.
  11371. Id int64 `json:"id,omitempty,string"`
  11372. // Kind: Identifies what kind of resource this is. Value: the fixed
  11373. // string "dfareporting#userRolePermission".
  11374. Kind string `json:"kind,omitempty"`
  11375. // Name: Name of this user role permission.
  11376. Name string `json:"name,omitempty"`
  11377. // PermissionGroupId: ID of the permission group that this user role
  11378. // permission belongs to.
  11379. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  11380. // ServerResponse contains the HTTP response code and headers from the
  11381. // server.
  11382. googleapi.ServerResponse `json:"-"`
  11383. // ForceSendFields is a list of field names (e.g. "Availability") to
  11384. // unconditionally include in API requests. By default, fields with
  11385. // empty values are omitted from API requests. However, any non-pointer,
  11386. // non-interface field appearing in ForceSendFields will be sent to the
  11387. // server regardless of whether the field is empty or not. This may be
  11388. // used to include empty fields in Patch requests.
  11389. ForceSendFields []string `json:"-"`
  11390. // NullFields is a list of field names (e.g. "Availability") to include
  11391. // in API requests with the JSON null value. By default, fields with
  11392. // empty values are omitted from API requests. However, any field with
  11393. // an empty value appearing in NullFields will be sent to the server as
  11394. // null. It is an error if a field in this list has a non-empty value.
  11395. // This may be used to include null fields in Patch requests.
  11396. NullFields []string `json:"-"`
  11397. }
  11398. func (s *UserRolePermission) MarshalJSON() ([]byte, error) {
  11399. type NoMethod UserRolePermission
  11400. raw := NoMethod(*s)
  11401. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11402. }
  11403. // UserRolePermissionGroup: Represents a grouping of related user role
  11404. // permissions.
  11405. type UserRolePermissionGroup struct {
  11406. // Id: ID of this user role permission.
  11407. Id int64 `json:"id,omitempty,string"`
  11408. // Kind: Identifies what kind of resource this is. Value: the fixed
  11409. // string "dfareporting#userRolePermissionGroup".
  11410. Kind string `json:"kind,omitempty"`
  11411. // Name: Name of this user role permission group.
  11412. Name string `json:"name,omitempty"`
  11413. // ServerResponse contains the HTTP response code and headers from the
  11414. // server.
  11415. googleapi.ServerResponse `json:"-"`
  11416. // ForceSendFields is a list of field names (e.g. "Id") to
  11417. // unconditionally include in API requests. By default, fields with
  11418. // empty values are omitted from API requests. However, any non-pointer,
  11419. // non-interface field appearing in ForceSendFields will be sent to the
  11420. // server regardless of whether the field is empty or not. This may be
  11421. // used to include empty fields in Patch requests.
  11422. ForceSendFields []string `json:"-"`
  11423. // NullFields is a list of field names (e.g. "Id") to include in API
  11424. // requests with the JSON null value. By default, fields with empty
  11425. // values are omitted from API requests. However, any field with an
  11426. // empty value appearing in NullFields will be sent to the server as
  11427. // null. It is an error if a field in this list has a non-empty value.
  11428. // This may be used to include null fields in Patch requests.
  11429. NullFields []string `json:"-"`
  11430. }
  11431. func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) {
  11432. type NoMethod UserRolePermissionGroup
  11433. raw := NoMethod(*s)
  11434. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11435. }
  11436. // UserRolePermissionGroupsListResponse: User Role Permission Group List
  11437. // Response
  11438. type UserRolePermissionGroupsListResponse struct {
  11439. // Kind: Identifies what kind of resource this is. Value: the fixed
  11440. // string "dfareporting#userRolePermissionGroupsListResponse".
  11441. Kind string `json:"kind,omitempty"`
  11442. // UserRolePermissionGroups: User role permission group collection.
  11443. UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"`
  11444. // ServerResponse contains the HTTP response code and headers from the
  11445. // server.
  11446. googleapi.ServerResponse `json:"-"`
  11447. // ForceSendFields is a list of field names (e.g. "Kind") to
  11448. // unconditionally include in API requests. By default, fields with
  11449. // empty values are omitted from API requests. However, any non-pointer,
  11450. // non-interface field appearing in ForceSendFields will be sent to the
  11451. // server regardless of whether the field is empty or not. This may be
  11452. // used to include empty fields in Patch requests.
  11453. ForceSendFields []string `json:"-"`
  11454. // NullFields is a list of field names (e.g. "Kind") to include in API
  11455. // requests with the JSON null value. By default, fields with empty
  11456. // values are omitted from API requests. However, any field with an
  11457. // empty value appearing in NullFields will be sent to the server as
  11458. // null. It is an error if a field in this list has a non-empty value.
  11459. // This may be used to include null fields in Patch requests.
  11460. NullFields []string `json:"-"`
  11461. }
  11462. func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  11463. type NoMethod UserRolePermissionGroupsListResponse
  11464. raw := NoMethod(*s)
  11465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11466. }
  11467. // UserRolePermissionsListResponse: User Role Permission List Response
  11468. type UserRolePermissionsListResponse struct {
  11469. // Kind: Identifies what kind of resource this is. Value: the fixed
  11470. // string "dfareporting#userRolePermissionsListResponse".
  11471. Kind string `json:"kind,omitempty"`
  11472. // UserRolePermissions: User role permission collection.
  11473. UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"`
  11474. // ServerResponse contains the HTTP response code and headers from the
  11475. // server.
  11476. googleapi.ServerResponse `json:"-"`
  11477. // ForceSendFields is a list of field names (e.g. "Kind") to
  11478. // unconditionally include in API requests. By default, fields with
  11479. // empty values are omitted from API requests. However, any non-pointer,
  11480. // non-interface field appearing in ForceSendFields will be sent to the
  11481. // server regardless of whether the field is empty or not. This may be
  11482. // used to include empty fields in Patch requests.
  11483. ForceSendFields []string `json:"-"`
  11484. // NullFields is a list of field names (e.g. "Kind") to include in API
  11485. // requests with the JSON null value. By default, fields with empty
  11486. // values are omitted from API requests. However, any field with an
  11487. // empty value appearing in NullFields will be sent to the server as
  11488. // null. It is an error if a field in this list has a non-empty value.
  11489. // This may be used to include null fields in Patch requests.
  11490. NullFields []string `json:"-"`
  11491. }
  11492. func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) {
  11493. type NoMethod UserRolePermissionsListResponse
  11494. raw := NoMethod(*s)
  11495. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11496. }
  11497. // UserRolesListResponse: User Role List Response
  11498. type UserRolesListResponse struct {
  11499. // Kind: Identifies what kind of resource this is. Value: the fixed
  11500. // string "dfareporting#userRolesListResponse".
  11501. Kind string `json:"kind,omitempty"`
  11502. // NextPageToken: Pagination token to be used for the next list
  11503. // operation.
  11504. NextPageToken string `json:"nextPageToken,omitempty"`
  11505. // UserRoles: User role collection.
  11506. UserRoles []*UserRole `json:"userRoles,omitempty"`
  11507. // ServerResponse contains the HTTP response code and headers from the
  11508. // server.
  11509. googleapi.ServerResponse `json:"-"`
  11510. // ForceSendFields is a list of field names (e.g. "Kind") to
  11511. // unconditionally include in API requests. By default, fields with
  11512. // empty values are omitted from API requests. However, any non-pointer,
  11513. // non-interface field appearing in ForceSendFields will be sent to the
  11514. // server regardless of whether the field is empty or not. This may be
  11515. // used to include empty fields in Patch requests.
  11516. ForceSendFields []string `json:"-"`
  11517. // NullFields is a list of field names (e.g. "Kind") to include in API
  11518. // requests with the JSON null value. By default, fields with empty
  11519. // values are omitted from API requests. However, any field with an
  11520. // empty value appearing in NullFields will be sent to the server as
  11521. // null. It is an error if a field in this list has a non-empty value.
  11522. // This may be used to include null fields in Patch requests.
  11523. NullFields []string `json:"-"`
  11524. }
  11525. func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) {
  11526. type NoMethod UserRolesListResponse
  11527. raw := NoMethod(*s)
  11528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11529. }
  11530. // VideoFormat: Contains information about supported video formats.
  11531. type VideoFormat struct {
  11532. // FileType: File type of the video format.
  11533. //
  11534. // Possible values:
  11535. // "FLV"
  11536. // "M3U8"
  11537. // "MP4"
  11538. // "THREEGPP"
  11539. // "WEBM"
  11540. FileType string `json:"fileType,omitempty"`
  11541. // Id: ID of the video format.
  11542. Id int64 `json:"id,omitempty"`
  11543. // Kind: Identifies what kind of resource this is. Value: the fixed
  11544. // string "dfareporting#videoFormat".
  11545. Kind string `json:"kind,omitempty"`
  11546. // Resolution: The resolution of this video format.
  11547. Resolution *Size `json:"resolution,omitempty"`
  11548. // TargetBitRate: The target bit rate of this video format.
  11549. TargetBitRate int64 `json:"targetBitRate,omitempty"`
  11550. // ServerResponse contains the HTTP response code and headers from the
  11551. // server.
  11552. googleapi.ServerResponse `json:"-"`
  11553. // ForceSendFields is a list of field names (e.g. "FileType") to
  11554. // unconditionally include in API requests. By default, fields with
  11555. // empty values are omitted from API requests. However, any non-pointer,
  11556. // non-interface field appearing in ForceSendFields will be sent to the
  11557. // server regardless of whether the field is empty or not. This may be
  11558. // used to include empty fields in Patch requests.
  11559. ForceSendFields []string `json:"-"`
  11560. // NullFields is a list of field names (e.g. "FileType") to include in
  11561. // API requests with the JSON null value. By default, fields with empty
  11562. // values are omitted from API requests. However, any field with an
  11563. // empty value appearing in NullFields will be sent to the server as
  11564. // null. It is an error if a field in this list has a non-empty value.
  11565. // This may be used to include null fields in Patch requests.
  11566. NullFields []string `json:"-"`
  11567. }
  11568. func (s *VideoFormat) MarshalJSON() ([]byte, error) {
  11569. type NoMethod VideoFormat
  11570. raw := NoMethod(*s)
  11571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11572. }
  11573. // VideoFormatsListResponse: Video Format List Response
  11574. type VideoFormatsListResponse struct {
  11575. // Kind: Identifies what kind of resource this is. Value: the fixed
  11576. // string "dfareporting#videoFormatsListResponse".
  11577. Kind string `json:"kind,omitempty"`
  11578. // VideoFormats: Video format collection.
  11579. VideoFormats []*VideoFormat `json:"videoFormats,omitempty"`
  11580. // ServerResponse contains the HTTP response code and headers from the
  11581. // server.
  11582. googleapi.ServerResponse `json:"-"`
  11583. // ForceSendFields is a list of field names (e.g. "Kind") to
  11584. // unconditionally include in API requests. By default, fields with
  11585. // empty values are omitted from API requests. However, any non-pointer,
  11586. // non-interface field appearing in ForceSendFields will be sent to the
  11587. // server regardless of whether the field is empty or not. This may be
  11588. // used to include empty fields in Patch requests.
  11589. ForceSendFields []string `json:"-"`
  11590. // NullFields is a list of field names (e.g. "Kind") to include in API
  11591. // requests with the JSON null value. By default, fields with empty
  11592. // values are omitted from API requests. However, any field with an
  11593. // empty value appearing in NullFields will be sent to the server as
  11594. // null. It is an error if a field in this list has a non-empty value.
  11595. // This may be used to include null fields in Patch requests.
  11596. NullFields []string `json:"-"`
  11597. }
  11598. func (s *VideoFormatsListResponse) MarshalJSON() ([]byte, error) {
  11599. type NoMethod VideoFormatsListResponse
  11600. raw := NoMethod(*s)
  11601. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11602. }
  11603. // VideoOffset: Video Offset
  11604. type VideoOffset struct {
  11605. // OffsetPercentage: Duration, as a percentage of video duration. Do not
  11606. // set when offsetSeconds is set. Acceptable values are 0 to 100,
  11607. // inclusive.
  11608. OffsetPercentage int64 `json:"offsetPercentage,omitempty"`
  11609. // OffsetSeconds: Duration, in seconds. Do not set when offsetPercentage
  11610. // is set. Acceptable values are 0 to 86399, inclusive.
  11611. OffsetSeconds int64 `json:"offsetSeconds,omitempty"`
  11612. // ForceSendFields is a list of field names (e.g. "OffsetPercentage") to
  11613. // unconditionally include in API requests. By default, fields with
  11614. // empty values are omitted from API requests. However, any non-pointer,
  11615. // non-interface field appearing in ForceSendFields will be sent to the
  11616. // server regardless of whether the field is empty or not. This may be
  11617. // used to include empty fields in Patch requests.
  11618. ForceSendFields []string `json:"-"`
  11619. // NullFields is a list of field names (e.g. "OffsetPercentage") to
  11620. // include in API requests with the JSON null value. By default, fields
  11621. // with empty values are omitted from API requests. However, any field
  11622. // with an empty value appearing in NullFields will be sent to the
  11623. // server as null. It is an error if a field in this list has a
  11624. // non-empty value. This may be used to include null fields in Patch
  11625. // requests.
  11626. NullFields []string `json:"-"`
  11627. }
  11628. func (s *VideoOffset) MarshalJSON() ([]byte, error) {
  11629. type NoMethod VideoOffset
  11630. raw := NoMethod(*s)
  11631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11632. }
  11633. // VideoSettings: Video Settings
  11634. type VideoSettings struct {
  11635. // CompanionSettings: Settings for the companion creatives of video
  11636. // creatives served to this placement.
  11637. CompanionSettings *CompanionSetting `json:"companionSettings,omitempty"`
  11638. // Kind: Identifies what kind of resource this is. Value: the fixed
  11639. // string "dfareporting#videoSettings".
  11640. Kind string `json:"kind,omitempty"`
  11641. // Orientation: Orientation of a video placement. If this value is set,
  11642. // placement will return assets matching the specified orientation.
  11643. //
  11644. // Possible values:
  11645. // "ANY"
  11646. // "LANDSCAPE"
  11647. // "PORTRAIT"
  11648. Orientation string `json:"orientation,omitempty"`
  11649. // SkippableSettings: Settings for the skippability of video creatives
  11650. // served to this placement. If this object is provided, the
  11651. // creative-level skippable settings will be overridden.
  11652. SkippableSettings *SkippableSetting `json:"skippableSettings,omitempty"`
  11653. // TranscodeSettings: Settings for the transcodes of video creatives
  11654. // served to this placement. If this object is provided, the
  11655. // creative-level transcode settings will be overridden.
  11656. TranscodeSettings *TranscodeSetting `json:"transcodeSettings,omitempty"`
  11657. // ForceSendFields is a list of field names (e.g. "CompanionSettings")
  11658. // to unconditionally include in API requests. By default, fields with
  11659. // empty values are omitted from API requests. However, any non-pointer,
  11660. // non-interface field appearing in ForceSendFields will be sent to the
  11661. // server regardless of whether the field is empty or not. This may be
  11662. // used to include empty fields in Patch requests.
  11663. ForceSendFields []string `json:"-"`
  11664. // NullFields is a list of field names (e.g. "CompanionSettings") to
  11665. // include in API requests with the JSON null value. By default, fields
  11666. // with empty values are omitted from API requests. However, any field
  11667. // with an empty value appearing in NullFields will be sent to the
  11668. // server as null. It is an error if a field in this list has a
  11669. // non-empty value. This may be used to include null fields in Patch
  11670. // requests.
  11671. NullFields []string `json:"-"`
  11672. }
  11673. func (s *VideoSettings) MarshalJSON() ([]byte, error) {
  11674. type NoMethod VideoSettings
  11675. raw := NoMethod(*s)
  11676. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11677. }
  11678. // method id "dfareporting.accountActiveAdSummaries.get":
  11679. type AccountActiveAdSummariesGetCall struct {
  11680. s *Service
  11681. profileId int64
  11682. summaryAccountId int64
  11683. urlParams_ gensupport.URLParams
  11684. ifNoneMatch_ string
  11685. ctx_ context.Context
  11686. header_ http.Header
  11687. }
  11688. // Get: Gets the account's active ad summary by account ID.
  11689. func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall {
  11690. c := &AccountActiveAdSummariesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11691. c.profileId = profileId
  11692. c.summaryAccountId = summaryAccountId
  11693. return c
  11694. }
  11695. // Fields allows partial responses to be retrieved. See
  11696. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11697. // for more information.
  11698. func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall {
  11699. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11700. return c
  11701. }
  11702. // IfNoneMatch sets the optional parameter which makes the operation
  11703. // fail if the object's ETag matches the given value. This is useful for
  11704. // getting updates only after the object has changed since the last
  11705. // request. Use googleapi.IsNotModified to check whether the response
  11706. // error from Do is the result of In-None-Match.
  11707. func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall {
  11708. c.ifNoneMatch_ = entityTag
  11709. return c
  11710. }
  11711. // Context sets the context to be used in this call's Do method. Any
  11712. // pending HTTP request will be aborted if the provided context is
  11713. // canceled.
  11714. func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall {
  11715. c.ctx_ = ctx
  11716. return c
  11717. }
  11718. // Header returns an http.Header that can be modified by the caller to
  11719. // add HTTP headers to the request.
  11720. func (c *AccountActiveAdSummariesGetCall) Header() http.Header {
  11721. if c.header_ == nil {
  11722. c.header_ = make(http.Header)
  11723. }
  11724. return c.header_
  11725. }
  11726. func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) {
  11727. reqHeaders := make(http.Header)
  11728. for k, v := range c.header_ {
  11729. reqHeaders[k] = v
  11730. }
  11731. reqHeaders.Set("User-Agent", c.s.userAgent())
  11732. if c.ifNoneMatch_ != "" {
  11733. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11734. }
  11735. var body io.Reader = nil
  11736. c.urlParams_.Set("alt", alt)
  11737. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}")
  11738. urls += "?" + c.urlParams_.Encode()
  11739. req, _ := http.NewRequest("GET", urls, body)
  11740. req.Header = reqHeaders
  11741. googleapi.Expand(req.URL, map[string]string{
  11742. "profileId": strconv.FormatInt(c.profileId, 10),
  11743. "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10),
  11744. })
  11745. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11746. }
  11747. // Do executes the "dfareporting.accountActiveAdSummaries.get" call.
  11748. // Exactly one of *AccountActiveAdSummary or error will be non-nil. Any
  11749. // non-2xx status code is an error. Response headers are in either
  11750. // *AccountActiveAdSummary.ServerResponse.Header or (if a response was
  11751. // returned at all) in error.(*googleapi.Error).Header. Use
  11752. // googleapi.IsNotModified to check whether the returned error was
  11753. // because http.StatusNotModified was returned.
  11754. func (c *AccountActiveAdSummariesGetCall) Do(opts ...googleapi.CallOption) (*AccountActiveAdSummary, error) {
  11755. gensupport.SetOptions(c.urlParams_, opts...)
  11756. res, err := c.doRequest("json")
  11757. if res != nil && res.StatusCode == http.StatusNotModified {
  11758. if res.Body != nil {
  11759. res.Body.Close()
  11760. }
  11761. return nil, &googleapi.Error{
  11762. Code: res.StatusCode,
  11763. Header: res.Header,
  11764. }
  11765. }
  11766. if err != nil {
  11767. return nil, err
  11768. }
  11769. defer googleapi.CloseBody(res)
  11770. if err := googleapi.CheckResponse(res); err != nil {
  11771. return nil, err
  11772. }
  11773. ret := &AccountActiveAdSummary{
  11774. ServerResponse: googleapi.ServerResponse{
  11775. Header: res.Header,
  11776. HTTPStatusCode: res.StatusCode,
  11777. },
  11778. }
  11779. target := &ret
  11780. if err := gensupport.DecodeResponse(target, res); err != nil {
  11781. return nil, err
  11782. }
  11783. return ret, nil
  11784. // {
  11785. // "description": "Gets the account's active ad summary by account ID.",
  11786. // "httpMethod": "GET",
  11787. // "id": "dfareporting.accountActiveAdSummaries.get",
  11788. // "parameterOrder": [
  11789. // "profileId",
  11790. // "summaryAccountId"
  11791. // ],
  11792. // "parameters": {
  11793. // "profileId": {
  11794. // "description": "User profile ID associated with this request.",
  11795. // "format": "int64",
  11796. // "location": "path",
  11797. // "required": true,
  11798. // "type": "string"
  11799. // },
  11800. // "summaryAccountId": {
  11801. // "description": "Account ID.",
  11802. // "format": "int64",
  11803. // "location": "path",
  11804. // "required": true,
  11805. // "type": "string"
  11806. // }
  11807. // },
  11808. // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}",
  11809. // "response": {
  11810. // "$ref": "AccountActiveAdSummary"
  11811. // },
  11812. // "scopes": [
  11813. // "https://www.googleapis.com/auth/dfatrafficking"
  11814. // ]
  11815. // }
  11816. }
  11817. // method id "dfareporting.accountPermissionGroups.get":
  11818. type AccountPermissionGroupsGetCall struct {
  11819. s *Service
  11820. profileId int64
  11821. id int64
  11822. urlParams_ gensupport.URLParams
  11823. ifNoneMatch_ string
  11824. ctx_ context.Context
  11825. header_ http.Header
  11826. }
  11827. // Get: Gets one account permission group by ID.
  11828. func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall {
  11829. c := &AccountPermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11830. c.profileId = profileId
  11831. c.id = id
  11832. return c
  11833. }
  11834. // Fields allows partial responses to be retrieved. See
  11835. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11836. // for more information.
  11837. func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall {
  11838. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11839. return c
  11840. }
  11841. // IfNoneMatch sets the optional parameter which makes the operation
  11842. // fail if the object's ETag matches the given value. This is useful for
  11843. // getting updates only after the object has changed since the last
  11844. // request. Use googleapi.IsNotModified to check whether the response
  11845. // error from Do is the result of In-None-Match.
  11846. func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall {
  11847. c.ifNoneMatch_ = entityTag
  11848. return c
  11849. }
  11850. // Context sets the context to be used in this call's Do method. Any
  11851. // pending HTTP request will be aborted if the provided context is
  11852. // canceled.
  11853. func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall {
  11854. c.ctx_ = ctx
  11855. return c
  11856. }
  11857. // Header returns an http.Header that can be modified by the caller to
  11858. // add HTTP headers to the request.
  11859. func (c *AccountPermissionGroupsGetCall) Header() http.Header {
  11860. if c.header_ == nil {
  11861. c.header_ = make(http.Header)
  11862. }
  11863. return c.header_
  11864. }
  11865. func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  11866. reqHeaders := make(http.Header)
  11867. for k, v := range c.header_ {
  11868. reqHeaders[k] = v
  11869. }
  11870. reqHeaders.Set("User-Agent", c.s.userAgent())
  11871. if c.ifNoneMatch_ != "" {
  11872. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11873. }
  11874. var body io.Reader = nil
  11875. c.urlParams_.Set("alt", alt)
  11876. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}")
  11877. urls += "?" + c.urlParams_.Encode()
  11878. req, _ := http.NewRequest("GET", urls, body)
  11879. req.Header = reqHeaders
  11880. googleapi.Expand(req.URL, map[string]string{
  11881. "profileId": strconv.FormatInt(c.profileId, 10),
  11882. "id": strconv.FormatInt(c.id, 10),
  11883. })
  11884. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11885. }
  11886. // Do executes the "dfareporting.accountPermissionGroups.get" call.
  11887. // Exactly one of *AccountPermissionGroup or error will be non-nil. Any
  11888. // non-2xx status code is an error. Response headers are in either
  11889. // *AccountPermissionGroup.ServerResponse.Header or (if a response was
  11890. // returned at all) in error.(*googleapi.Error).Header. Use
  11891. // googleapi.IsNotModified to check whether the returned error was
  11892. // because http.StatusNotModified was returned.
  11893. func (c *AccountPermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroup, error) {
  11894. gensupport.SetOptions(c.urlParams_, opts...)
  11895. res, err := c.doRequest("json")
  11896. if res != nil && res.StatusCode == http.StatusNotModified {
  11897. if res.Body != nil {
  11898. res.Body.Close()
  11899. }
  11900. return nil, &googleapi.Error{
  11901. Code: res.StatusCode,
  11902. Header: res.Header,
  11903. }
  11904. }
  11905. if err != nil {
  11906. return nil, err
  11907. }
  11908. defer googleapi.CloseBody(res)
  11909. if err := googleapi.CheckResponse(res); err != nil {
  11910. return nil, err
  11911. }
  11912. ret := &AccountPermissionGroup{
  11913. ServerResponse: googleapi.ServerResponse{
  11914. Header: res.Header,
  11915. HTTPStatusCode: res.StatusCode,
  11916. },
  11917. }
  11918. target := &ret
  11919. if err := gensupport.DecodeResponse(target, res); err != nil {
  11920. return nil, err
  11921. }
  11922. return ret, nil
  11923. // {
  11924. // "description": "Gets one account permission group by ID.",
  11925. // "httpMethod": "GET",
  11926. // "id": "dfareporting.accountPermissionGroups.get",
  11927. // "parameterOrder": [
  11928. // "profileId",
  11929. // "id"
  11930. // ],
  11931. // "parameters": {
  11932. // "id": {
  11933. // "description": "Account permission group ID.",
  11934. // "format": "int64",
  11935. // "location": "path",
  11936. // "required": true,
  11937. // "type": "string"
  11938. // },
  11939. // "profileId": {
  11940. // "description": "User profile ID associated with this request.",
  11941. // "format": "int64",
  11942. // "location": "path",
  11943. // "required": true,
  11944. // "type": "string"
  11945. // }
  11946. // },
  11947. // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}",
  11948. // "response": {
  11949. // "$ref": "AccountPermissionGroup"
  11950. // },
  11951. // "scopes": [
  11952. // "https://www.googleapis.com/auth/dfatrafficking"
  11953. // ]
  11954. // }
  11955. }
  11956. // method id "dfareporting.accountPermissionGroups.list":
  11957. type AccountPermissionGroupsListCall struct {
  11958. s *Service
  11959. profileId int64
  11960. urlParams_ gensupport.URLParams
  11961. ifNoneMatch_ string
  11962. ctx_ context.Context
  11963. header_ http.Header
  11964. }
  11965. // List: Retrieves the list of account permission groups.
  11966. func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall {
  11967. c := &AccountPermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11968. c.profileId = profileId
  11969. return c
  11970. }
  11971. // Fields allows partial responses to be retrieved. See
  11972. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11973. // for more information.
  11974. func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall {
  11975. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11976. return c
  11977. }
  11978. // IfNoneMatch sets the optional parameter which makes the operation
  11979. // fail if the object's ETag matches the given value. This is useful for
  11980. // getting updates only after the object has changed since the last
  11981. // request. Use googleapi.IsNotModified to check whether the response
  11982. // error from Do is the result of In-None-Match.
  11983. func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall {
  11984. c.ifNoneMatch_ = entityTag
  11985. return c
  11986. }
  11987. // Context sets the context to be used in this call's Do method. Any
  11988. // pending HTTP request will be aborted if the provided context is
  11989. // canceled.
  11990. func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall {
  11991. c.ctx_ = ctx
  11992. return c
  11993. }
  11994. // Header returns an http.Header that can be modified by the caller to
  11995. // add HTTP headers to the request.
  11996. func (c *AccountPermissionGroupsListCall) Header() http.Header {
  11997. if c.header_ == nil {
  11998. c.header_ = make(http.Header)
  11999. }
  12000. return c.header_
  12001. }
  12002. func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  12003. reqHeaders := make(http.Header)
  12004. for k, v := range c.header_ {
  12005. reqHeaders[k] = v
  12006. }
  12007. reqHeaders.Set("User-Agent", c.s.userAgent())
  12008. if c.ifNoneMatch_ != "" {
  12009. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12010. }
  12011. var body io.Reader = nil
  12012. c.urlParams_.Set("alt", alt)
  12013. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups")
  12014. urls += "?" + c.urlParams_.Encode()
  12015. req, _ := http.NewRequest("GET", urls, body)
  12016. req.Header = reqHeaders
  12017. googleapi.Expand(req.URL, map[string]string{
  12018. "profileId": strconv.FormatInt(c.profileId, 10),
  12019. })
  12020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12021. }
  12022. // Do executes the "dfareporting.accountPermissionGroups.list" call.
  12023. // Exactly one of *AccountPermissionGroupsListResponse or error will be
  12024. // non-nil. Any non-2xx status code is an error. Response headers are in
  12025. // either *AccountPermissionGroupsListResponse.ServerResponse.Header or
  12026. // (if a response was returned at all) in
  12027. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  12028. // whether the returned error was because http.StatusNotModified was
  12029. // returned.
  12030. func (c *AccountPermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroupsListResponse, error) {
  12031. gensupport.SetOptions(c.urlParams_, opts...)
  12032. res, err := c.doRequest("json")
  12033. if res != nil && res.StatusCode == http.StatusNotModified {
  12034. if res.Body != nil {
  12035. res.Body.Close()
  12036. }
  12037. return nil, &googleapi.Error{
  12038. Code: res.StatusCode,
  12039. Header: res.Header,
  12040. }
  12041. }
  12042. if err != nil {
  12043. return nil, err
  12044. }
  12045. defer googleapi.CloseBody(res)
  12046. if err := googleapi.CheckResponse(res); err != nil {
  12047. return nil, err
  12048. }
  12049. ret := &AccountPermissionGroupsListResponse{
  12050. ServerResponse: googleapi.ServerResponse{
  12051. Header: res.Header,
  12052. HTTPStatusCode: res.StatusCode,
  12053. },
  12054. }
  12055. target := &ret
  12056. if err := gensupport.DecodeResponse(target, res); err != nil {
  12057. return nil, err
  12058. }
  12059. return ret, nil
  12060. // {
  12061. // "description": "Retrieves the list of account permission groups.",
  12062. // "httpMethod": "GET",
  12063. // "id": "dfareporting.accountPermissionGroups.list",
  12064. // "parameterOrder": [
  12065. // "profileId"
  12066. // ],
  12067. // "parameters": {
  12068. // "profileId": {
  12069. // "description": "User profile ID associated with this request.",
  12070. // "format": "int64",
  12071. // "location": "path",
  12072. // "required": true,
  12073. // "type": "string"
  12074. // }
  12075. // },
  12076. // "path": "userprofiles/{profileId}/accountPermissionGroups",
  12077. // "response": {
  12078. // "$ref": "AccountPermissionGroupsListResponse"
  12079. // },
  12080. // "scopes": [
  12081. // "https://www.googleapis.com/auth/dfatrafficking"
  12082. // ]
  12083. // }
  12084. }
  12085. // method id "dfareporting.accountPermissions.get":
  12086. type AccountPermissionsGetCall struct {
  12087. s *Service
  12088. profileId int64
  12089. id int64
  12090. urlParams_ gensupport.URLParams
  12091. ifNoneMatch_ string
  12092. ctx_ context.Context
  12093. header_ http.Header
  12094. }
  12095. // Get: Gets one account permission by ID.
  12096. func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall {
  12097. c := &AccountPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12098. c.profileId = profileId
  12099. c.id = id
  12100. return c
  12101. }
  12102. // Fields allows partial responses to be retrieved. See
  12103. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12104. // for more information.
  12105. func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall {
  12106. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12107. return c
  12108. }
  12109. // IfNoneMatch sets the optional parameter which makes the operation
  12110. // fail if the object's ETag matches the given value. This is useful for
  12111. // getting updates only after the object has changed since the last
  12112. // request. Use googleapi.IsNotModified to check whether the response
  12113. // error from Do is the result of In-None-Match.
  12114. func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall {
  12115. c.ifNoneMatch_ = entityTag
  12116. return c
  12117. }
  12118. // Context sets the context to be used in this call's Do method. Any
  12119. // pending HTTP request will be aborted if the provided context is
  12120. // canceled.
  12121. func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall {
  12122. c.ctx_ = ctx
  12123. return c
  12124. }
  12125. // Header returns an http.Header that can be modified by the caller to
  12126. // add HTTP headers to the request.
  12127. func (c *AccountPermissionsGetCall) Header() http.Header {
  12128. if c.header_ == nil {
  12129. c.header_ = make(http.Header)
  12130. }
  12131. return c.header_
  12132. }
  12133. func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  12134. reqHeaders := make(http.Header)
  12135. for k, v := range c.header_ {
  12136. reqHeaders[k] = v
  12137. }
  12138. reqHeaders.Set("User-Agent", c.s.userAgent())
  12139. if c.ifNoneMatch_ != "" {
  12140. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12141. }
  12142. var body io.Reader = nil
  12143. c.urlParams_.Set("alt", alt)
  12144. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}")
  12145. urls += "?" + c.urlParams_.Encode()
  12146. req, _ := http.NewRequest("GET", urls, body)
  12147. req.Header = reqHeaders
  12148. googleapi.Expand(req.URL, map[string]string{
  12149. "profileId": strconv.FormatInt(c.profileId, 10),
  12150. "id": strconv.FormatInt(c.id, 10),
  12151. })
  12152. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12153. }
  12154. // Do executes the "dfareporting.accountPermissions.get" call.
  12155. // Exactly one of *AccountPermission or error will be non-nil. Any
  12156. // non-2xx status code is an error. Response headers are in either
  12157. // *AccountPermission.ServerResponse.Header or (if a response was
  12158. // returned at all) in error.(*googleapi.Error).Header. Use
  12159. // googleapi.IsNotModified to check whether the returned error was
  12160. // because http.StatusNotModified was returned.
  12161. func (c *AccountPermissionsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermission, error) {
  12162. gensupport.SetOptions(c.urlParams_, opts...)
  12163. res, err := c.doRequest("json")
  12164. if res != nil && res.StatusCode == http.StatusNotModified {
  12165. if res.Body != nil {
  12166. res.Body.Close()
  12167. }
  12168. return nil, &googleapi.Error{
  12169. Code: res.StatusCode,
  12170. Header: res.Header,
  12171. }
  12172. }
  12173. if err != nil {
  12174. return nil, err
  12175. }
  12176. defer googleapi.CloseBody(res)
  12177. if err := googleapi.CheckResponse(res); err != nil {
  12178. return nil, err
  12179. }
  12180. ret := &AccountPermission{
  12181. ServerResponse: googleapi.ServerResponse{
  12182. Header: res.Header,
  12183. HTTPStatusCode: res.StatusCode,
  12184. },
  12185. }
  12186. target := &ret
  12187. if err := gensupport.DecodeResponse(target, res); err != nil {
  12188. return nil, err
  12189. }
  12190. return ret, nil
  12191. // {
  12192. // "description": "Gets one account permission by ID.",
  12193. // "httpMethod": "GET",
  12194. // "id": "dfareporting.accountPermissions.get",
  12195. // "parameterOrder": [
  12196. // "profileId",
  12197. // "id"
  12198. // ],
  12199. // "parameters": {
  12200. // "id": {
  12201. // "description": "Account permission ID.",
  12202. // "format": "int64",
  12203. // "location": "path",
  12204. // "required": true,
  12205. // "type": "string"
  12206. // },
  12207. // "profileId": {
  12208. // "description": "User profile ID associated with this request.",
  12209. // "format": "int64",
  12210. // "location": "path",
  12211. // "required": true,
  12212. // "type": "string"
  12213. // }
  12214. // },
  12215. // "path": "userprofiles/{profileId}/accountPermissions/{id}",
  12216. // "response": {
  12217. // "$ref": "AccountPermission"
  12218. // },
  12219. // "scopes": [
  12220. // "https://www.googleapis.com/auth/dfatrafficking"
  12221. // ]
  12222. // }
  12223. }
  12224. // method id "dfareporting.accountPermissions.list":
  12225. type AccountPermissionsListCall struct {
  12226. s *Service
  12227. profileId int64
  12228. urlParams_ gensupport.URLParams
  12229. ifNoneMatch_ string
  12230. ctx_ context.Context
  12231. header_ http.Header
  12232. }
  12233. // List: Retrieves the list of account permissions.
  12234. func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall {
  12235. c := &AccountPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12236. c.profileId = profileId
  12237. return c
  12238. }
  12239. // Fields allows partial responses to be retrieved. See
  12240. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12241. // for more information.
  12242. func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall {
  12243. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12244. return c
  12245. }
  12246. // IfNoneMatch sets the optional parameter which makes the operation
  12247. // fail if the object's ETag matches the given value. This is useful for
  12248. // getting updates only after the object has changed since the last
  12249. // request. Use googleapi.IsNotModified to check whether the response
  12250. // error from Do is the result of In-None-Match.
  12251. func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall {
  12252. c.ifNoneMatch_ = entityTag
  12253. return c
  12254. }
  12255. // Context sets the context to be used in this call's Do method. Any
  12256. // pending HTTP request will be aborted if the provided context is
  12257. // canceled.
  12258. func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall {
  12259. c.ctx_ = ctx
  12260. return c
  12261. }
  12262. // Header returns an http.Header that can be modified by the caller to
  12263. // add HTTP headers to the request.
  12264. func (c *AccountPermissionsListCall) Header() http.Header {
  12265. if c.header_ == nil {
  12266. c.header_ = make(http.Header)
  12267. }
  12268. return c.header_
  12269. }
  12270. func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12271. reqHeaders := make(http.Header)
  12272. for k, v := range c.header_ {
  12273. reqHeaders[k] = v
  12274. }
  12275. reqHeaders.Set("User-Agent", c.s.userAgent())
  12276. if c.ifNoneMatch_ != "" {
  12277. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12278. }
  12279. var body io.Reader = nil
  12280. c.urlParams_.Set("alt", alt)
  12281. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions")
  12282. urls += "?" + c.urlParams_.Encode()
  12283. req, _ := http.NewRequest("GET", urls, body)
  12284. req.Header = reqHeaders
  12285. googleapi.Expand(req.URL, map[string]string{
  12286. "profileId": strconv.FormatInt(c.profileId, 10),
  12287. })
  12288. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12289. }
  12290. // Do executes the "dfareporting.accountPermissions.list" call.
  12291. // Exactly one of *AccountPermissionsListResponse or error will be
  12292. // non-nil. Any non-2xx status code is an error. Response headers are in
  12293. // either *AccountPermissionsListResponse.ServerResponse.Header or (if a
  12294. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12295. // googleapi.IsNotModified to check whether the returned error was
  12296. // because http.StatusNotModified was returned.
  12297. func (c *AccountPermissionsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionsListResponse, error) {
  12298. gensupport.SetOptions(c.urlParams_, opts...)
  12299. res, err := c.doRequest("json")
  12300. if res != nil && res.StatusCode == http.StatusNotModified {
  12301. if res.Body != nil {
  12302. res.Body.Close()
  12303. }
  12304. return nil, &googleapi.Error{
  12305. Code: res.StatusCode,
  12306. Header: res.Header,
  12307. }
  12308. }
  12309. if err != nil {
  12310. return nil, err
  12311. }
  12312. defer googleapi.CloseBody(res)
  12313. if err := googleapi.CheckResponse(res); err != nil {
  12314. return nil, err
  12315. }
  12316. ret := &AccountPermissionsListResponse{
  12317. ServerResponse: googleapi.ServerResponse{
  12318. Header: res.Header,
  12319. HTTPStatusCode: res.StatusCode,
  12320. },
  12321. }
  12322. target := &ret
  12323. if err := gensupport.DecodeResponse(target, res); err != nil {
  12324. return nil, err
  12325. }
  12326. return ret, nil
  12327. // {
  12328. // "description": "Retrieves the list of account permissions.",
  12329. // "httpMethod": "GET",
  12330. // "id": "dfareporting.accountPermissions.list",
  12331. // "parameterOrder": [
  12332. // "profileId"
  12333. // ],
  12334. // "parameters": {
  12335. // "profileId": {
  12336. // "description": "User profile ID associated with this request.",
  12337. // "format": "int64",
  12338. // "location": "path",
  12339. // "required": true,
  12340. // "type": "string"
  12341. // }
  12342. // },
  12343. // "path": "userprofiles/{profileId}/accountPermissions",
  12344. // "response": {
  12345. // "$ref": "AccountPermissionsListResponse"
  12346. // },
  12347. // "scopes": [
  12348. // "https://www.googleapis.com/auth/dfatrafficking"
  12349. // ]
  12350. // }
  12351. }
  12352. // method id "dfareporting.accountUserProfiles.get":
  12353. type AccountUserProfilesGetCall struct {
  12354. s *Service
  12355. profileId int64
  12356. id int64
  12357. urlParams_ gensupport.URLParams
  12358. ifNoneMatch_ string
  12359. ctx_ context.Context
  12360. header_ http.Header
  12361. }
  12362. // Get: Gets one account user profile by ID.
  12363. func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall {
  12364. c := &AccountUserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12365. c.profileId = profileId
  12366. c.id = id
  12367. return c
  12368. }
  12369. // Fields allows partial responses to be retrieved. See
  12370. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12371. // for more information.
  12372. func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall {
  12373. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12374. return c
  12375. }
  12376. // IfNoneMatch sets the optional parameter which makes the operation
  12377. // fail if the object's ETag matches the given value. This is useful for
  12378. // getting updates only after the object has changed since the last
  12379. // request. Use googleapi.IsNotModified to check whether the response
  12380. // error from Do is the result of In-None-Match.
  12381. func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall {
  12382. c.ifNoneMatch_ = entityTag
  12383. return c
  12384. }
  12385. // Context sets the context to be used in this call's Do method. Any
  12386. // pending HTTP request will be aborted if the provided context is
  12387. // canceled.
  12388. func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall {
  12389. c.ctx_ = ctx
  12390. return c
  12391. }
  12392. // Header returns an http.Header that can be modified by the caller to
  12393. // add HTTP headers to the request.
  12394. func (c *AccountUserProfilesGetCall) Header() http.Header {
  12395. if c.header_ == nil {
  12396. c.header_ = make(http.Header)
  12397. }
  12398. return c.header_
  12399. }
  12400. func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12401. reqHeaders := make(http.Header)
  12402. for k, v := range c.header_ {
  12403. reqHeaders[k] = v
  12404. }
  12405. reqHeaders.Set("User-Agent", c.s.userAgent())
  12406. if c.ifNoneMatch_ != "" {
  12407. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12408. }
  12409. var body io.Reader = nil
  12410. c.urlParams_.Set("alt", alt)
  12411. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}")
  12412. urls += "?" + c.urlParams_.Encode()
  12413. req, _ := http.NewRequest("GET", urls, body)
  12414. req.Header = reqHeaders
  12415. googleapi.Expand(req.URL, map[string]string{
  12416. "profileId": strconv.FormatInt(c.profileId, 10),
  12417. "id": strconv.FormatInt(c.id, 10),
  12418. })
  12419. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12420. }
  12421. // Do executes the "dfareporting.accountUserProfiles.get" call.
  12422. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12423. // non-2xx status code is an error. Response headers are in either
  12424. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12425. // returned at all) in error.(*googleapi.Error).Header. Use
  12426. // googleapi.IsNotModified to check whether the returned error was
  12427. // because http.StatusNotModified was returned.
  12428. func (c *AccountUserProfilesGetCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12429. gensupport.SetOptions(c.urlParams_, opts...)
  12430. res, err := c.doRequest("json")
  12431. if res != nil && res.StatusCode == http.StatusNotModified {
  12432. if res.Body != nil {
  12433. res.Body.Close()
  12434. }
  12435. return nil, &googleapi.Error{
  12436. Code: res.StatusCode,
  12437. Header: res.Header,
  12438. }
  12439. }
  12440. if err != nil {
  12441. return nil, err
  12442. }
  12443. defer googleapi.CloseBody(res)
  12444. if err := googleapi.CheckResponse(res); err != nil {
  12445. return nil, err
  12446. }
  12447. ret := &AccountUserProfile{
  12448. ServerResponse: googleapi.ServerResponse{
  12449. Header: res.Header,
  12450. HTTPStatusCode: res.StatusCode,
  12451. },
  12452. }
  12453. target := &ret
  12454. if err := gensupport.DecodeResponse(target, res); err != nil {
  12455. return nil, err
  12456. }
  12457. return ret, nil
  12458. // {
  12459. // "description": "Gets one account user profile by ID.",
  12460. // "httpMethod": "GET",
  12461. // "id": "dfareporting.accountUserProfiles.get",
  12462. // "parameterOrder": [
  12463. // "profileId",
  12464. // "id"
  12465. // ],
  12466. // "parameters": {
  12467. // "id": {
  12468. // "description": "User profile ID.",
  12469. // "format": "int64",
  12470. // "location": "path",
  12471. // "required": true,
  12472. // "type": "string"
  12473. // },
  12474. // "profileId": {
  12475. // "description": "User profile ID associated with this request.",
  12476. // "format": "int64",
  12477. // "location": "path",
  12478. // "required": true,
  12479. // "type": "string"
  12480. // }
  12481. // },
  12482. // "path": "userprofiles/{profileId}/accountUserProfiles/{id}",
  12483. // "response": {
  12484. // "$ref": "AccountUserProfile"
  12485. // },
  12486. // "scopes": [
  12487. // "https://www.googleapis.com/auth/dfatrafficking"
  12488. // ]
  12489. // }
  12490. }
  12491. // method id "dfareporting.accountUserProfiles.insert":
  12492. type AccountUserProfilesInsertCall struct {
  12493. s *Service
  12494. profileId int64
  12495. accountuserprofile *AccountUserProfile
  12496. urlParams_ gensupport.URLParams
  12497. ctx_ context.Context
  12498. header_ http.Header
  12499. }
  12500. // Insert: Inserts a new account user profile.
  12501. func (r *AccountUserProfilesService) Insert(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesInsertCall {
  12502. c := &AccountUserProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12503. c.profileId = profileId
  12504. c.accountuserprofile = accountuserprofile
  12505. return c
  12506. }
  12507. // Fields allows partial responses to be retrieved. See
  12508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12509. // for more information.
  12510. func (c *AccountUserProfilesInsertCall) Fields(s ...googleapi.Field) *AccountUserProfilesInsertCall {
  12511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12512. return c
  12513. }
  12514. // Context sets the context to be used in this call's Do method. Any
  12515. // pending HTTP request will be aborted if the provided context is
  12516. // canceled.
  12517. func (c *AccountUserProfilesInsertCall) Context(ctx context.Context) *AccountUserProfilesInsertCall {
  12518. c.ctx_ = ctx
  12519. return c
  12520. }
  12521. // Header returns an http.Header that can be modified by the caller to
  12522. // add HTTP headers to the request.
  12523. func (c *AccountUserProfilesInsertCall) Header() http.Header {
  12524. if c.header_ == nil {
  12525. c.header_ = make(http.Header)
  12526. }
  12527. return c.header_
  12528. }
  12529. func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12530. reqHeaders := make(http.Header)
  12531. for k, v := range c.header_ {
  12532. reqHeaders[k] = v
  12533. }
  12534. reqHeaders.Set("User-Agent", c.s.userAgent())
  12535. var body io.Reader = nil
  12536. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12537. if err != nil {
  12538. return nil, err
  12539. }
  12540. reqHeaders.Set("Content-Type", "application/json")
  12541. c.urlParams_.Set("alt", alt)
  12542. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12543. urls += "?" + c.urlParams_.Encode()
  12544. req, _ := http.NewRequest("POST", urls, body)
  12545. req.Header = reqHeaders
  12546. googleapi.Expand(req.URL, map[string]string{
  12547. "profileId": strconv.FormatInt(c.profileId, 10),
  12548. })
  12549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12550. }
  12551. // Do executes the "dfareporting.accountUserProfiles.insert" call.
  12552. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12553. // non-2xx status code is an error. Response headers are in either
  12554. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12555. // returned at all) in error.(*googleapi.Error).Header. Use
  12556. // googleapi.IsNotModified to check whether the returned error was
  12557. // because http.StatusNotModified was returned.
  12558. func (c *AccountUserProfilesInsertCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12559. gensupport.SetOptions(c.urlParams_, opts...)
  12560. res, err := c.doRequest("json")
  12561. if res != nil && res.StatusCode == http.StatusNotModified {
  12562. if res.Body != nil {
  12563. res.Body.Close()
  12564. }
  12565. return nil, &googleapi.Error{
  12566. Code: res.StatusCode,
  12567. Header: res.Header,
  12568. }
  12569. }
  12570. if err != nil {
  12571. return nil, err
  12572. }
  12573. defer googleapi.CloseBody(res)
  12574. if err := googleapi.CheckResponse(res); err != nil {
  12575. return nil, err
  12576. }
  12577. ret := &AccountUserProfile{
  12578. ServerResponse: googleapi.ServerResponse{
  12579. Header: res.Header,
  12580. HTTPStatusCode: res.StatusCode,
  12581. },
  12582. }
  12583. target := &ret
  12584. if err := gensupport.DecodeResponse(target, res); err != nil {
  12585. return nil, err
  12586. }
  12587. return ret, nil
  12588. // {
  12589. // "description": "Inserts a new account user profile.",
  12590. // "httpMethod": "POST",
  12591. // "id": "dfareporting.accountUserProfiles.insert",
  12592. // "parameterOrder": [
  12593. // "profileId"
  12594. // ],
  12595. // "parameters": {
  12596. // "profileId": {
  12597. // "description": "User profile ID associated with this request.",
  12598. // "format": "int64",
  12599. // "location": "path",
  12600. // "required": true,
  12601. // "type": "string"
  12602. // }
  12603. // },
  12604. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12605. // "request": {
  12606. // "$ref": "AccountUserProfile"
  12607. // },
  12608. // "response": {
  12609. // "$ref": "AccountUserProfile"
  12610. // },
  12611. // "scopes": [
  12612. // "https://www.googleapis.com/auth/dfatrafficking"
  12613. // ]
  12614. // }
  12615. }
  12616. // method id "dfareporting.accountUserProfiles.list":
  12617. type AccountUserProfilesListCall struct {
  12618. s *Service
  12619. profileId int64
  12620. urlParams_ gensupport.URLParams
  12621. ifNoneMatch_ string
  12622. ctx_ context.Context
  12623. header_ http.Header
  12624. }
  12625. // List: Retrieves a list of account user profiles, possibly filtered.
  12626. // This method supports paging.
  12627. func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall {
  12628. c := &AccountUserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12629. c.profileId = profileId
  12630. return c
  12631. }
  12632. // Active sets the optional parameter "active": Select only active user
  12633. // profiles.
  12634. func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall {
  12635. c.urlParams_.Set("active", fmt.Sprint(active))
  12636. return c
  12637. }
  12638. // Ids sets the optional parameter "ids": Select only user profiles with
  12639. // these IDs.
  12640. func (c *AccountUserProfilesListCall) Ids(ids ...int64) *AccountUserProfilesListCall {
  12641. var ids_ []string
  12642. for _, v := range ids {
  12643. ids_ = append(ids_, fmt.Sprint(v))
  12644. }
  12645. c.urlParams_.SetMulti("ids", ids_)
  12646. return c
  12647. }
  12648. // MaxResults sets the optional parameter "maxResults": Maximum number
  12649. // of results to return.
  12650. func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall {
  12651. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12652. return c
  12653. }
  12654. // PageToken sets the optional parameter "pageToken": Value of the
  12655. // nextPageToken from the previous result page.
  12656. func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall {
  12657. c.urlParams_.Set("pageToken", pageToken)
  12658. return c
  12659. }
  12660. // SearchString sets the optional parameter "searchString": Allows
  12661. // searching for objects by name, ID or email. Wildcards (*) are
  12662. // allowed. For example, "user profile*2015" will return objects with
  12663. // names like "user profile June 2015", "user profile April 2015", or
  12664. // simply "user profile 2015". Most of the searches also add wildcards
  12665. // implicitly at the start and the end of the search string. For
  12666. // example, a search string of "user profile" will match objects with
  12667. // name "my user profile", "user profile 2015", or simply "user
  12668. // profile".
  12669. func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall {
  12670. c.urlParams_.Set("searchString", searchString)
  12671. return c
  12672. }
  12673. // SortField sets the optional parameter "sortField": Field by which to
  12674. // sort the list.
  12675. //
  12676. // Possible values:
  12677. // "ID" (default)
  12678. // "NAME"
  12679. func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall {
  12680. c.urlParams_.Set("sortField", sortField)
  12681. return c
  12682. }
  12683. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  12684. // results.
  12685. //
  12686. // Possible values:
  12687. // "ASCENDING" (default)
  12688. // "DESCENDING"
  12689. func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall {
  12690. c.urlParams_.Set("sortOrder", sortOrder)
  12691. return c
  12692. }
  12693. // SubaccountId sets the optional parameter "subaccountId": Select only
  12694. // user profiles with the specified subaccount ID.
  12695. func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall {
  12696. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  12697. return c
  12698. }
  12699. // UserRoleId sets the optional parameter "userRoleId": Select only user
  12700. // profiles with the specified user role ID.
  12701. func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall {
  12702. c.urlParams_.Set("userRoleId", fmt.Sprint(userRoleId))
  12703. return c
  12704. }
  12705. // Fields allows partial responses to be retrieved. See
  12706. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12707. // for more information.
  12708. func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall {
  12709. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12710. return c
  12711. }
  12712. // IfNoneMatch sets the optional parameter which makes the operation
  12713. // fail if the object's ETag matches the given value. This is useful for
  12714. // getting updates only after the object has changed since the last
  12715. // request. Use googleapi.IsNotModified to check whether the response
  12716. // error from Do is the result of In-None-Match.
  12717. func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall {
  12718. c.ifNoneMatch_ = entityTag
  12719. return c
  12720. }
  12721. // Context sets the context to be used in this call's Do method. Any
  12722. // pending HTTP request will be aborted if the provided context is
  12723. // canceled.
  12724. func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall {
  12725. c.ctx_ = ctx
  12726. return c
  12727. }
  12728. // Header returns an http.Header that can be modified by the caller to
  12729. // add HTTP headers to the request.
  12730. func (c *AccountUserProfilesListCall) Header() http.Header {
  12731. if c.header_ == nil {
  12732. c.header_ = make(http.Header)
  12733. }
  12734. return c.header_
  12735. }
  12736. func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12737. reqHeaders := make(http.Header)
  12738. for k, v := range c.header_ {
  12739. reqHeaders[k] = v
  12740. }
  12741. reqHeaders.Set("User-Agent", c.s.userAgent())
  12742. if c.ifNoneMatch_ != "" {
  12743. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12744. }
  12745. var body io.Reader = nil
  12746. c.urlParams_.Set("alt", alt)
  12747. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12748. urls += "?" + c.urlParams_.Encode()
  12749. req, _ := http.NewRequest("GET", urls, body)
  12750. req.Header = reqHeaders
  12751. googleapi.Expand(req.URL, map[string]string{
  12752. "profileId": strconv.FormatInt(c.profileId, 10),
  12753. })
  12754. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12755. }
  12756. // Do executes the "dfareporting.accountUserProfiles.list" call.
  12757. // Exactly one of *AccountUserProfilesListResponse or error will be
  12758. // non-nil. Any non-2xx status code is an error. Response headers are in
  12759. // either *AccountUserProfilesListResponse.ServerResponse.Header or (if
  12760. // a response was returned at all) in error.(*googleapi.Error).Header.
  12761. // Use googleapi.IsNotModified to check whether the returned error was
  12762. // because http.StatusNotModified was returned.
  12763. func (c *AccountUserProfilesListCall) Do(opts ...googleapi.CallOption) (*AccountUserProfilesListResponse, error) {
  12764. gensupport.SetOptions(c.urlParams_, opts...)
  12765. res, err := c.doRequest("json")
  12766. if res != nil && res.StatusCode == http.StatusNotModified {
  12767. if res.Body != nil {
  12768. res.Body.Close()
  12769. }
  12770. return nil, &googleapi.Error{
  12771. Code: res.StatusCode,
  12772. Header: res.Header,
  12773. }
  12774. }
  12775. if err != nil {
  12776. return nil, err
  12777. }
  12778. defer googleapi.CloseBody(res)
  12779. if err := googleapi.CheckResponse(res); err != nil {
  12780. return nil, err
  12781. }
  12782. ret := &AccountUserProfilesListResponse{
  12783. ServerResponse: googleapi.ServerResponse{
  12784. Header: res.Header,
  12785. HTTPStatusCode: res.StatusCode,
  12786. },
  12787. }
  12788. target := &ret
  12789. if err := gensupport.DecodeResponse(target, res); err != nil {
  12790. return nil, err
  12791. }
  12792. return ret, nil
  12793. // {
  12794. // "description": "Retrieves a list of account user profiles, possibly filtered. This method supports paging.",
  12795. // "httpMethod": "GET",
  12796. // "id": "dfareporting.accountUserProfiles.list",
  12797. // "parameterOrder": [
  12798. // "profileId"
  12799. // ],
  12800. // "parameters": {
  12801. // "active": {
  12802. // "description": "Select only active user profiles.",
  12803. // "location": "query",
  12804. // "type": "boolean"
  12805. // },
  12806. // "ids": {
  12807. // "description": "Select only user profiles with these IDs.",
  12808. // "format": "int64",
  12809. // "location": "query",
  12810. // "repeated": true,
  12811. // "type": "string"
  12812. // },
  12813. // "maxResults": {
  12814. // "default": "1000",
  12815. // "description": "Maximum number of results to return.",
  12816. // "format": "int32",
  12817. // "location": "query",
  12818. // "maximum": "1000",
  12819. // "minimum": "0",
  12820. // "type": "integer"
  12821. // },
  12822. // "pageToken": {
  12823. // "description": "Value of the nextPageToken from the previous result page.",
  12824. // "location": "query",
  12825. // "type": "string"
  12826. // },
  12827. // "profileId": {
  12828. // "description": "User profile ID associated with this request.",
  12829. // "format": "int64",
  12830. // "location": "path",
  12831. // "required": true,
  12832. // "type": "string"
  12833. // },
  12834. // "searchString": {
  12835. // "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\".",
  12836. // "location": "query",
  12837. // "type": "string"
  12838. // },
  12839. // "sortField": {
  12840. // "default": "ID",
  12841. // "description": "Field by which to sort the list.",
  12842. // "enum": [
  12843. // "ID",
  12844. // "NAME"
  12845. // ],
  12846. // "enumDescriptions": [
  12847. // "",
  12848. // ""
  12849. // ],
  12850. // "location": "query",
  12851. // "type": "string"
  12852. // },
  12853. // "sortOrder": {
  12854. // "default": "ASCENDING",
  12855. // "description": "Order of sorted results.",
  12856. // "enum": [
  12857. // "ASCENDING",
  12858. // "DESCENDING"
  12859. // ],
  12860. // "enumDescriptions": [
  12861. // "",
  12862. // ""
  12863. // ],
  12864. // "location": "query",
  12865. // "type": "string"
  12866. // },
  12867. // "subaccountId": {
  12868. // "description": "Select only user profiles with the specified subaccount ID.",
  12869. // "format": "int64",
  12870. // "location": "query",
  12871. // "type": "string"
  12872. // },
  12873. // "userRoleId": {
  12874. // "description": "Select only user profiles with the specified user role ID.",
  12875. // "format": "int64",
  12876. // "location": "query",
  12877. // "type": "string"
  12878. // }
  12879. // },
  12880. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12881. // "response": {
  12882. // "$ref": "AccountUserProfilesListResponse"
  12883. // },
  12884. // "scopes": [
  12885. // "https://www.googleapis.com/auth/dfatrafficking"
  12886. // ]
  12887. // }
  12888. }
  12889. // Pages invokes f for each page of results.
  12890. // A non-nil error returned from f will halt the iteration.
  12891. // The provided context supersedes any context provided to the Context method.
  12892. func (c *AccountUserProfilesListCall) Pages(ctx context.Context, f func(*AccountUserProfilesListResponse) error) error {
  12893. c.ctx_ = ctx
  12894. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12895. for {
  12896. x, err := c.Do()
  12897. if err != nil {
  12898. return err
  12899. }
  12900. if err := f(x); err != nil {
  12901. return err
  12902. }
  12903. if x.NextPageToken == "" {
  12904. return nil
  12905. }
  12906. c.PageToken(x.NextPageToken)
  12907. }
  12908. }
  12909. // method id "dfareporting.accountUserProfiles.patch":
  12910. type AccountUserProfilesPatchCall struct {
  12911. s *Service
  12912. profileId int64
  12913. accountuserprofile *AccountUserProfile
  12914. urlParams_ gensupport.URLParams
  12915. ctx_ context.Context
  12916. header_ http.Header
  12917. }
  12918. // Patch: Updates an existing account user profile. This method supports
  12919. // patch semantics.
  12920. func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall {
  12921. c := &AccountUserProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12922. c.profileId = profileId
  12923. c.urlParams_.Set("id", fmt.Sprint(id))
  12924. c.accountuserprofile = accountuserprofile
  12925. return c
  12926. }
  12927. // Fields allows partial responses to be retrieved. See
  12928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12929. // for more information.
  12930. func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall {
  12931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12932. return c
  12933. }
  12934. // Context sets the context to be used in this call's Do method. Any
  12935. // pending HTTP request will be aborted if the provided context is
  12936. // canceled.
  12937. func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall {
  12938. c.ctx_ = ctx
  12939. return c
  12940. }
  12941. // Header returns an http.Header that can be modified by the caller to
  12942. // add HTTP headers to the request.
  12943. func (c *AccountUserProfilesPatchCall) Header() http.Header {
  12944. if c.header_ == nil {
  12945. c.header_ = make(http.Header)
  12946. }
  12947. return c.header_
  12948. }
  12949. func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  12950. reqHeaders := make(http.Header)
  12951. for k, v := range c.header_ {
  12952. reqHeaders[k] = v
  12953. }
  12954. reqHeaders.Set("User-Agent", c.s.userAgent())
  12955. var body io.Reader = nil
  12956. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12957. if err != nil {
  12958. return nil, err
  12959. }
  12960. reqHeaders.Set("Content-Type", "application/json")
  12961. c.urlParams_.Set("alt", alt)
  12962. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12963. urls += "?" + c.urlParams_.Encode()
  12964. req, _ := http.NewRequest("PATCH", urls, body)
  12965. req.Header = reqHeaders
  12966. googleapi.Expand(req.URL, map[string]string{
  12967. "profileId": strconv.FormatInt(c.profileId, 10),
  12968. })
  12969. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12970. }
  12971. // Do executes the "dfareporting.accountUserProfiles.patch" call.
  12972. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12973. // non-2xx status code is an error. Response headers are in either
  12974. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12975. // returned at all) in error.(*googleapi.Error).Header. Use
  12976. // googleapi.IsNotModified to check whether the returned error was
  12977. // because http.StatusNotModified was returned.
  12978. func (c *AccountUserProfilesPatchCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12979. gensupport.SetOptions(c.urlParams_, opts...)
  12980. res, err := c.doRequest("json")
  12981. if res != nil && res.StatusCode == http.StatusNotModified {
  12982. if res.Body != nil {
  12983. res.Body.Close()
  12984. }
  12985. return nil, &googleapi.Error{
  12986. Code: res.StatusCode,
  12987. Header: res.Header,
  12988. }
  12989. }
  12990. if err != nil {
  12991. return nil, err
  12992. }
  12993. defer googleapi.CloseBody(res)
  12994. if err := googleapi.CheckResponse(res); err != nil {
  12995. return nil, err
  12996. }
  12997. ret := &AccountUserProfile{
  12998. ServerResponse: googleapi.ServerResponse{
  12999. Header: res.Header,
  13000. HTTPStatusCode: res.StatusCode,
  13001. },
  13002. }
  13003. target := &ret
  13004. if err := gensupport.DecodeResponse(target, res); err != nil {
  13005. return nil, err
  13006. }
  13007. return ret, nil
  13008. // {
  13009. // "description": "Updates an existing account user profile. This method supports patch semantics.",
  13010. // "httpMethod": "PATCH",
  13011. // "id": "dfareporting.accountUserProfiles.patch",
  13012. // "parameterOrder": [
  13013. // "profileId",
  13014. // "id"
  13015. // ],
  13016. // "parameters": {
  13017. // "id": {
  13018. // "description": "User profile ID.",
  13019. // "format": "int64",
  13020. // "location": "query",
  13021. // "required": true,
  13022. // "type": "string"
  13023. // },
  13024. // "profileId": {
  13025. // "description": "User profile ID associated with this request.",
  13026. // "format": "int64",
  13027. // "location": "path",
  13028. // "required": true,
  13029. // "type": "string"
  13030. // }
  13031. // },
  13032. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13033. // "request": {
  13034. // "$ref": "AccountUserProfile"
  13035. // },
  13036. // "response": {
  13037. // "$ref": "AccountUserProfile"
  13038. // },
  13039. // "scopes": [
  13040. // "https://www.googleapis.com/auth/dfatrafficking"
  13041. // ]
  13042. // }
  13043. }
  13044. // method id "dfareporting.accountUserProfiles.update":
  13045. type AccountUserProfilesUpdateCall struct {
  13046. s *Service
  13047. profileId int64
  13048. accountuserprofile *AccountUserProfile
  13049. urlParams_ gensupport.URLParams
  13050. ctx_ context.Context
  13051. header_ http.Header
  13052. }
  13053. // Update: Updates an existing account user profile.
  13054. func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall {
  13055. c := &AccountUserProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13056. c.profileId = profileId
  13057. c.accountuserprofile = accountuserprofile
  13058. return c
  13059. }
  13060. // Fields allows partial responses to be retrieved. See
  13061. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13062. // for more information.
  13063. func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall {
  13064. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13065. return c
  13066. }
  13067. // Context sets the context to be used in this call's Do method. Any
  13068. // pending HTTP request will be aborted if the provided context is
  13069. // canceled.
  13070. func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall {
  13071. c.ctx_ = ctx
  13072. return c
  13073. }
  13074. // Header returns an http.Header that can be modified by the caller to
  13075. // add HTTP headers to the request.
  13076. func (c *AccountUserProfilesUpdateCall) Header() http.Header {
  13077. if c.header_ == nil {
  13078. c.header_ = make(http.Header)
  13079. }
  13080. return c.header_
  13081. }
  13082. func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  13083. reqHeaders := make(http.Header)
  13084. for k, v := range c.header_ {
  13085. reqHeaders[k] = v
  13086. }
  13087. reqHeaders.Set("User-Agent", c.s.userAgent())
  13088. var body io.Reader = nil
  13089. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  13090. if err != nil {
  13091. return nil, err
  13092. }
  13093. reqHeaders.Set("Content-Type", "application/json")
  13094. c.urlParams_.Set("alt", alt)
  13095. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  13096. urls += "?" + c.urlParams_.Encode()
  13097. req, _ := http.NewRequest("PUT", urls, body)
  13098. req.Header = reqHeaders
  13099. googleapi.Expand(req.URL, map[string]string{
  13100. "profileId": strconv.FormatInt(c.profileId, 10),
  13101. })
  13102. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13103. }
  13104. // Do executes the "dfareporting.accountUserProfiles.update" call.
  13105. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  13106. // non-2xx status code is an error. Response headers are in either
  13107. // *AccountUserProfile.ServerResponse.Header or (if a response was
  13108. // returned at all) in error.(*googleapi.Error).Header. Use
  13109. // googleapi.IsNotModified to check whether the returned error was
  13110. // because http.StatusNotModified was returned.
  13111. func (c *AccountUserProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  13112. gensupport.SetOptions(c.urlParams_, opts...)
  13113. res, err := c.doRequest("json")
  13114. if res != nil && res.StatusCode == http.StatusNotModified {
  13115. if res.Body != nil {
  13116. res.Body.Close()
  13117. }
  13118. return nil, &googleapi.Error{
  13119. Code: res.StatusCode,
  13120. Header: res.Header,
  13121. }
  13122. }
  13123. if err != nil {
  13124. return nil, err
  13125. }
  13126. defer googleapi.CloseBody(res)
  13127. if err := googleapi.CheckResponse(res); err != nil {
  13128. return nil, err
  13129. }
  13130. ret := &AccountUserProfile{
  13131. ServerResponse: googleapi.ServerResponse{
  13132. Header: res.Header,
  13133. HTTPStatusCode: res.StatusCode,
  13134. },
  13135. }
  13136. target := &ret
  13137. if err := gensupport.DecodeResponse(target, res); err != nil {
  13138. return nil, err
  13139. }
  13140. return ret, nil
  13141. // {
  13142. // "description": "Updates an existing account user profile.",
  13143. // "httpMethod": "PUT",
  13144. // "id": "dfareporting.accountUserProfiles.update",
  13145. // "parameterOrder": [
  13146. // "profileId"
  13147. // ],
  13148. // "parameters": {
  13149. // "profileId": {
  13150. // "description": "User profile ID associated with this request.",
  13151. // "format": "int64",
  13152. // "location": "path",
  13153. // "required": true,
  13154. // "type": "string"
  13155. // }
  13156. // },
  13157. // "path": "userprofiles/{profileId}/accountUserProfiles",
  13158. // "request": {
  13159. // "$ref": "AccountUserProfile"
  13160. // },
  13161. // "response": {
  13162. // "$ref": "AccountUserProfile"
  13163. // },
  13164. // "scopes": [
  13165. // "https://www.googleapis.com/auth/dfatrafficking"
  13166. // ]
  13167. // }
  13168. }
  13169. // method id "dfareporting.accounts.get":
  13170. type AccountsGetCall struct {
  13171. s *Service
  13172. profileId int64
  13173. id int64
  13174. urlParams_ gensupport.URLParams
  13175. ifNoneMatch_ string
  13176. ctx_ context.Context
  13177. header_ http.Header
  13178. }
  13179. // Get: Gets one account by ID.
  13180. func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall {
  13181. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13182. c.profileId = profileId
  13183. c.id = id
  13184. return c
  13185. }
  13186. // Fields allows partial responses to be retrieved. See
  13187. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13188. // for more information.
  13189. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  13190. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13191. return c
  13192. }
  13193. // IfNoneMatch sets the optional parameter which makes the operation
  13194. // fail if the object's ETag matches the given value. This is useful for
  13195. // getting updates only after the object has changed since the last
  13196. // request. Use googleapi.IsNotModified to check whether the response
  13197. // error from Do is the result of In-None-Match.
  13198. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  13199. c.ifNoneMatch_ = entityTag
  13200. return c
  13201. }
  13202. // Context sets the context to be used in this call's Do method. Any
  13203. // pending HTTP request will be aborted if the provided context is
  13204. // canceled.
  13205. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  13206. c.ctx_ = ctx
  13207. return c
  13208. }
  13209. // Header returns an http.Header that can be modified by the caller to
  13210. // add HTTP headers to the request.
  13211. func (c *AccountsGetCall) Header() http.Header {
  13212. if c.header_ == nil {
  13213. c.header_ = make(http.Header)
  13214. }
  13215. return c.header_
  13216. }
  13217. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  13218. reqHeaders := make(http.Header)
  13219. for k, v := range c.header_ {
  13220. reqHeaders[k] = v
  13221. }
  13222. reqHeaders.Set("User-Agent", c.s.userAgent())
  13223. if c.ifNoneMatch_ != "" {
  13224. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13225. }
  13226. var body io.Reader = nil
  13227. c.urlParams_.Set("alt", alt)
  13228. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}")
  13229. urls += "?" + c.urlParams_.Encode()
  13230. req, _ := http.NewRequest("GET", urls, body)
  13231. req.Header = reqHeaders
  13232. googleapi.Expand(req.URL, map[string]string{
  13233. "profileId": strconv.FormatInt(c.profileId, 10),
  13234. "id": strconv.FormatInt(c.id, 10),
  13235. })
  13236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13237. }
  13238. // Do executes the "dfareporting.accounts.get" call.
  13239. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13240. // code is an error. Response headers are in either
  13241. // *Account.ServerResponse.Header or (if a response was returned at all)
  13242. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13243. // check whether the returned error was because http.StatusNotModified
  13244. // was returned.
  13245. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13246. gensupport.SetOptions(c.urlParams_, opts...)
  13247. res, err := c.doRequest("json")
  13248. if res != nil && res.StatusCode == http.StatusNotModified {
  13249. if res.Body != nil {
  13250. res.Body.Close()
  13251. }
  13252. return nil, &googleapi.Error{
  13253. Code: res.StatusCode,
  13254. Header: res.Header,
  13255. }
  13256. }
  13257. if err != nil {
  13258. return nil, err
  13259. }
  13260. defer googleapi.CloseBody(res)
  13261. if err := googleapi.CheckResponse(res); err != nil {
  13262. return nil, err
  13263. }
  13264. ret := &Account{
  13265. ServerResponse: googleapi.ServerResponse{
  13266. Header: res.Header,
  13267. HTTPStatusCode: res.StatusCode,
  13268. },
  13269. }
  13270. target := &ret
  13271. if err := gensupport.DecodeResponse(target, res); err != nil {
  13272. return nil, err
  13273. }
  13274. return ret, nil
  13275. // {
  13276. // "description": "Gets one account by ID.",
  13277. // "httpMethod": "GET",
  13278. // "id": "dfareporting.accounts.get",
  13279. // "parameterOrder": [
  13280. // "profileId",
  13281. // "id"
  13282. // ],
  13283. // "parameters": {
  13284. // "id": {
  13285. // "description": "Account ID.",
  13286. // "format": "int64",
  13287. // "location": "path",
  13288. // "required": true,
  13289. // "type": "string"
  13290. // },
  13291. // "profileId": {
  13292. // "description": "User profile ID associated with this request.",
  13293. // "format": "int64",
  13294. // "location": "path",
  13295. // "required": true,
  13296. // "type": "string"
  13297. // }
  13298. // },
  13299. // "path": "userprofiles/{profileId}/accounts/{id}",
  13300. // "response": {
  13301. // "$ref": "Account"
  13302. // },
  13303. // "scopes": [
  13304. // "https://www.googleapis.com/auth/dfatrafficking"
  13305. // ]
  13306. // }
  13307. }
  13308. // method id "dfareporting.accounts.list":
  13309. type AccountsListCall struct {
  13310. s *Service
  13311. profileId int64
  13312. urlParams_ gensupport.URLParams
  13313. ifNoneMatch_ string
  13314. ctx_ context.Context
  13315. header_ http.Header
  13316. }
  13317. // List: Retrieves the list of accounts, possibly filtered. This method
  13318. // supports paging.
  13319. func (r *AccountsService) List(profileId int64) *AccountsListCall {
  13320. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13321. c.profileId = profileId
  13322. return c
  13323. }
  13324. // Active sets the optional parameter "active": Select only active
  13325. // accounts. Don't set this field to select both active and non-active
  13326. // accounts.
  13327. func (c *AccountsListCall) Active(active bool) *AccountsListCall {
  13328. c.urlParams_.Set("active", fmt.Sprint(active))
  13329. return c
  13330. }
  13331. // Ids sets the optional parameter "ids": Select only accounts with
  13332. // these IDs.
  13333. func (c *AccountsListCall) Ids(ids ...int64) *AccountsListCall {
  13334. var ids_ []string
  13335. for _, v := range ids {
  13336. ids_ = append(ids_, fmt.Sprint(v))
  13337. }
  13338. c.urlParams_.SetMulti("ids", ids_)
  13339. return c
  13340. }
  13341. // MaxResults sets the optional parameter "maxResults": Maximum number
  13342. // of results to return.
  13343. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  13344. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13345. return c
  13346. }
  13347. // PageToken sets the optional parameter "pageToken": Value of the
  13348. // nextPageToken from the previous result page.
  13349. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  13350. c.urlParams_.Set("pageToken", pageToken)
  13351. return c
  13352. }
  13353. // SearchString sets the optional parameter "searchString": Allows
  13354. // searching for objects by name or ID. Wildcards (*) are allowed. For
  13355. // example, "account*2015" will return objects with names like "account
  13356. // June 2015", "account April 2015", or simply "account 2015". Most of
  13357. // the searches also add wildcards implicitly at the start and the end
  13358. // of the search string. For example, a search string of "account" will
  13359. // match objects with name "my account", "account 2015", or simply
  13360. // "account".
  13361. func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall {
  13362. c.urlParams_.Set("searchString", searchString)
  13363. return c
  13364. }
  13365. // SortField sets the optional parameter "sortField": Field by which to
  13366. // sort the list.
  13367. //
  13368. // Possible values:
  13369. // "ID" (default)
  13370. // "NAME"
  13371. func (c *AccountsListCall) SortField(sortField string) *AccountsListCall {
  13372. c.urlParams_.Set("sortField", sortField)
  13373. return c
  13374. }
  13375. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  13376. // results.
  13377. //
  13378. // Possible values:
  13379. // "ASCENDING" (default)
  13380. // "DESCENDING"
  13381. func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall {
  13382. c.urlParams_.Set("sortOrder", sortOrder)
  13383. return c
  13384. }
  13385. // Fields allows partial responses to be retrieved. See
  13386. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13387. // for more information.
  13388. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  13389. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13390. return c
  13391. }
  13392. // IfNoneMatch sets the optional parameter which makes the operation
  13393. // fail if the object's ETag matches the given value. This is useful for
  13394. // getting updates only after the object has changed since the last
  13395. // request. Use googleapi.IsNotModified to check whether the response
  13396. // error from Do is the result of In-None-Match.
  13397. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  13398. c.ifNoneMatch_ = entityTag
  13399. return c
  13400. }
  13401. // Context sets the context to be used in this call's Do method. Any
  13402. // pending HTTP request will be aborted if the provided context is
  13403. // canceled.
  13404. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  13405. c.ctx_ = ctx
  13406. return c
  13407. }
  13408. // Header returns an http.Header that can be modified by the caller to
  13409. // add HTTP headers to the request.
  13410. func (c *AccountsListCall) Header() http.Header {
  13411. if c.header_ == nil {
  13412. c.header_ = make(http.Header)
  13413. }
  13414. return c.header_
  13415. }
  13416. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  13417. reqHeaders := make(http.Header)
  13418. for k, v := range c.header_ {
  13419. reqHeaders[k] = v
  13420. }
  13421. reqHeaders.Set("User-Agent", c.s.userAgent())
  13422. if c.ifNoneMatch_ != "" {
  13423. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13424. }
  13425. var body io.Reader = nil
  13426. c.urlParams_.Set("alt", alt)
  13427. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13428. urls += "?" + c.urlParams_.Encode()
  13429. req, _ := http.NewRequest("GET", urls, body)
  13430. req.Header = reqHeaders
  13431. googleapi.Expand(req.URL, map[string]string{
  13432. "profileId": strconv.FormatInt(c.profileId, 10),
  13433. })
  13434. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13435. }
  13436. // Do executes the "dfareporting.accounts.list" call.
  13437. // Exactly one of *AccountsListResponse or error will be non-nil. Any
  13438. // non-2xx status code is an error. Response headers are in either
  13439. // *AccountsListResponse.ServerResponse.Header or (if a response was
  13440. // returned at all) in error.(*googleapi.Error).Header. Use
  13441. // googleapi.IsNotModified to check whether the returned error was
  13442. // because http.StatusNotModified was returned.
  13443. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsListResponse, error) {
  13444. gensupport.SetOptions(c.urlParams_, opts...)
  13445. res, err := c.doRequest("json")
  13446. if res != nil && res.StatusCode == http.StatusNotModified {
  13447. if res.Body != nil {
  13448. res.Body.Close()
  13449. }
  13450. return nil, &googleapi.Error{
  13451. Code: res.StatusCode,
  13452. Header: res.Header,
  13453. }
  13454. }
  13455. if err != nil {
  13456. return nil, err
  13457. }
  13458. defer googleapi.CloseBody(res)
  13459. if err := googleapi.CheckResponse(res); err != nil {
  13460. return nil, err
  13461. }
  13462. ret := &AccountsListResponse{
  13463. ServerResponse: googleapi.ServerResponse{
  13464. Header: res.Header,
  13465. HTTPStatusCode: res.StatusCode,
  13466. },
  13467. }
  13468. target := &ret
  13469. if err := gensupport.DecodeResponse(target, res); err != nil {
  13470. return nil, err
  13471. }
  13472. return ret, nil
  13473. // {
  13474. // "description": "Retrieves the list of accounts, possibly filtered. This method supports paging.",
  13475. // "httpMethod": "GET",
  13476. // "id": "dfareporting.accounts.list",
  13477. // "parameterOrder": [
  13478. // "profileId"
  13479. // ],
  13480. // "parameters": {
  13481. // "active": {
  13482. // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.",
  13483. // "location": "query",
  13484. // "type": "boolean"
  13485. // },
  13486. // "ids": {
  13487. // "description": "Select only accounts with these IDs.",
  13488. // "format": "int64",
  13489. // "location": "query",
  13490. // "repeated": true,
  13491. // "type": "string"
  13492. // },
  13493. // "maxResults": {
  13494. // "default": "1000",
  13495. // "description": "Maximum number of results to return.",
  13496. // "format": "int32",
  13497. // "location": "query",
  13498. // "maximum": "1000",
  13499. // "minimum": "0",
  13500. // "type": "integer"
  13501. // },
  13502. // "pageToken": {
  13503. // "description": "Value of the nextPageToken from the previous result page.",
  13504. // "location": "query",
  13505. // "type": "string"
  13506. // },
  13507. // "profileId": {
  13508. // "description": "User profile ID associated with this request.",
  13509. // "format": "int64",
  13510. // "location": "path",
  13511. // "required": true,
  13512. // "type": "string"
  13513. // },
  13514. // "searchString": {
  13515. // "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\".",
  13516. // "location": "query",
  13517. // "type": "string"
  13518. // },
  13519. // "sortField": {
  13520. // "default": "ID",
  13521. // "description": "Field by which to sort the list.",
  13522. // "enum": [
  13523. // "ID",
  13524. // "NAME"
  13525. // ],
  13526. // "enumDescriptions": [
  13527. // "",
  13528. // ""
  13529. // ],
  13530. // "location": "query",
  13531. // "type": "string"
  13532. // },
  13533. // "sortOrder": {
  13534. // "default": "ASCENDING",
  13535. // "description": "Order of sorted results.",
  13536. // "enum": [
  13537. // "ASCENDING",
  13538. // "DESCENDING"
  13539. // ],
  13540. // "enumDescriptions": [
  13541. // "",
  13542. // ""
  13543. // ],
  13544. // "location": "query",
  13545. // "type": "string"
  13546. // }
  13547. // },
  13548. // "path": "userprofiles/{profileId}/accounts",
  13549. // "response": {
  13550. // "$ref": "AccountsListResponse"
  13551. // },
  13552. // "scopes": [
  13553. // "https://www.googleapis.com/auth/dfatrafficking"
  13554. // ]
  13555. // }
  13556. }
  13557. // Pages invokes f for each page of results.
  13558. // A non-nil error returned from f will halt the iteration.
  13559. // The provided context supersedes any context provided to the Context method.
  13560. func (c *AccountsListCall) Pages(ctx context.Context, f func(*AccountsListResponse) error) error {
  13561. c.ctx_ = ctx
  13562. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13563. for {
  13564. x, err := c.Do()
  13565. if err != nil {
  13566. return err
  13567. }
  13568. if err := f(x); err != nil {
  13569. return err
  13570. }
  13571. if x.NextPageToken == "" {
  13572. return nil
  13573. }
  13574. c.PageToken(x.NextPageToken)
  13575. }
  13576. }
  13577. // method id "dfareporting.accounts.patch":
  13578. type AccountsPatchCall struct {
  13579. s *Service
  13580. profileId int64
  13581. account *Account
  13582. urlParams_ gensupport.URLParams
  13583. ctx_ context.Context
  13584. header_ http.Header
  13585. }
  13586. // Patch: Updates an existing account. This method supports patch
  13587. // semantics.
  13588. func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall {
  13589. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13590. c.profileId = profileId
  13591. c.urlParams_.Set("id", fmt.Sprint(id))
  13592. c.account = account
  13593. return c
  13594. }
  13595. // Fields allows partial responses to be retrieved. See
  13596. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13597. // for more information.
  13598. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  13599. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13600. return c
  13601. }
  13602. // Context sets the context to be used in this call's Do method. Any
  13603. // pending HTTP request will be aborted if the provided context is
  13604. // canceled.
  13605. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  13606. c.ctx_ = ctx
  13607. return c
  13608. }
  13609. // Header returns an http.Header that can be modified by the caller to
  13610. // add HTTP headers to the request.
  13611. func (c *AccountsPatchCall) Header() http.Header {
  13612. if c.header_ == nil {
  13613. c.header_ = make(http.Header)
  13614. }
  13615. return c.header_
  13616. }
  13617. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  13618. reqHeaders := make(http.Header)
  13619. for k, v := range c.header_ {
  13620. reqHeaders[k] = v
  13621. }
  13622. reqHeaders.Set("User-Agent", c.s.userAgent())
  13623. var body io.Reader = nil
  13624. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13625. if err != nil {
  13626. return nil, err
  13627. }
  13628. reqHeaders.Set("Content-Type", "application/json")
  13629. c.urlParams_.Set("alt", alt)
  13630. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13631. urls += "?" + c.urlParams_.Encode()
  13632. req, _ := http.NewRequest("PATCH", urls, body)
  13633. req.Header = reqHeaders
  13634. googleapi.Expand(req.URL, map[string]string{
  13635. "profileId": strconv.FormatInt(c.profileId, 10),
  13636. })
  13637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13638. }
  13639. // Do executes the "dfareporting.accounts.patch" call.
  13640. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13641. // code is an error. Response headers are in either
  13642. // *Account.ServerResponse.Header or (if a response was returned at all)
  13643. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13644. // check whether the returned error was because http.StatusNotModified
  13645. // was returned.
  13646. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13647. gensupport.SetOptions(c.urlParams_, opts...)
  13648. res, err := c.doRequest("json")
  13649. if res != nil && res.StatusCode == http.StatusNotModified {
  13650. if res.Body != nil {
  13651. res.Body.Close()
  13652. }
  13653. return nil, &googleapi.Error{
  13654. Code: res.StatusCode,
  13655. Header: res.Header,
  13656. }
  13657. }
  13658. if err != nil {
  13659. return nil, err
  13660. }
  13661. defer googleapi.CloseBody(res)
  13662. if err := googleapi.CheckResponse(res); err != nil {
  13663. return nil, err
  13664. }
  13665. ret := &Account{
  13666. ServerResponse: googleapi.ServerResponse{
  13667. Header: res.Header,
  13668. HTTPStatusCode: res.StatusCode,
  13669. },
  13670. }
  13671. target := &ret
  13672. if err := gensupport.DecodeResponse(target, res); err != nil {
  13673. return nil, err
  13674. }
  13675. return ret, nil
  13676. // {
  13677. // "description": "Updates an existing account. This method supports patch semantics.",
  13678. // "httpMethod": "PATCH",
  13679. // "id": "dfareporting.accounts.patch",
  13680. // "parameterOrder": [
  13681. // "profileId",
  13682. // "id"
  13683. // ],
  13684. // "parameters": {
  13685. // "id": {
  13686. // "description": "Account ID.",
  13687. // "format": "int64",
  13688. // "location": "query",
  13689. // "required": true,
  13690. // "type": "string"
  13691. // },
  13692. // "profileId": {
  13693. // "description": "User profile ID associated with this request.",
  13694. // "format": "int64",
  13695. // "location": "path",
  13696. // "required": true,
  13697. // "type": "string"
  13698. // }
  13699. // },
  13700. // "path": "userprofiles/{profileId}/accounts",
  13701. // "request": {
  13702. // "$ref": "Account"
  13703. // },
  13704. // "response": {
  13705. // "$ref": "Account"
  13706. // },
  13707. // "scopes": [
  13708. // "https://www.googleapis.com/auth/dfatrafficking"
  13709. // ]
  13710. // }
  13711. }
  13712. // method id "dfareporting.accounts.update":
  13713. type AccountsUpdateCall struct {
  13714. s *Service
  13715. profileId int64
  13716. account *Account
  13717. urlParams_ gensupport.URLParams
  13718. ctx_ context.Context
  13719. header_ http.Header
  13720. }
  13721. // Update: Updates an existing account.
  13722. func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall {
  13723. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13724. c.profileId = profileId
  13725. c.account = account
  13726. return c
  13727. }
  13728. // Fields allows partial responses to be retrieved. See
  13729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13730. // for more information.
  13731. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  13732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13733. return c
  13734. }
  13735. // Context sets the context to be used in this call's Do method. Any
  13736. // pending HTTP request will be aborted if the provided context is
  13737. // canceled.
  13738. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  13739. c.ctx_ = ctx
  13740. return c
  13741. }
  13742. // Header returns an http.Header that can be modified by the caller to
  13743. // add HTTP headers to the request.
  13744. func (c *AccountsUpdateCall) Header() http.Header {
  13745. if c.header_ == nil {
  13746. c.header_ = make(http.Header)
  13747. }
  13748. return c.header_
  13749. }
  13750. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  13751. reqHeaders := make(http.Header)
  13752. for k, v := range c.header_ {
  13753. reqHeaders[k] = v
  13754. }
  13755. reqHeaders.Set("User-Agent", c.s.userAgent())
  13756. var body io.Reader = nil
  13757. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13758. if err != nil {
  13759. return nil, err
  13760. }
  13761. reqHeaders.Set("Content-Type", "application/json")
  13762. c.urlParams_.Set("alt", alt)
  13763. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13764. urls += "?" + c.urlParams_.Encode()
  13765. req, _ := http.NewRequest("PUT", urls, body)
  13766. req.Header = reqHeaders
  13767. googleapi.Expand(req.URL, map[string]string{
  13768. "profileId": strconv.FormatInt(c.profileId, 10),
  13769. })
  13770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13771. }
  13772. // Do executes the "dfareporting.accounts.update" call.
  13773. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13774. // code is an error. Response headers are in either
  13775. // *Account.ServerResponse.Header or (if a response was returned at all)
  13776. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13777. // check whether the returned error was because http.StatusNotModified
  13778. // was returned.
  13779. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13780. gensupport.SetOptions(c.urlParams_, opts...)
  13781. res, err := c.doRequest("json")
  13782. if res != nil && res.StatusCode == http.StatusNotModified {
  13783. if res.Body != nil {
  13784. res.Body.Close()
  13785. }
  13786. return nil, &googleapi.Error{
  13787. Code: res.StatusCode,
  13788. Header: res.Header,
  13789. }
  13790. }
  13791. if err != nil {
  13792. return nil, err
  13793. }
  13794. defer googleapi.CloseBody(res)
  13795. if err := googleapi.CheckResponse(res); err != nil {
  13796. return nil, err
  13797. }
  13798. ret := &Account{
  13799. ServerResponse: googleapi.ServerResponse{
  13800. Header: res.Header,
  13801. HTTPStatusCode: res.StatusCode,
  13802. },
  13803. }
  13804. target := &ret
  13805. if err := gensupport.DecodeResponse(target, res); err != nil {
  13806. return nil, err
  13807. }
  13808. return ret, nil
  13809. // {
  13810. // "description": "Updates an existing account.",
  13811. // "httpMethod": "PUT",
  13812. // "id": "dfareporting.accounts.update",
  13813. // "parameterOrder": [
  13814. // "profileId"
  13815. // ],
  13816. // "parameters": {
  13817. // "profileId": {
  13818. // "description": "User profile ID associated with this request.",
  13819. // "format": "int64",
  13820. // "location": "path",
  13821. // "required": true,
  13822. // "type": "string"
  13823. // }
  13824. // },
  13825. // "path": "userprofiles/{profileId}/accounts",
  13826. // "request": {
  13827. // "$ref": "Account"
  13828. // },
  13829. // "response": {
  13830. // "$ref": "Account"
  13831. // },
  13832. // "scopes": [
  13833. // "https://www.googleapis.com/auth/dfatrafficking"
  13834. // ]
  13835. // }
  13836. }
  13837. // method id "dfareporting.ads.get":
  13838. type AdsGetCall struct {
  13839. s *Service
  13840. profileId int64
  13841. id int64
  13842. urlParams_ gensupport.URLParams
  13843. ifNoneMatch_ string
  13844. ctx_ context.Context
  13845. header_ http.Header
  13846. }
  13847. // Get: Gets one ad by ID.
  13848. func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall {
  13849. c := &AdsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13850. c.profileId = profileId
  13851. c.id = id
  13852. return c
  13853. }
  13854. // Fields allows partial responses to be retrieved. See
  13855. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13856. // for more information.
  13857. func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall {
  13858. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13859. return c
  13860. }
  13861. // IfNoneMatch sets the optional parameter which makes the operation
  13862. // fail if the object's ETag matches the given value. This is useful for
  13863. // getting updates only after the object has changed since the last
  13864. // request. Use googleapi.IsNotModified to check whether the response
  13865. // error from Do is the result of In-None-Match.
  13866. func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall {
  13867. c.ifNoneMatch_ = entityTag
  13868. return c
  13869. }
  13870. // Context sets the context to be used in this call's Do method. Any
  13871. // pending HTTP request will be aborted if the provided context is
  13872. // canceled.
  13873. func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall {
  13874. c.ctx_ = ctx
  13875. return c
  13876. }
  13877. // Header returns an http.Header that can be modified by the caller to
  13878. // add HTTP headers to the request.
  13879. func (c *AdsGetCall) Header() http.Header {
  13880. if c.header_ == nil {
  13881. c.header_ = make(http.Header)
  13882. }
  13883. return c.header_
  13884. }
  13885. func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) {
  13886. reqHeaders := make(http.Header)
  13887. for k, v := range c.header_ {
  13888. reqHeaders[k] = v
  13889. }
  13890. reqHeaders.Set("User-Agent", c.s.userAgent())
  13891. if c.ifNoneMatch_ != "" {
  13892. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13893. }
  13894. var body io.Reader = nil
  13895. c.urlParams_.Set("alt", alt)
  13896. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}")
  13897. urls += "?" + c.urlParams_.Encode()
  13898. req, _ := http.NewRequest("GET", urls, body)
  13899. req.Header = reqHeaders
  13900. googleapi.Expand(req.URL, map[string]string{
  13901. "profileId": strconv.FormatInt(c.profileId, 10),
  13902. "id": strconv.FormatInt(c.id, 10),
  13903. })
  13904. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13905. }
  13906. // Do executes the "dfareporting.ads.get" call.
  13907. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  13908. // is an error. Response headers are in either *Ad.ServerResponse.Header
  13909. // or (if a response was returned at all) in
  13910. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13911. // whether the returned error was because http.StatusNotModified was
  13912. // returned.
  13913. func (c *AdsGetCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  13914. gensupport.SetOptions(c.urlParams_, opts...)
  13915. res, err := c.doRequest("json")
  13916. if res != nil && res.StatusCode == http.StatusNotModified {
  13917. if res.Body != nil {
  13918. res.Body.Close()
  13919. }
  13920. return nil, &googleapi.Error{
  13921. Code: res.StatusCode,
  13922. Header: res.Header,
  13923. }
  13924. }
  13925. if err != nil {
  13926. return nil, err
  13927. }
  13928. defer googleapi.CloseBody(res)
  13929. if err := googleapi.CheckResponse(res); err != nil {
  13930. return nil, err
  13931. }
  13932. ret := &Ad{
  13933. ServerResponse: googleapi.ServerResponse{
  13934. Header: res.Header,
  13935. HTTPStatusCode: res.StatusCode,
  13936. },
  13937. }
  13938. target := &ret
  13939. if err := gensupport.DecodeResponse(target, res); err != nil {
  13940. return nil, err
  13941. }
  13942. return ret, nil
  13943. // {
  13944. // "description": "Gets one ad by ID.",
  13945. // "httpMethod": "GET",
  13946. // "id": "dfareporting.ads.get",
  13947. // "parameterOrder": [
  13948. // "profileId",
  13949. // "id"
  13950. // ],
  13951. // "parameters": {
  13952. // "id": {
  13953. // "description": "Ad ID.",
  13954. // "format": "int64",
  13955. // "location": "path",
  13956. // "required": true,
  13957. // "type": "string"
  13958. // },
  13959. // "profileId": {
  13960. // "description": "User profile ID associated with this request.",
  13961. // "format": "int64",
  13962. // "location": "path",
  13963. // "required": true,
  13964. // "type": "string"
  13965. // }
  13966. // },
  13967. // "path": "userprofiles/{profileId}/ads/{id}",
  13968. // "response": {
  13969. // "$ref": "Ad"
  13970. // },
  13971. // "scopes": [
  13972. // "https://www.googleapis.com/auth/dfatrafficking"
  13973. // ]
  13974. // }
  13975. }
  13976. // method id "dfareporting.ads.insert":
  13977. type AdsInsertCall struct {
  13978. s *Service
  13979. profileId int64
  13980. ad *Ad
  13981. urlParams_ gensupport.URLParams
  13982. ctx_ context.Context
  13983. header_ http.Header
  13984. }
  13985. // Insert: Inserts a new ad.
  13986. func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall {
  13987. c := &AdsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13988. c.profileId = profileId
  13989. c.ad = ad
  13990. return c
  13991. }
  13992. // Fields allows partial responses to be retrieved. See
  13993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13994. // for more information.
  13995. func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall {
  13996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13997. return c
  13998. }
  13999. // Context sets the context to be used in this call's Do method. Any
  14000. // pending HTTP request will be aborted if the provided context is
  14001. // canceled.
  14002. func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall {
  14003. c.ctx_ = ctx
  14004. return c
  14005. }
  14006. // Header returns an http.Header that can be modified by the caller to
  14007. // add HTTP headers to the request.
  14008. func (c *AdsInsertCall) Header() http.Header {
  14009. if c.header_ == nil {
  14010. c.header_ = make(http.Header)
  14011. }
  14012. return c.header_
  14013. }
  14014. func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) {
  14015. reqHeaders := make(http.Header)
  14016. for k, v := range c.header_ {
  14017. reqHeaders[k] = v
  14018. }
  14019. reqHeaders.Set("User-Agent", c.s.userAgent())
  14020. var body io.Reader = nil
  14021. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14022. if err != nil {
  14023. return nil, err
  14024. }
  14025. reqHeaders.Set("Content-Type", "application/json")
  14026. c.urlParams_.Set("alt", alt)
  14027. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14028. urls += "?" + c.urlParams_.Encode()
  14029. req, _ := http.NewRequest("POST", urls, body)
  14030. req.Header = reqHeaders
  14031. googleapi.Expand(req.URL, map[string]string{
  14032. "profileId": strconv.FormatInt(c.profileId, 10),
  14033. })
  14034. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14035. }
  14036. // Do executes the "dfareporting.ads.insert" call.
  14037. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14038. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14039. // or (if a response was returned at all) in
  14040. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14041. // whether the returned error was because http.StatusNotModified was
  14042. // returned.
  14043. func (c *AdsInsertCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14044. gensupport.SetOptions(c.urlParams_, opts...)
  14045. res, err := c.doRequest("json")
  14046. if res != nil && res.StatusCode == http.StatusNotModified {
  14047. if res.Body != nil {
  14048. res.Body.Close()
  14049. }
  14050. return nil, &googleapi.Error{
  14051. Code: res.StatusCode,
  14052. Header: res.Header,
  14053. }
  14054. }
  14055. if err != nil {
  14056. return nil, err
  14057. }
  14058. defer googleapi.CloseBody(res)
  14059. if err := googleapi.CheckResponse(res); err != nil {
  14060. return nil, err
  14061. }
  14062. ret := &Ad{
  14063. ServerResponse: googleapi.ServerResponse{
  14064. Header: res.Header,
  14065. HTTPStatusCode: res.StatusCode,
  14066. },
  14067. }
  14068. target := &ret
  14069. if err := gensupport.DecodeResponse(target, res); err != nil {
  14070. return nil, err
  14071. }
  14072. return ret, nil
  14073. // {
  14074. // "description": "Inserts a new ad.",
  14075. // "httpMethod": "POST",
  14076. // "id": "dfareporting.ads.insert",
  14077. // "parameterOrder": [
  14078. // "profileId"
  14079. // ],
  14080. // "parameters": {
  14081. // "profileId": {
  14082. // "description": "User profile ID associated with this request.",
  14083. // "format": "int64",
  14084. // "location": "path",
  14085. // "required": true,
  14086. // "type": "string"
  14087. // }
  14088. // },
  14089. // "path": "userprofiles/{profileId}/ads",
  14090. // "request": {
  14091. // "$ref": "Ad"
  14092. // },
  14093. // "response": {
  14094. // "$ref": "Ad"
  14095. // },
  14096. // "scopes": [
  14097. // "https://www.googleapis.com/auth/dfatrafficking"
  14098. // ]
  14099. // }
  14100. }
  14101. // method id "dfareporting.ads.list":
  14102. type AdsListCall struct {
  14103. s *Service
  14104. profileId int64
  14105. urlParams_ gensupport.URLParams
  14106. ifNoneMatch_ string
  14107. ctx_ context.Context
  14108. header_ http.Header
  14109. }
  14110. // List: Retrieves a list of ads, possibly filtered. This method
  14111. // supports paging.
  14112. func (r *AdsService) List(profileId int64) *AdsListCall {
  14113. c := &AdsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14114. c.profileId = profileId
  14115. return c
  14116. }
  14117. // Active sets the optional parameter "active": Select only active ads.
  14118. func (c *AdsListCall) Active(active bool) *AdsListCall {
  14119. c.urlParams_.Set("active", fmt.Sprint(active))
  14120. return c
  14121. }
  14122. // AdvertiserId sets the optional parameter "advertiserId": Select only
  14123. // ads with this advertiser ID.
  14124. func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall {
  14125. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  14126. return c
  14127. }
  14128. // Archived sets the optional parameter "archived": Select only archived
  14129. // ads.
  14130. func (c *AdsListCall) Archived(archived bool) *AdsListCall {
  14131. c.urlParams_.Set("archived", fmt.Sprint(archived))
  14132. return c
  14133. }
  14134. // AudienceSegmentIds sets the optional parameter "audienceSegmentIds":
  14135. // Select only ads with these audience segment IDs.
  14136. func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds ...int64) *AdsListCall {
  14137. var audienceSegmentIds_ []string
  14138. for _, v := range audienceSegmentIds {
  14139. audienceSegmentIds_ = append(audienceSegmentIds_, fmt.Sprint(v))
  14140. }
  14141. c.urlParams_.SetMulti("audienceSegmentIds", audienceSegmentIds_)
  14142. return c
  14143. }
  14144. // CampaignIds sets the optional parameter "campaignIds": Select only
  14145. // ads with these campaign IDs.
  14146. func (c *AdsListCall) CampaignIds(campaignIds ...int64) *AdsListCall {
  14147. var campaignIds_ []string
  14148. for _, v := range campaignIds {
  14149. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  14150. }
  14151. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  14152. return c
  14153. }
  14154. // Compatibility sets the optional parameter "compatibility": Select
  14155. // default ads with the specified compatibility. Applicable when type is
  14156. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  14157. // rendering either on desktop or on mobile devices for regular or
  14158. // interstitial ads, respectively. APP and APP_INTERSTITIAL are for
  14159. // rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an
  14160. // in-stream video ads developed with the VAST standard.
  14161. //
  14162. // Possible values:
  14163. // "APP"
  14164. // "APP_INTERSTITIAL"
  14165. // "DISPLAY"
  14166. // "DISPLAY_INTERSTITIAL"
  14167. // "IN_STREAM_AUDIO"
  14168. // "IN_STREAM_VIDEO"
  14169. func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall {
  14170. c.urlParams_.Set("compatibility", compatibility)
  14171. return c
  14172. }
  14173. // CreativeIds sets the optional parameter "creativeIds": Select only
  14174. // ads with these creative IDs assigned.
  14175. func (c *AdsListCall) CreativeIds(creativeIds ...int64) *AdsListCall {
  14176. var creativeIds_ []string
  14177. for _, v := range creativeIds {
  14178. creativeIds_ = append(creativeIds_, fmt.Sprint(v))
  14179. }
  14180. c.urlParams_.SetMulti("creativeIds", creativeIds_)
  14181. return c
  14182. }
  14183. // CreativeOptimizationConfigurationIds sets the optional parameter
  14184. // "creativeOptimizationConfigurationIds": Select only ads with these
  14185. // creative optimization configuration IDs.
  14186. func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds ...int64) *AdsListCall {
  14187. var creativeOptimizationConfigurationIds_ []string
  14188. for _, v := range creativeOptimizationConfigurationIds {
  14189. creativeOptimizationConfigurationIds_ = append(creativeOptimizationConfigurationIds_, fmt.Sprint(v))
  14190. }
  14191. c.urlParams_.SetMulti("creativeOptimizationConfigurationIds", creativeOptimizationConfigurationIds_)
  14192. return c
  14193. }
  14194. // DynamicClickTracker sets the optional parameter
  14195. // "dynamicClickTracker": Select only dynamic click trackers. Applicable
  14196. // when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click
  14197. // trackers. If false, select static click trackers. Leave unset to
  14198. // select both.
  14199. func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall {
  14200. c.urlParams_.Set("dynamicClickTracker", fmt.Sprint(dynamicClickTracker))
  14201. return c
  14202. }
  14203. // Ids sets the optional parameter "ids": Select only ads with these
  14204. // IDs.
  14205. func (c *AdsListCall) Ids(ids ...int64) *AdsListCall {
  14206. var ids_ []string
  14207. for _, v := range ids {
  14208. ids_ = append(ids_, fmt.Sprint(v))
  14209. }
  14210. c.urlParams_.SetMulti("ids", ids_)
  14211. return c
  14212. }
  14213. // LandingPageIds sets the optional parameter "landingPageIds": Select
  14214. // only ads with these landing page IDs.
  14215. func (c *AdsListCall) LandingPageIds(landingPageIds ...int64) *AdsListCall {
  14216. var landingPageIds_ []string
  14217. for _, v := range landingPageIds {
  14218. landingPageIds_ = append(landingPageIds_, fmt.Sprint(v))
  14219. }
  14220. c.urlParams_.SetMulti("landingPageIds", landingPageIds_)
  14221. return c
  14222. }
  14223. // MaxResults sets the optional parameter "maxResults": Maximum number
  14224. // of results to return.
  14225. func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall {
  14226. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14227. return c
  14228. }
  14229. // OverriddenEventTagId sets the optional parameter
  14230. // "overriddenEventTagId": Select only ads with this event tag override
  14231. // ID.
  14232. func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall {
  14233. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  14234. return c
  14235. }
  14236. // PageToken sets the optional parameter "pageToken": Value of the
  14237. // nextPageToken from the previous result page.
  14238. func (c *AdsListCall) PageToken(pageToken string) *AdsListCall {
  14239. c.urlParams_.Set("pageToken", pageToken)
  14240. return c
  14241. }
  14242. // PlacementIds sets the optional parameter "placementIds": Select only
  14243. // ads with these placement IDs assigned.
  14244. func (c *AdsListCall) PlacementIds(placementIds ...int64) *AdsListCall {
  14245. var placementIds_ []string
  14246. for _, v := range placementIds {
  14247. placementIds_ = append(placementIds_, fmt.Sprint(v))
  14248. }
  14249. c.urlParams_.SetMulti("placementIds", placementIds_)
  14250. return c
  14251. }
  14252. // RemarketingListIds sets the optional parameter "remarketingListIds":
  14253. // Select only ads whose list targeting expression use these remarketing
  14254. // list IDs.
  14255. func (c *AdsListCall) RemarketingListIds(remarketingListIds ...int64) *AdsListCall {
  14256. var remarketingListIds_ []string
  14257. for _, v := range remarketingListIds {
  14258. remarketingListIds_ = append(remarketingListIds_, fmt.Sprint(v))
  14259. }
  14260. c.urlParams_.SetMulti("remarketingListIds", remarketingListIds_)
  14261. return c
  14262. }
  14263. // SearchString sets the optional parameter "searchString": Allows
  14264. // searching for objects by name or ID. Wildcards (*) are allowed. For
  14265. // example, "ad*2015" will return objects with names like "ad June
  14266. // 2015", "ad April 2015", or simply "ad 2015". Most of the searches
  14267. // also add wildcards implicitly at the start and the end of the search
  14268. // string. For example, a search string of "ad" will match objects with
  14269. // name "my ad", "ad 2015", or simply "ad".
  14270. func (c *AdsListCall) SearchString(searchString string) *AdsListCall {
  14271. c.urlParams_.Set("searchString", searchString)
  14272. return c
  14273. }
  14274. // SizeIds sets the optional parameter "sizeIds": Select only ads with
  14275. // these size IDs.
  14276. func (c *AdsListCall) SizeIds(sizeIds ...int64) *AdsListCall {
  14277. var sizeIds_ []string
  14278. for _, v := range sizeIds {
  14279. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  14280. }
  14281. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  14282. return c
  14283. }
  14284. // SortField sets the optional parameter "sortField": Field by which to
  14285. // sort the list.
  14286. //
  14287. // Possible values:
  14288. // "ID" (default)
  14289. // "NAME"
  14290. func (c *AdsListCall) SortField(sortField string) *AdsListCall {
  14291. c.urlParams_.Set("sortField", sortField)
  14292. return c
  14293. }
  14294. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  14295. // results.
  14296. //
  14297. // Possible values:
  14298. // "ASCENDING" (default)
  14299. // "DESCENDING"
  14300. func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall {
  14301. c.urlParams_.Set("sortOrder", sortOrder)
  14302. return c
  14303. }
  14304. // SslCompliant sets the optional parameter "sslCompliant": Select only
  14305. // ads that are SSL-compliant.
  14306. func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall {
  14307. c.urlParams_.Set("sslCompliant", fmt.Sprint(sslCompliant))
  14308. return c
  14309. }
  14310. // SslRequired sets the optional parameter "sslRequired": Select only
  14311. // ads that require SSL.
  14312. func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall {
  14313. c.urlParams_.Set("sslRequired", fmt.Sprint(sslRequired))
  14314. return c
  14315. }
  14316. // Type sets the optional parameter "type": Select only ads with these
  14317. // types.
  14318. //
  14319. // Possible values:
  14320. // "AD_SERVING_CLICK_TRACKER"
  14321. // "AD_SERVING_DEFAULT_AD"
  14322. // "AD_SERVING_STANDARD_AD"
  14323. // "AD_SERVING_TRACKING"
  14324. func (c *AdsListCall) Type(type_ ...string) *AdsListCall {
  14325. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  14326. return c
  14327. }
  14328. // Fields allows partial responses to be retrieved. See
  14329. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14330. // for more information.
  14331. func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall {
  14332. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14333. return c
  14334. }
  14335. // IfNoneMatch sets the optional parameter which makes the operation
  14336. // fail if the object's ETag matches the given value. This is useful for
  14337. // getting updates only after the object has changed since the last
  14338. // request. Use googleapi.IsNotModified to check whether the response
  14339. // error from Do is the result of In-None-Match.
  14340. func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall {
  14341. c.ifNoneMatch_ = entityTag
  14342. return c
  14343. }
  14344. // Context sets the context to be used in this call's Do method. Any
  14345. // pending HTTP request will be aborted if the provided context is
  14346. // canceled.
  14347. func (c *AdsListCall) Context(ctx context.Context) *AdsListCall {
  14348. c.ctx_ = ctx
  14349. return c
  14350. }
  14351. // Header returns an http.Header that can be modified by the caller to
  14352. // add HTTP headers to the request.
  14353. func (c *AdsListCall) Header() http.Header {
  14354. if c.header_ == nil {
  14355. c.header_ = make(http.Header)
  14356. }
  14357. return c.header_
  14358. }
  14359. func (c *AdsListCall) doRequest(alt string) (*http.Response, error) {
  14360. reqHeaders := make(http.Header)
  14361. for k, v := range c.header_ {
  14362. reqHeaders[k] = v
  14363. }
  14364. reqHeaders.Set("User-Agent", c.s.userAgent())
  14365. if c.ifNoneMatch_ != "" {
  14366. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14367. }
  14368. var body io.Reader = nil
  14369. c.urlParams_.Set("alt", alt)
  14370. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14371. urls += "?" + c.urlParams_.Encode()
  14372. req, _ := http.NewRequest("GET", urls, body)
  14373. req.Header = reqHeaders
  14374. googleapi.Expand(req.URL, map[string]string{
  14375. "profileId": strconv.FormatInt(c.profileId, 10),
  14376. })
  14377. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14378. }
  14379. // Do executes the "dfareporting.ads.list" call.
  14380. // Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx
  14381. // status code is an error. Response headers are in either
  14382. // *AdsListResponse.ServerResponse.Header or (if a response was returned
  14383. // at all) in error.(*googleapi.Error).Header. Use
  14384. // googleapi.IsNotModified to check whether the returned error was
  14385. // because http.StatusNotModified was returned.
  14386. func (c *AdsListCall) Do(opts ...googleapi.CallOption) (*AdsListResponse, error) {
  14387. gensupport.SetOptions(c.urlParams_, opts...)
  14388. res, err := c.doRequest("json")
  14389. if res != nil && res.StatusCode == http.StatusNotModified {
  14390. if res.Body != nil {
  14391. res.Body.Close()
  14392. }
  14393. return nil, &googleapi.Error{
  14394. Code: res.StatusCode,
  14395. Header: res.Header,
  14396. }
  14397. }
  14398. if err != nil {
  14399. return nil, err
  14400. }
  14401. defer googleapi.CloseBody(res)
  14402. if err := googleapi.CheckResponse(res); err != nil {
  14403. return nil, err
  14404. }
  14405. ret := &AdsListResponse{
  14406. ServerResponse: googleapi.ServerResponse{
  14407. Header: res.Header,
  14408. HTTPStatusCode: res.StatusCode,
  14409. },
  14410. }
  14411. target := &ret
  14412. if err := gensupport.DecodeResponse(target, res); err != nil {
  14413. return nil, err
  14414. }
  14415. return ret, nil
  14416. // {
  14417. // "description": "Retrieves a list of ads, possibly filtered. This method supports paging.",
  14418. // "httpMethod": "GET",
  14419. // "id": "dfareporting.ads.list",
  14420. // "parameterOrder": [
  14421. // "profileId"
  14422. // ],
  14423. // "parameters": {
  14424. // "active": {
  14425. // "description": "Select only active ads.",
  14426. // "location": "query",
  14427. // "type": "boolean"
  14428. // },
  14429. // "advertiserId": {
  14430. // "description": "Select only ads with this advertiser ID.",
  14431. // "format": "int64",
  14432. // "location": "query",
  14433. // "type": "string"
  14434. // },
  14435. // "archived": {
  14436. // "description": "Select only archived ads.",
  14437. // "location": "query",
  14438. // "type": "boolean"
  14439. // },
  14440. // "audienceSegmentIds": {
  14441. // "description": "Select only ads with these audience segment IDs.",
  14442. // "format": "int64",
  14443. // "location": "query",
  14444. // "repeated": true,
  14445. // "type": "string"
  14446. // },
  14447. // "campaignIds": {
  14448. // "description": "Select only ads with these campaign IDs.",
  14449. // "format": "int64",
  14450. // "location": "query",
  14451. // "repeated": true,
  14452. // "type": "string"
  14453. // },
  14454. // "compatibility": {
  14455. // "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.",
  14456. // "enum": [
  14457. // "APP",
  14458. // "APP_INTERSTITIAL",
  14459. // "DISPLAY",
  14460. // "DISPLAY_INTERSTITIAL",
  14461. // "IN_STREAM_AUDIO",
  14462. // "IN_STREAM_VIDEO"
  14463. // ],
  14464. // "enumDescriptions": [
  14465. // "",
  14466. // "",
  14467. // "",
  14468. // "",
  14469. // "",
  14470. // ""
  14471. // ],
  14472. // "location": "query",
  14473. // "type": "string"
  14474. // },
  14475. // "creativeIds": {
  14476. // "description": "Select only ads with these creative IDs assigned.",
  14477. // "format": "int64",
  14478. // "location": "query",
  14479. // "repeated": true,
  14480. // "type": "string"
  14481. // },
  14482. // "creativeOptimizationConfigurationIds": {
  14483. // "description": "Select only ads with these creative optimization configuration IDs.",
  14484. // "format": "int64",
  14485. // "location": "query",
  14486. // "repeated": true,
  14487. // "type": "string"
  14488. // },
  14489. // "dynamicClickTracker": {
  14490. // "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.",
  14491. // "location": "query",
  14492. // "type": "boolean"
  14493. // },
  14494. // "ids": {
  14495. // "description": "Select only ads with these IDs.",
  14496. // "format": "int64",
  14497. // "location": "query",
  14498. // "repeated": true,
  14499. // "type": "string"
  14500. // },
  14501. // "landingPageIds": {
  14502. // "description": "Select only ads with these landing page IDs.",
  14503. // "format": "int64",
  14504. // "location": "query",
  14505. // "repeated": true,
  14506. // "type": "string"
  14507. // },
  14508. // "maxResults": {
  14509. // "default": "1000",
  14510. // "description": "Maximum number of results to return.",
  14511. // "format": "int32",
  14512. // "location": "query",
  14513. // "maximum": "1000",
  14514. // "minimum": "0",
  14515. // "type": "integer"
  14516. // },
  14517. // "overriddenEventTagId": {
  14518. // "description": "Select only ads with this event tag override ID.",
  14519. // "format": "int64",
  14520. // "location": "query",
  14521. // "type": "string"
  14522. // },
  14523. // "pageToken": {
  14524. // "description": "Value of the nextPageToken from the previous result page.",
  14525. // "location": "query",
  14526. // "type": "string"
  14527. // },
  14528. // "placementIds": {
  14529. // "description": "Select only ads with these placement IDs assigned.",
  14530. // "format": "int64",
  14531. // "location": "query",
  14532. // "repeated": true,
  14533. // "type": "string"
  14534. // },
  14535. // "profileId": {
  14536. // "description": "User profile ID associated with this request.",
  14537. // "format": "int64",
  14538. // "location": "path",
  14539. // "required": true,
  14540. // "type": "string"
  14541. // },
  14542. // "remarketingListIds": {
  14543. // "description": "Select only ads whose list targeting expression use these remarketing list IDs.",
  14544. // "format": "int64",
  14545. // "location": "query",
  14546. // "repeated": true,
  14547. // "type": "string"
  14548. // },
  14549. // "searchString": {
  14550. // "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\".",
  14551. // "location": "query",
  14552. // "type": "string"
  14553. // },
  14554. // "sizeIds": {
  14555. // "description": "Select only ads with these size IDs.",
  14556. // "format": "int64",
  14557. // "location": "query",
  14558. // "repeated": true,
  14559. // "type": "string"
  14560. // },
  14561. // "sortField": {
  14562. // "default": "ID",
  14563. // "description": "Field by which to sort the list.",
  14564. // "enum": [
  14565. // "ID",
  14566. // "NAME"
  14567. // ],
  14568. // "enumDescriptions": [
  14569. // "",
  14570. // ""
  14571. // ],
  14572. // "location": "query",
  14573. // "type": "string"
  14574. // },
  14575. // "sortOrder": {
  14576. // "default": "ASCENDING",
  14577. // "description": "Order of sorted results.",
  14578. // "enum": [
  14579. // "ASCENDING",
  14580. // "DESCENDING"
  14581. // ],
  14582. // "enumDescriptions": [
  14583. // "",
  14584. // ""
  14585. // ],
  14586. // "location": "query",
  14587. // "type": "string"
  14588. // },
  14589. // "sslCompliant": {
  14590. // "description": "Select only ads that are SSL-compliant.",
  14591. // "location": "query",
  14592. // "type": "boolean"
  14593. // },
  14594. // "sslRequired": {
  14595. // "description": "Select only ads that require SSL.",
  14596. // "location": "query",
  14597. // "type": "boolean"
  14598. // },
  14599. // "type": {
  14600. // "description": "Select only ads with these types.",
  14601. // "enum": [
  14602. // "AD_SERVING_CLICK_TRACKER",
  14603. // "AD_SERVING_DEFAULT_AD",
  14604. // "AD_SERVING_STANDARD_AD",
  14605. // "AD_SERVING_TRACKING"
  14606. // ],
  14607. // "enumDescriptions": [
  14608. // "",
  14609. // "",
  14610. // "",
  14611. // ""
  14612. // ],
  14613. // "location": "query",
  14614. // "repeated": true,
  14615. // "type": "string"
  14616. // }
  14617. // },
  14618. // "path": "userprofiles/{profileId}/ads",
  14619. // "response": {
  14620. // "$ref": "AdsListResponse"
  14621. // },
  14622. // "scopes": [
  14623. // "https://www.googleapis.com/auth/dfatrafficking"
  14624. // ]
  14625. // }
  14626. }
  14627. // Pages invokes f for each page of results.
  14628. // A non-nil error returned from f will halt the iteration.
  14629. // The provided context supersedes any context provided to the Context method.
  14630. func (c *AdsListCall) Pages(ctx context.Context, f func(*AdsListResponse) error) error {
  14631. c.ctx_ = ctx
  14632. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14633. for {
  14634. x, err := c.Do()
  14635. if err != nil {
  14636. return err
  14637. }
  14638. if err := f(x); err != nil {
  14639. return err
  14640. }
  14641. if x.NextPageToken == "" {
  14642. return nil
  14643. }
  14644. c.PageToken(x.NextPageToken)
  14645. }
  14646. }
  14647. // method id "dfareporting.ads.patch":
  14648. type AdsPatchCall struct {
  14649. s *Service
  14650. profileId int64
  14651. ad *Ad
  14652. urlParams_ gensupport.URLParams
  14653. ctx_ context.Context
  14654. header_ http.Header
  14655. }
  14656. // Patch: Updates an existing ad. This method supports patch semantics.
  14657. func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall {
  14658. c := &AdsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14659. c.profileId = profileId
  14660. c.urlParams_.Set("id", fmt.Sprint(id))
  14661. c.ad = ad
  14662. return c
  14663. }
  14664. // Fields allows partial responses to be retrieved. See
  14665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14666. // for more information.
  14667. func (c *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall {
  14668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14669. return c
  14670. }
  14671. // Context sets the context to be used in this call's Do method. Any
  14672. // pending HTTP request will be aborted if the provided context is
  14673. // canceled.
  14674. func (c *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall {
  14675. c.ctx_ = ctx
  14676. return c
  14677. }
  14678. // Header returns an http.Header that can be modified by the caller to
  14679. // add HTTP headers to the request.
  14680. func (c *AdsPatchCall) Header() http.Header {
  14681. if c.header_ == nil {
  14682. c.header_ = make(http.Header)
  14683. }
  14684. return c.header_
  14685. }
  14686. func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) {
  14687. reqHeaders := make(http.Header)
  14688. for k, v := range c.header_ {
  14689. reqHeaders[k] = v
  14690. }
  14691. reqHeaders.Set("User-Agent", c.s.userAgent())
  14692. var body io.Reader = nil
  14693. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14694. if err != nil {
  14695. return nil, err
  14696. }
  14697. reqHeaders.Set("Content-Type", "application/json")
  14698. c.urlParams_.Set("alt", alt)
  14699. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14700. urls += "?" + c.urlParams_.Encode()
  14701. req, _ := http.NewRequest("PATCH", urls, body)
  14702. req.Header = reqHeaders
  14703. googleapi.Expand(req.URL, map[string]string{
  14704. "profileId": strconv.FormatInt(c.profileId, 10),
  14705. })
  14706. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14707. }
  14708. // Do executes the "dfareporting.ads.patch" call.
  14709. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14710. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14711. // or (if a response was returned at all) in
  14712. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14713. // whether the returned error was because http.StatusNotModified was
  14714. // returned.
  14715. func (c *AdsPatchCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14716. gensupport.SetOptions(c.urlParams_, opts...)
  14717. res, err := c.doRequest("json")
  14718. if res != nil && res.StatusCode == http.StatusNotModified {
  14719. if res.Body != nil {
  14720. res.Body.Close()
  14721. }
  14722. return nil, &googleapi.Error{
  14723. Code: res.StatusCode,
  14724. Header: res.Header,
  14725. }
  14726. }
  14727. if err != nil {
  14728. return nil, err
  14729. }
  14730. defer googleapi.CloseBody(res)
  14731. if err := googleapi.CheckResponse(res); err != nil {
  14732. return nil, err
  14733. }
  14734. ret := &Ad{
  14735. ServerResponse: googleapi.ServerResponse{
  14736. Header: res.Header,
  14737. HTTPStatusCode: res.StatusCode,
  14738. },
  14739. }
  14740. target := &ret
  14741. if err := gensupport.DecodeResponse(target, res); err != nil {
  14742. return nil, err
  14743. }
  14744. return ret, nil
  14745. // {
  14746. // "description": "Updates an existing ad. This method supports patch semantics.",
  14747. // "httpMethod": "PATCH",
  14748. // "id": "dfareporting.ads.patch",
  14749. // "parameterOrder": [
  14750. // "profileId",
  14751. // "id"
  14752. // ],
  14753. // "parameters": {
  14754. // "id": {
  14755. // "description": "Ad ID.",
  14756. // "format": "int64",
  14757. // "location": "query",
  14758. // "required": true,
  14759. // "type": "string"
  14760. // },
  14761. // "profileId": {
  14762. // "description": "User profile ID associated with this request.",
  14763. // "format": "int64",
  14764. // "location": "path",
  14765. // "required": true,
  14766. // "type": "string"
  14767. // }
  14768. // },
  14769. // "path": "userprofiles/{profileId}/ads",
  14770. // "request": {
  14771. // "$ref": "Ad"
  14772. // },
  14773. // "response": {
  14774. // "$ref": "Ad"
  14775. // },
  14776. // "scopes": [
  14777. // "https://www.googleapis.com/auth/dfatrafficking"
  14778. // ]
  14779. // }
  14780. }
  14781. // method id "dfareporting.ads.update":
  14782. type AdsUpdateCall struct {
  14783. s *Service
  14784. profileId int64
  14785. ad *Ad
  14786. urlParams_ gensupport.URLParams
  14787. ctx_ context.Context
  14788. header_ http.Header
  14789. }
  14790. // Update: Updates an existing ad.
  14791. func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall {
  14792. c := &AdsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14793. c.profileId = profileId
  14794. c.ad = ad
  14795. return c
  14796. }
  14797. // Fields allows partial responses to be retrieved. See
  14798. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14799. // for more information.
  14800. func (c *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall {
  14801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14802. return c
  14803. }
  14804. // Context sets the context to be used in this call's Do method. Any
  14805. // pending HTTP request will be aborted if the provided context is
  14806. // canceled.
  14807. func (c *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall {
  14808. c.ctx_ = ctx
  14809. return c
  14810. }
  14811. // Header returns an http.Header that can be modified by the caller to
  14812. // add HTTP headers to the request.
  14813. func (c *AdsUpdateCall) Header() http.Header {
  14814. if c.header_ == nil {
  14815. c.header_ = make(http.Header)
  14816. }
  14817. return c.header_
  14818. }
  14819. func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14820. reqHeaders := make(http.Header)
  14821. for k, v := range c.header_ {
  14822. reqHeaders[k] = v
  14823. }
  14824. reqHeaders.Set("User-Agent", c.s.userAgent())
  14825. var body io.Reader = nil
  14826. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14827. if err != nil {
  14828. return nil, err
  14829. }
  14830. reqHeaders.Set("Content-Type", "application/json")
  14831. c.urlParams_.Set("alt", alt)
  14832. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14833. urls += "?" + c.urlParams_.Encode()
  14834. req, _ := http.NewRequest("PUT", urls, body)
  14835. req.Header = reqHeaders
  14836. googleapi.Expand(req.URL, map[string]string{
  14837. "profileId": strconv.FormatInt(c.profileId, 10),
  14838. })
  14839. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14840. }
  14841. // Do executes the "dfareporting.ads.update" call.
  14842. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14843. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14844. // or (if a response was returned at all) in
  14845. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14846. // whether the returned error was because http.StatusNotModified was
  14847. // returned.
  14848. func (c *AdsUpdateCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14849. gensupport.SetOptions(c.urlParams_, opts...)
  14850. res, err := c.doRequest("json")
  14851. if res != nil && res.StatusCode == http.StatusNotModified {
  14852. if res.Body != nil {
  14853. res.Body.Close()
  14854. }
  14855. return nil, &googleapi.Error{
  14856. Code: res.StatusCode,
  14857. Header: res.Header,
  14858. }
  14859. }
  14860. if err != nil {
  14861. return nil, err
  14862. }
  14863. defer googleapi.CloseBody(res)
  14864. if err := googleapi.CheckResponse(res); err != nil {
  14865. return nil, err
  14866. }
  14867. ret := &Ad{
  14868. ServerResponse: googleapi.ServerResponse{
  14869. Header: res.Header,
  14870. HTTPStatusCode: res.StatusCode,
  14871. },
  14872. }
  14873. target := &ret
  14874. if err := gensupport.DecodeResponse(target, res); err != nil {
  14875. return nil, err
  14876. }
  14877. return ret, nil
  14878. // {
  14879. // "description": "Updates an existing ad.",
  14880. // "httpMethod": "PUT",
  14881. // "id": "dfareporting.ads.update",
  14882. // "parameterOrder": [
  14883. // "profileId"
  14884. // ],
  14885. // "parameters": {
  14886. // "profileId": {
  14887. // "description": "User profile ID associated with this request.",
  14888. // "format": "int64",
  14889. // "location": "path",
  14890. // "required": true,
  14891. // "type": "string"
  14892. // }
  14893. // },
  14894. // "path": "userprofiles/{profileId}/ads",
  14895. // "request": {
  14896. // "$ref": "Ad"
  14897. // },
  14898. // "response": {
  14899. // "$ref": "Ad"
  14900. // },
  14901. // "scopes": [
  14902. // "https://www.googleapis.com/auth/dfatrafficking"
  14903. // ]
  14904. // }
  14905. }
  14906. // method id "dfareporting.advertiserGroups.delete":
  14907. type AdvertiserGroupsDeleteCall struct {
  14908. s *Service
  14909. profileId int64
  14910. id int64
  14911. urlParams_ gensupport.URLParams
  14912. ctx_ context.Context
  14913. header_ http.Header
  14914. }
  14915. // Delete: Deletes an existing advertiser group.
  14916. func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall {
  14917. c := &AdvertiserGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14918. c.profileId = profileId
  14919. c.id = id
  14920. return c
  14921. }
  14922. // Fields allows partial responses to be retrieved. See
  14923. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14924. // for more information.
  14925. func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall {
  14926. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14927. return c
  14928. }
  14929. // Context sets the context to be used in this call's Do method. Any
  14930. // pending HTTP request will be aborted if the provided context is
  14931. // canceled.
  14932. func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall {
  14933. c.ctx_ = ctx
  14934. return c
  14935. }
  14936. // Header returns an http.Header that can be modified by the caller to
  14937. // add HTTP headers to the request.
  14938. func (c *AdvertiserGroupsDeleteCall) Header() http.Header {
  14939. if c.header_ == nil {
  14940. c.header_ = make(http.Header)
  14941. }
  14942. return c.header_
  14943. }
  14944. func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14945. reqHeaders := make(http.Header)
  14946. for k, v := range c.header_ {
  14947. reqHeaders[k] = v
  14948. }
  14949. reqHeaders.Set("User-Agent", c.s.userAgent())
  14950. var body io.Reader = nil
  14951. c.urlParams_.Set("alt", alt)
  14952. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  14953. urls += "?" + c.urlParams_.Encode()
  14954. req, _ := http.NewRequest("DELETE", urls, body)
  14955. req.Header = reqHeaders
  14956. googleapi.Expand(req.URL, map[string]string{
  14957. "profileId": strconv.FormatInt(c.profileId, 10),
  14958. "id": strconv.FormatInt(c.id, 10),
  14959. })
  14960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14961. }
  14962. // Do executes the "dfareporting.advertiserGroups.delete" call.
  14963. func (c *AdvertiserGroupsDeleteCall) Do(opts ...googleapi.CallOption) error {
  14964. gensupport.SetOptions(c.urlParams_, opts...)
  14965. res, err := c.doRequest("json")
  14966. if err != nil {
  14967. return err
  14968. }
  14969. defer googleapi.CloseBody(res)
  14970. if err := googleapi.CheckResponse(res); err != nil {
  14971. return err
  14972. }
  14973. return nil
  14974. // {
  14975. // "description": "Deletes an existing advertiser group.",
  14976. // "httpMethod": "DELETE",
  14977. // "id": "dfareporting.advertiserGroups.delete",
  14978. // "parameterOrder": [
  14979. // "profileId",
  14980. // "id"
  14981. // ],
  14982. // "parameters": {
  14983. // "id": {
  14984. // "description": "Advertiser group ID.",
  14985. // "format": "int64",
  14986. // "location": "path",
  14987. // "required": true,
  14988. // "type": "string"
  14989. // },
  14990. // "profileId": {
  14991. // "description": "User profile ID associated with this request.",
  14992. // "format": "int64",
  14993. // "location": "path",
  14994. // "required": true,
  14995. // "type": "string"
  14996. // }
  14997. // },
  14998. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  14999. // "scopes": [
  15000. // "https://www.googleapis.com/auth/dfatrafficking"
  15001. // ]
  15002. // }
  15003. }
  15004. // method id "dfareporting.advertiserGroups.get":
  15005. type AdvertiserGroupsGetCall struct {
  15006. s *Service
  15007. profileId int64
  15008. id int64
  15009. urlParams_ gensupport.URLParams
  15010. ifNoneMatch_ string
  15011. ctx_ context.Context
  15012. header_ http.Header
  15013. }
  15014. // Get: Gets one advertiser group by ID.
  15015. func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall {
  15016. c := &AdvertiserGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15017. c.profileId = profileId
  15018. c.id = id
  15019. return c
  15020. }
  15021. // Fields allows partial responses to be retrieved. See
  15022. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15023. // for more information.
  15024. func (c *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall {
  15025. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15026. return c
  15027. }
  15028. // IfNoneMatch sets the optional parameter which makes the operation
  15029. // fail if the object's ETag matches the given value. This is useful for
  15030. // getting updates only after the object has changed since the last
  15031. // request. Use googleapi.IsNotModified to check whether the response
  15032. // error from Do is the result of In-None-Match.
  15033. func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall {
  15034. c.ifNoneMatch_ = entityTag
  15035. return c
  15036. }
  15037. // Context sets the context to be used in this call's Do method. Any
  15038. // pending HTTP request will be aborted if the provided context is
  15039. // canceled.
  15040. func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall {
  15041. c.ctx_ = ctx
  15042. return c
  15043. }
  15044. // Header returns an http.Header that can be modified by the caller to
  15045. // add HTTP headers to the request.
  15046. func (c *AdvertiserGroupsGetCall) Header() http.Header {
  15047. if c.header_ == nil {
  15048. c.header_ = make(http.Header)
  15049. }
  15050. return c.header_
  15051. }
  15052. func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  15053. reqHeaders := make(http.Header)
  15054. for k, v := range c.header_ {
  15055. reqHeaders[k] = v
  15056. }
  15057. reqHeaders.Set("User-Agent", c.s.userAgent())
  15058. if c.ifNoneMatch_ != "" {
  15059. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15060. }
  15061. var body io.Reader = nil
  15062. c.urlParams_.Set("alt", alt)
  15063. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  15064. urls += "?" + c.urlParams_.Encode()
  15065. req, _ := http.NewRequest("GET", urls, body)
  15066. req.Header = reqHeaders
  15067. googleapi.Expand(req.URL, map[string]string{
  15068. "profileId": strconv.FormatInt(c.profileId, 10),
  15069. "id": strconv.FormatInt(c.id, 10),
  15070. })
  15071. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15072. }
  15073. // Do executes the "dfareporting.advertiserGroups.get" call.
  15074. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15075. // status code is an error. Response headers are in either
  15076. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15077. // at all) in error.(*googleapi.Error).Header. Use
  15078. // googleapi.IsNotModified to check whether the returned error was
  15079. // because http.StatusNotModified was returned.
  15080. func (c *AdvertiserGroupsGetCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15081. gensupport.SetOptions(c.urlParams_, opts...)
  15082. res, err := c.doRequest("json")
  15083. if res != nil && res.StatusCode == http.StatusNotModified {
  15084. if res.Body != nil {
  15085. res.Body.Close()
  15086. }
  15087. return nil, &googleapi.Error{
  15088. Code: res.StatusCode,
  15089. Header: res.Header,
  15090. }
  15091. }
  15092. if err != nil {
  15093. return nil, err
  15094. }
  15095. defer googleapi.CloseBody(res)
  15096. if err := googleapi.CheckResponse(res); err != nil {
  15097. return nil, err
  15098. }
  15099. ret := &AdvertiserGroup{
  15100. ServerResponse: googleapi.ServerResponse{
  15101. Header: res.Header,
  15102. HTTPStatusCode: res.StatusCode,
  15103. },
  15104. }
  15105. target := &ret
  15106. if err := gensupport.DecodeResponse(target, res); err != nil {
  15107. return nil, err
  15108. }
  15109. return ret, nil
  15110. // {
  15111. // "description": "Gets one advertiser group by ID.",
  15112. // "httpMethod": "GET",
  15113. // "id": "dfareporting.advertiserGroups.get",
  15114. // "parameterOrder": [
  15115. // "profileId",
  15116. // "id"
  15117. // ],
  15118. // "parameters": {
  15119. // "id": {
  15120. // "description": "Advertiser group ID.",
  15121. // "format": "int64",
  15122. // "location": "path",
  15123. // "required": true,
  15124. // "type": "string"
  15125. // },
  15126. // "profileId": {
  15127. // "description": "User profile ID associated with this request.",
  15128. // "format": "int64",
  15129. // "location": "path",
  15130. // "required": true,
  15131. // "type": "string"
  15132. // }
  15133. // },
  15134. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  15135. // "response": {
  15136. // "$ref": "AdvertiserGroup"
  15137. // },
  15138. // "scopes": [
  15139. // "https://www.googleapis.com/auth/dfatrafficking"
  15140. // ]
  15141. // }
  15142. }
  15143. // method id "dfareporting.advertiserGroups.insert":
  15144. type AdvertiserGroupsInsertCall struct {
  15145. s *Service
  15146. profileId int64
  15147. advertisergroup *AdvertiserGroup
  15148. urlParams_ gensupport.URLParams
  15149. ctx_ context.Context
  15150. header_ http.Header
  15151. }
  15152. // Insert: Inserts a new advertiser group.
  15153. func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall {
  15154. c := &AdvertiserGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15155. c.profileId = profileId
  15156. c.advertisergroup = advertisergroup
  15157. return c
  15158. }
  15159. // Fields allows partial responses to be retrieved. See
  15160. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15161. // for more information.
  15162. func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall {
  15163. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15164. return c
  15165. }
  15166. // Context sets the context to be used in this call's Do method. Any
  15167. // pending HTTP request will be aborted if the provided context is
  15168. // canceled.
  15169. func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall {
  15170. c.ctx_ = ctx
  15171. return c
  15172. }
  15173. // Header returns an http.Header that can be modified by the caller to
  15174. // add HTTP headers to the request.
  15175. func (c *AdvertiserGroupsInsertCall) Header() http.Header {
  15176. if c.header_ == nil {
  15177. c.header_ = make(http.Header)
  15178. }
  15179. return c.header_
  15180. }
  15181. func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  15182. reqHeaders := make(http.Header)
  15183. for k, v := range c.header_ {
  15184. reqHeaders[k] = v
  15185. }
  15186. reqHeaders.Set("User-Agent", c.s.userAgent())
  15187. var body io.Reader = nil
  15188. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15189. if err != nil {
  15190. return nil, err
  15191. }
  15192. reqHeaders.Set("Content-Type", "application/json")
  15193. c.urlParams_.Set("alt", alt)
  15194. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15195. urls += "?" + c.urlParams_.Encode()
  15196. req, _ := http.NewRequest("POST", urls, body)
  15197. req.Header = reqHeaders
  15198. googleapi.Expand(req.URL, map[string]string{
  15199. "profileId": strconv.FormatInt(c.profileId, 10),
  15200. })
  15201. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15202. }
  15203. // Do executes the "dfareporting.advertiserGroups.insert" call.
  15204. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15205. // status code is an error. Response headers are in either
  15206. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15207. // at all) in error.(*googleapi.Error).Header. Use
  15208. // googleapi.IsNotModified to check whether the returned error was
  15209. // because http.StatusNotModified was returned.
  15210. func (c *AdvertiserGroupsInsertCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15211. gensupport.SetOptions(c.urlParams_, opts...)
  15212. res, err := c.doRequest("json")
  15213. if res != nil && res.StatusCode == http.StatusNotModified {
  15214. if res.Body != nil {
  15215. res.Body.Close()
  15216. }
  15217. return nil, &googleapi.Error{
  15218. Code: res.StatusCode,
  15219. Header: res.Header,
  15220. }
  15221. }
  15222. if err != nil {
  15223. return nil, err
  15224. }
  15225. defer googleapi.CloseBody(res)
  15226. if err := googleapi.CheckResponse(res); err != nil {
  15227. return nil, err
  15228. }
  15229. ret := &AdvertiserGroup{
  15230. ServerResponse: googleapi.ServerResponse{
  15231. Header: res.Header,
  15232. HTTPStatusCode: res.StatusCode,
  15233. },
  15234. }
  15235. target := &ret
  15236. if err := gensupport.DecodeResponse(target, res); err != nil {
  15237. return nil, err
  15238. }
  15239. return ret, nil
  15240. // {
  15241. // "description": "Inserts a new advertiser group.",
  15242. // "httpMethod": "POST",
  15243. // "id": "dfareporting.advertiserGroups.insert",
  15244. // "parameterOrder": [
  15245. // "profileId"
  15246. // ],
  15247. // "parameters": {
  15248. // "profileId": {
  15249. // "description": "User profile ID associated with this request.",
  15250. // "format": "int64",
  15251. // "location": "path",
  15252. // "required": true,
  15253. // "type": "string"
  15254. // }
  15255. // },
  15256. // "path": "userprofiles/{profileId}/advertiserGroups",
  15257. // "request": {
  15258. // "$ref": "AdvertiserGroup"
  15259. // },
  15260. // "response": {
  15261. // "$ref": "AdvertiserGroup"
  15262. // },
  15263. // "scopes": [
  15264. // "https://www.googleapis.com/auth/dfatrafficking"
  15265. // ]
  15266. // }
  15267. }
  15268. // method id "dfareporting.advertiserGroups.list":
  15269. type AdvertiserGroupsListCall struct {
  15270. s *Service
  15271. profileId int64
  15272. urlParams_ gensupport.URLParams
  15273. ifNoneMatch_ string
  15274. ctx_ context.Context
  15275. header_ http.Header
  15276. }
  15277. // List: Retrieves a list of advertiser groups, possibly filtered. This
  15278. // method supports paging.
  15279. func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall {
  15280. c := &AdvertiserGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15281. c.profileId = profileId
  15282. return c
  15283. }
  15284. // Ids sets the optional parameter "ids": Select only advertiser groups
  15285. // with these IDs.
  15286. func (c *AdvertiserGroupsListCall) Ids(ids ...int64) *AdvertiserGroupsListCall {
  15287. var ids_ []string
  15288. for _, v := range ids {
  15289. ids_ = append(ids_, fmt.Sprint(v))
  15290. }
  15291. c.urlParams_.SetMulti("ids", ids_)
  15292. return c
  15293. }
  15294. // MaxResults sets the optional parameter "maxResults": Maximum number
  15295. // of results to return.
  15296. func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall {
  15297. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15298. return c
  15299. }
  15300. // PageToken sets the optional parameter "pageToken": Value of the
  15301. // nextPageToken from the previous result page.
  15302. func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall {
  15303. c.urlParams_.Set("pageToken", pageToken)
  15304. return c
  15305. }
  15306. // SearchString sets the optional parameter "searchString": Allows
  15307. // searching for objects by name or ID. Wildcards (*) are allowed. For
  15308. // example, "advertiser*2015" will return objects with names like
  15309. // "advertiser group June 2015", "advertiser group April 2015", or
  15310. // simply "advertiser group 2015". Most of the searches also add
  15311. // wildcards implicitly at the start and the end of the search string.
  15312. // For example, a search string of "advertisergroup" will match objects
  15313. // with name "my advertisergroup", "advertisergroup 2015", or simply
  15314. // "advertisergroup".
  15315. func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall {
  15316. c.urlParams_.Set("searchString", searchString)
  15317. return c
  15318. }
  15319. // SortField sets the optional parameter "sortField": Field by which to
  15320. // sort the list.
  15321. //
  15322. // Possible values:
  15323. // "ID" (default)
  15324. // "NAME"
  15325. func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall {
  15326. c.urlParams_.Set("sortField", sortField)
  15327. return c
  15328. }
  15329. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  15330. // results.
  15331. //
  15332. // Possible values:
  15333. // "ASCENDING" (default)
  15334. // "DESCENDING"
  15335. func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall {
  15336. c.urlParams_.Set("sortOrder", sortOrder)
  15337. return c
  15338. }
  15339. // Fields allows partial responses to be retrieved. See
  15340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15341. // for more information.
  15342. func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall {
  15343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15344. return c
  15345. }
  15346. // IfNoneMatch sets the optional parameter which makes the operation
  15347. // fail if the object's ETag matches the given value. This is useful for
  15348. // getting updates only after the object has changed since the last
  15349. // request. Use googleapi.IsNotModified to check whether the response
  15350. // error from Do is the result of In-None-Match.
  15351. func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall {
  15352. c.ifNoneMatch_ = entityTag
  15353. return c
  15354. }
  15355. // Context sets the context to be used in this call's Do method. Any
  15356. // pending HTTP request will be aborted if the provided context is
  15357. // canceled.
  15358. func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall {
  15359. c.ctx_ = ctx
  15360. return c
  15361. }
  15362. // Header returns an http.Header that can be modified by the caller to
  15363. // add HTTP headers to the request.
  15364. func (c *AdvertiserGroupsListCall) Header() http.Header {
  15365. if c.header_ == nil {
  15366. c.header_ = make(http.Header)
  15367. }
  15368. return c.header_
  15369. }
  15370. func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) {
  15371. reqHeaders := make(http.Header)
  15372. for k, v := range c.header_ {
  15373. reqHeaders[k] = v
  15374. }
  15375. reqHeaders.Set("User-Agent", c.s.userAgent())
  15376. if c.ifNoneMatch_ != "" {
  15377. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15378. }
  15379. var body io.Reader = nil
  15380. c.urlParams_.Set("alt", alt)
  15381. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15382. urls += "?" + c.urlParams_.Encode()
  15383. req, _ := http.NewRequest("GET", urls, body)
  15384. req.Header = reqHeaders
  15385. googleapi.Expand(req.URL, map[string]string{
  15386. "profileId": strconv.FormatInt(c.profileId, 10),
  15387. })
  15388. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15389. }
  15390. // Do executes the "dfareporting.advertiserGroups.list" call.
  15391. // Exactly one of *AdvertiserGroupsListResponse or error will be
  15392. // non-nil. Any non-2xx status code is an error. Response headers are in
  15393. // either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a
  15394. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15395. // googleapi.IsNotModified to check whether the returned error was
  15396. // because http.StatusNotModified was returned.
  15397. func (c *AdvertiserGroupsListCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroupsListResponse, error) {
  15398. gensupport.SetOptions(c.urlParams_, opts...)
  15399. res, err := c.doRequest("json")
  15400. if res != nil && res.StatusCode == http.StatusNotModified {
  15401. if res.Body != nil {
  15402. res.Body.Close()
  15403. }
  15404. return nil, &googleapi.Error{
  15405. Code: res.StatusCode,
  15406. Header: res.Header,
  15407. }
  15408. }
  15409. if err != nil {
  15410. return nil, err
  15411. }
  15412. defer googleapi.CloseBody(res)
  15413. if err := googleapi.CheckResponse(res); err != nil {
  15414. return nil, err
  15415. }
  15416. ret := &AdvertiserGroupsListResponse{
  15417. ServerResponse: googleapi.ServerResponse{
  15418. Header: res.Header,
  15419. HTTPStatusCode: res.StatusCode,
  15420. },
  15421. }
  15422. target := &ret
  15423. if err := gensupport.DecodeResponse(target, res); err != nil {
  15424. return nil, err
  15425. }
  15426. return ret, nil
  15427. // {
  15428. // "description": "Retrieves a list of advertiser groups, possibly filtered. This method supports paging.",
  15429. // "httpMethod": "GET",
  15430. // "id": "dfareporting.advertiserGroups.list",
  15431. // "parameterOrder": [
  15432. // "profileId"
  15433. // ],
  15434. // "parameters": {
  15435. // "ids": {
  15436. // "description": "Select only advertiser groups with these IDs.",
  15437. // "format": "int64",
  15438. // "location": "query",
  15439. // "repeated": true,
  15440. // "type": "string"
  15441. // },
  15442. // "maxResults": {
  15443. // "default": "1000",
  15444. // "description": "Maximum number of results to return.",
  15445. // "format": "int32",
  15446. // "location": "query",
  15447. // "maximum": "1000",
  15448. // "minimum": "0",
  15449. // "type": "integer"
  15450. // },
  15451. // "pageToken": {
  15452. // "description": "Value of the nextPageToken from the previous result page.",
  15453. // "location": "query",
  15454. // "type": "string"
  15455. // },
  15456. // "profileId": {
  15457. // "description": "User profile ID associated with this request.",
  15458. // "format": "int64",
  15459. // "location": "path",
  15460. // "required": true,
  15461. // "type": "string"
  15462. // },
  15463. // "searchString": {
  15464. // "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\".",
  15465. // "location": "query",
  15466. // "type": "string"
  15467. // },
  15468. // "sortField": {
  15469. // "default": "ID",
  15470. // "description": "Field by which to sort the list.",
  15471. // "enum": [
  15472. // "ID",
  15473. // "NAME"
  15474. // ],
  15475. // "enumDescriptions": [
  15476. // "",
  15477. // ""
  15478. // ],
  15479. // "location": "query",
  15480. // "type": "string"
  15481. // },
  15482. // "sortOrder": {
  15483. // "default": "ASCENDING",
  15484. // "description": "Order of sorted results.",
  15485. // "enum": [
  15486. // "ASCENDING",
  15487. // "DESCENDING"
  15488. // ],
  15489. // "enumDescriptions": [
  15490. // "",
  15491. // ""
  15492. // ],
  15493. // "location": "query",
  15494. // "type": "string"
  15495. // }
  15496. // },
  15497. // "path": "userprofiles/{profileId}/advertiserGroups",
  15498. // "response": {
  15499. // "$ref": "AdvertiserGroupsListResponse"
  15500. // },
  15501. // "scopes": [
  15502. // "https://www.googleapis.com/auth/dfatrafficking"
  15503. // ]
  15504. // }
  15505. }
  15506. // Pages invokes f for each page of results.
  15507. // A non-nil error returned from f will halt the iteration.
  15508. // The provided context supersedes any context provided to the Context method.
  15509. func (c *AdvertiserGroupsListCall) Pages(ctx context.Context, f func(*AdvertiserGroupsListResponse) error) error {
  15510. c.ctx_ = ctx
  15511. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15512. for {
  15513. x, err := c.Do()
  15514. if err != nil {
  15515. return err
  15516. }
  15517. if err := f(x); err != nil {
  15518. return err
  15519. }
  15520. if x.NextPageToken == "" {
  15521. return nil
  15522. }
  15523. c.PageToken(x.NextPageToken)
  15524. }
  15525. }
  15526. // method id "dfareporting.advertiserGroups.patch":
  15527. type AdvertiserGroupsPatchCall struct {
  15528. s *Service
  15529. profileId int64
  15530. advertisergroup *AdvertiserGroup
  15531. urlParams_ gensupport.URLParams
  15532. ctx_ context.Context
  15533. header_ http.Header
  15534. }
  15535. // Patch: Updates an existing advertiser group. This method supports
  15536. // patch semantics.
  15537. func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall {
  15538. c := &AdvertiserGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15539. c.profileId = profileId
  15540. c.urlParams_.Set("id", fmt.Sprint(id))
  15541. c.advertisergroup = advertisergroup
  15542. return c
  15543. }
  15544. // Fields allows partial responses to be retrieved. See
  15545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15546. // for more information.
  15547. func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall {
  15548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15549. return c
  15550. }
  15551. // Context sets the context to be used in this call's Do method. Any
  15552. // pending HTTP request will be aborted if the provided context is
  15553. // canceled.
  15554. func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall {
  15555. c.ctx_ = ctx
  15556. return c
  15557. }
  15558. // Header returns an http.Header that can be modified by the caller to
  15559. // add HTTP headers to the request.
  15560. func (c *AdvertiserGroupsPatchCall) Header() http.Header {
  15561. if c.header_ == nil {
  15562. c.header_ = make(http.Header)
  15563. }
  15564. return c.header_
  15565. }
  15566. func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  15567. reqHeaders := make(http.Header)
  15568. for k, v := range c.header_ {
  15569. reqHeaders[k] = v
  15570. }
  15571. reqHeaders.Set("User-Agent", c.s.userAgent())
  15572. var body io.Reader = nil
  15573. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15574. if err != nil {
  15575. return nil, err
  15576. }
  15577. reqHeaders.Set("Content-Type", "application/json")
  15578. c.urlParams_.Set("alt", alt)
  15579. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15580. urls += "?" + c.urlParams_.Encode()
  15581. req, _ := http.NewRequest("PATCH", urls, body)
  15582. req.Header = reqHeaders
  15583. googleapi.Expand(req.URL, map[string]string{
  15584. "profileId": strconv.FormatInt(c.profileId, 10),
  15585. })
  15586. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15587. }
  15588. // Do executes the "dfareporting.advertiserGroups.patch" call.
  15589. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15590. // status code is an error. Response headers are in either
  15591. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15592. // at all) in error.(*googleapi.Error).Header. Use
  15593. // googleapi.IsNotModified to check whether the returned error was
  15594. // because http.StatusNotModified was returned.
  15595. func (c *AdvertiserGroupsPatchCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15596. gensupport.SetOptions(c.urlParams_, opts...)
  15597. res, err := c.doRequest("json")
  15598. if res != nil && res.StatusCode == http.StatusNotModified {
  15599. if res.Body != nil {
  15600. res.Body.Close()
  15601. }
  15602. return nil, &googleapi.Error{
  15603. Code: res.StatusCode,
  15604. Header: res.Header,
  15605. }
  15606. }
  15607. if err != nil {
  15608. return nil, err
  15609. }
  15610. defer googleapi.CloseBody(res)
  15611. if err := googleapi.CheckResponse(res); err != nil {
  15612. return nil, err
  15613. }
  15614. ret := &AdvertiserGroup{
  15615. ServerResponse: googleapi.ServerResponse{
  15616. Header: res.Header,
  15617. HTTPStatusCode: res.StatusCode,
  15618. },
  15619. }
  15620. target := &ret
  15621. if err := gensupport.DecodeResponse(target, res); err != nil {
  15622. return nil, err
  15623. }
  15624. return ret, nil
  15625. // {
  15626. // "description": "Updates an existing advertiser group. This method supports patch semantics.",
  15627. // "httpMethod": "PATCH",
  15628. // "id": "dfareporting.advertiserGroups.patch",
  15629. // "parameterOrder": [
  15630. // "profileId",
  15631. // "id"
  15632. // ],
  15633. // "parameters": {
  15634. // "id": {
  15635. // "description": "Advertiser group ID.",
  15636. // "format": "int64",
  15637. // "location": "query",
  15638. // "required": true,
  15639. // "type": "string"
  15640. // },
  15641. // "profileId": {
  15642. // "description": "User profile ID associated with this request.",
  15643. // "format": "int64",
  15644. // "location": "path",
  15645. // "required": true,
  15646. // "type": "string"
  15647. // }
  15648. // },
  15649. // "path": "userprofiles/{profileId}/advertiserGroups",
  15650. // "request": {
  15651. // "$ref": "AdvertiserGroup"
  15652. // },
  15653. // "response": {
  15654. // "$ref": "AdvertiserGroup"
  15655. // },
  15656. // "scopes": [
  15657. // "https://www.googleapis.com/auth/dfatrafficking"
  15658. // ]
  15659. // }
  15660. }
  15661. // method id "dfareporting.advertiserGroups.update":
  15662. type AdvertiserGroupsUpdateCall struct {
  15663. s *Service
  15664. profileId int64
  15665. advertisergroup *AdvertiserGroup
  15666. urlParams_ gensupport.URLParams
  15667. ctx_ context.Context
  15668. header_ http.Header
  15669. }
  15670. // Update: Updates an existing advertiser group.
  15671. func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall {
  15672. c := &AdvertiserGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15673. c.profileId = profileId
  15674. c.advertisergroup = advertisergroup
  15675. return c
  15676. }
  15677. // Fields allows partial responses to be retrieved. See
  15678. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15679. // for more information.
  15680. func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall {
  15681. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15682. return c
  15683. }
  15684. // Context sets the context to be used in this call's Do method. Any
  15685. // pending HTTP request will be aborted if the provided context is
  15686. // canceled.
  15687. func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall {
  15688. c.ctx_ = ctx
  15689. return c
  15690. }
  15691. // Header returns an http.Header that can be modified by the caller to
  15692. // add HTTP headers to the request.
  15693. func (c *AdvertiserGroupsUpdateCall) Header() http.Header {
  15694. if c.header_ == nil {
  15695. c.header_ = make(http.Header)
  15696. }
  15697. return c.header_
  15698. }
  15699. func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15700. reqHeaders := make(http.Header)
  15701. for k, v := range c.header_ {
  15702. reqHeaders[k] = v
  15703. }
  15704. reqHeaders.Set("User-Agent", c.s.userAgent())
  15705. var body io.Reader = nil
  15706. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15707. if err != nil {
  15708. return nil, err
  15709. }
  15710. reqHeaders.Set("Content-Type", "application/json")
  15711. c.urlParams_.Set("alt", alt)
  15712. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15713. urls += "?" + c.urlParams_.Encode()
  15714. req, _ := http.NewRequest("PUT", urls, body)
  15715. req.Header = reqHeaders
  15716. googleapi.Expand(req.URL, map[string]string{
  15717. "profileId": strconv.FormatInt(c.profileId, 10),
  15718. })
  15719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15720. }
  15721. // Do executes the "dfareporting.advertiserGroups.update" call.
  15722. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15723. // status code is an error. Response headers are in either
  15724. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15725. // at all) in error.(*googleapi.Error).Header. Use
  15726. // googleapi.IsNotModified to check whether the returned error was
  15727. // because http.StatusNotModified was returned.
  15728. func (c *AdvertiserGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15729. gensupport.SetOptions(c.urlParams_, opts...)
  15730. res, err := c.doRequest("json")
  15731. if res != nil && res.StatusCode == http.StatusNotModified {
  15732. if res.Body != nil {
  15733. res.Body.Close()
  15734. }
  15735. return nil, &googleapi.Error{
  15736. Code: res.StatusCode,
  15737. Header: res.Header,
  15738. }
  15739. }
  15740. if err != nil {
  15741. return nil, err
  15742. }
  15743. defer googleapi.CloseBody(res)
  15744. if err := googleapi.CheckResponse(res); err != nil {
  15745. return nil, err
  15746. }
  15747. ret := &AdvertiserGroup{
  15748. ServerResponse: googleapi.ServerResponse{
  15749. Header: res.Header,
  15750. HTTPStatusCode: res.StatusCode,
  15751. },
  15752. }
  15753. target := &ret
  15754. if err := gensupport.DecodeResponse(target, res); err != nil {
  15755. return nil, err
  15756. }
  15757. return ret, nil
  15758. // {
  15759. // "description": "Updates an existing advertiser group.",
  15760. // "httpMethod": "PUT",
  15761. // "id": "dfareporting.advertiserGroups.update",
  15762. // "parameterOrder": [
  15763. // "profileId"
  15764. // ],
  15765. // "parameters": {
  15766. // "profileId": {
  15767. // "description": "User profile ID associated with this request.",
  15768. // "format": "int64",
  15769. // "location": "path",
  15770. // "required": true,
  15771. // "type": "string"
  15772. // }
  15773. // },
  15774. // "path": "userprofiles/{profileId}/advertiserGroups",
  15775. // "request": {
  15776. // "$ref": "AdvertiserGroup"
  15777. // },
  15778. // "response": {
  15779. // "$ref": "AdvertiserGroup"
  15780. // },
  15781. // "scopes": [
  15782. // "https://www.googleapis.com/auth/dfatrafficking"
  15783. // ]
  15784. // }
  15785. }
  15786. // method id "dfareporting.advertiserLandingPages.get":
  15787. type AdvertiserLandingPagesGetCall struct {
  15788. s *Service
  15789. profileId int64
  15790. id int64
  15791. urlParams_ gensupport.URLParams
  15792. ifNoneMatch_ string
  15793. ctx_ context.Context
  15794. header_ http.Header
  15795. }
  15796. // Get: Gets one landing page by ID.
  15797. func (r *AdvertiserLandingPagesService) Get(profileId int64, id int64) *AdvertiserLandingPagesGetCall {
  15798. c := &AdvertiserLandingPagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15799. c.profileId = profileId
  15800. c.id = id
  15801. return c
  15802. }
  15803. // Fields allows partial responses to be retrieved. See
  15804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15805. // for more information.
  15806. func (c *AdvertiserLandingPagesGetCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesGetCall {
  15807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15808. return c
  15809. }
  15810. // IfNoneMatch sets the optional parameter which makes the operation
  15811. // fail if the object's ETag matches the given value. This is useful for
  15812. // getting updates only after the object has changed since the last
  15813. // request. Use googleapi.IsNotModified to check whether the response
  15814. // error from Do is the result of In-None-Match.
  15815. func (c *AdvertiserLandingPagesGetCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesGetCall {
  15816. c.ifNoneMatch_ = entityTag
  15817. return c
  15818. }
  15819. // Context sets the context to be used in this call's Do method. Any
  15820. // pending HTTP request will be aborted if the provided context is
  15821. // canceled.
  15822. func (c *AdvertiserLandingPagesGetCall) Context(ctx context.Context) *AdvertiserLandingPagesGetCall {
  15823. c.ctx_ = ctx
  15824. return c
  15825. }
  15826. // Header returns an http.Header that can be modified by the caller to
  15827. // add HTTP headers to the request.
  15828. func (c *AdvertiserLandingPagesGetCall) Header() http.Header {
  15829. if c.header_ == nil {
  15830. c.header_ = make(http.Header)
  15831. }
  15832. return c.header_
  15833. }
  15834. func (c *AdvertiserLandingPagesGetCall) doRequest(alt string) (*http.Response, error) {
  15835. reqHeaders := make(http.Header)
  15836. for k, v := range c.header_ {
  15837. reqHeaders[k] = v
  15838. }
  15839. reqHeaders.Set("User-Agent", c.s.userAgent())
  15840. if c.ifNoneMatch_ != "" {
  15841. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15842. }
  15843. var body io.Reader = nil
  15844. c.urlParams_.Set("alt", alt)
  15845. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages/{id}")
  15846. urls += "?" + c.urlParams_.Encode()
  15847. req, _ := http.NewRequest("GET", urls, body)
  15848. req.Header = reqHeaders
  15849. googleapi.Expand(req.URL, map[string]string{
  15850. "profileId": strconv.FormatInt(c.profileId, 10),
  15851. "id": strconv.FormatInt(c.id, 10),
  15852. })
  15853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15854. }
  15855. // Do executes the "dfareporting.advertiserLandingPages.get" call.
  15856. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  15857. // status code is an error. Response headers are in either
  15858. // *LandingPage.ServerResponse.Header or (if a response was returned at
  15859. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15860. // to check whether the returned error was because
  15861. // http.StatusNotModified was returned.
  15862. func (c *AdvertiserLandingPagesGetCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  15863. gensupport.SetOptions(c.urlParams_, opts...)
  15864. res, err := c.doRequest("json")
  15865. if res != nil && res.StatusCode == http.StatusNotModified {
  15866. if res.Body != nil {
  15867. res.Body.Close()
  15868. }
  15869. return nil, &googleapi.Error{
  15870. Code: res.StatusCode,
  15871. Header: res.Header,
  15872. }
  15873. }
  15874. if err != nil {
  15875. return nil, err
  15876. }
  15877. defer googleapi.CloseBody(res)
  15878. if err := googleapi.CheckResponse(res); err != nil {
  15879. return nil, err
  15880. }
  15881. ret := &LandingPage{
  15882. ServerResponse: googleapi.ServerResponse{
  15883. Header: res.Header,
  15884. HTTPStatusCode: res.StatusCode,
  15885. },
  15886. }
  15887. target := &ret
  15888. if err := gensupport.DecodeResponse(target, res); err != nil {
  15889. return nil, err
  15890. }
  15891. return ret, nil
  15892. // {
  15893. // "description": "Gets one landing page by ID.",
  15894. // "httpMethod": "GET",
  15895. // "id": "dfareporting.advertiserLandingPages.get",
  15896. // "parameterOrder": [
  15897. // "profileId",
  15898. // "id"
  15899. // ],
  15900. // "parameters": {
  15901. // "id": {
  15902. // "description": "Landing page ID.",
  15903. // "format": "int64",
  15904. // "location": "path",
  15905. // "required": true,
  15906. // "type": "string"
  15907. // },
  15908. // "profileId": {
  15909. // "description": "User profile ID associated with this request.",
  15910. // "format": "int64",
  15911. // "location": "path",
  15912. // "required": true,
  15913. // "type": "string"
  15914. // }
  15915. // },
  15916. // "path": "userprofiles/{profileId}/advertiserLandingPages/{id}",
  15917. // "response": {
  15918. // "$ref": "LandingPage"
  15919. // },
  15920. // "scopes": [
  15921. // "https://www.googleapis.com/auth/dfatrafficking"
  15922. // ]
  15923. // }
  15924. }
  15925. // method id "dfareporting.advertiserLandingPages.insert":
  15926. type AdvertiserLandingPagesInsertCall struct {
  15927. s *Service
  15928. profileId int64
  15929. landingpage *LandingPage
  15930. urlParams_ gensupport.URLParams
  15931. ctx_ context.Context
  15932. header_ http.Header
  15933. }
  15934. // Insert: Inserts a new landing page.
  15935. func (r *AdvertiserLandingPagesService) Insert(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesInsertCall {
  15936. c := &AdvertiserLandingPagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15937. c.profileId = profileId
  15938. c.landingpage = landingpage
  15939. return c
  15940. }
  15941. // Fields allows partial responses to be retrieved. See
  15942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15943. // for more information.
  15944. func (c *AdvertiserLandingPagesInsertCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesInsertCall {
  15945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15946. return c
  15947. }
  15948. // Context sets the context to be used in this call's Do method. Any
  15949. // pending HTTP request will be aborted if the provided context is
  15950. // canceled.
  15951. func (c *AdvertiserLandingPagesInsertCall) Context(ctx context.Context) *AdvertiserLandingPagesInsertCall {
  15952. c.ctx_ = ctx
  15953. return c
  15954. }
  15955. // Header returns an http.Header that can be modified by the caller to
  15956. // add HTTP headers to the request.
  15957. func (c *AdvertiserLandingPagesInsertCall) Header() http.Header {
  15958. if c.header_ == nil {
  15959. c.header_ = make(http.Header)
  15960. }
  15961. return c.header_
  15962. }
  15963. func (c *AdvertiserLandingPagesInsertCall) doRequest(alt string) (*http.Response, error) {
  15964. reqHeaders := make(http.Header)
  15965. for k, v := range c.header_ {
  15966. reqHeaders[k] = v
  15967. }
  15968. reqHeaders.Set("User-Agent", c.s.userAgent())
  15969. var body io.Reader = nil
  15970. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  15971. if err != nil {
  15972. return nil, err
  15973. }
  15974. reqHeaders.Set("Content-Type", "application/json")
  15975. c.urlParams_.Set("alt", alt)
  15976. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  15977. urls += "?" + c.urlParams_.Encode()
  15978. req, _ := http.NewRequest("POST", urls, body)
  15979. req.Header = reqHeaders
  15980. googleapi.Expand(req.URL, map[string]string{
  15981. "profileId": strconv.FormatInt(c.profileId, 10),
  15982. })
  15983. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15984. }
  15985. // Do executes the "dfareporting.advertiserLandingPages.insert" call.
  15986. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  15987. // status code is an error. Response headers are in either
  15988. // *LandingPage.ServerResponse.Header or (if a response was returned at
  15989. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15990. // to check whether the returned error was because
  15991. // http.StatusNotModified was returned.
  15992. func (c *AdvertiserLandingPagesInsertCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  15993. gensupport.SetOptions(c.urlParams_, opts...)
  15994. res, err := c.doRequest("json")
  15995. if res != nil && res.StatusCode == http.StatusNotModified {
  15996. if res.Body != nil {
  15997. res.Body.Close()
  15998. }
  15999. return nil, &googleapi.Error{
  16000. Code: res.StatusCode,
  16001. Header: res.Header,
  16002. }
  16003. }
  16004. if err != nil {
  16005. return nil, err
  16006. }
  16007. defer googleapi.CloseBody(res)
  16008. if err := googleapi.CheckResponse(res); err != nil {
  16009. return nil, err
  16010. }
  16011. ret := &LandingPage{
  16012. ServerResponse: googleapi.ServerResponse{
  16013. Header: res.Header,
  16014. HTTPStatusCode: res.StatusCode,
  16015. },
  16016. }
  16017. target := &ret
  16018. if err := gensupport.DecodeResponse(target, res); err != nil {
  16019. return nil, err
  16020. }
  16021. return ret, nil
  16022. // {
  16023. // "description": "Inserts a new landing page.",
  16024. // "httpMethod": "POST",
  16025. // "id": "dfareporting.advertiserLandingPages.insert",
  16026. // "parameterOrder": [
  16027. // "profileId"
  16028. // ],
  16029. // "parameters": {
  16030. // "profileId": {
  16031. // "description": "User profile ID associated with this request.",
  16032. // "format": "int64",
  16033. // "location": "path",
  16034. // "required": true,
  16035. // "type": "string"
  16036. // }
  16037. // },
  16038. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16039. // "request": {
  16040. // "$ref": "LandingPage"
  16041. // },
  16042. // "response": {
  16043. // "$ref": "LandingPage"
  16044. // },
  16045. // "scopes": [
  16046. // "https://www.googleapis.com/auth/dfatrafficking"
  16047. // ]
  16048. // }
  16049. }
  16050. // method id "dfareporting.advertiserLandingPages.list":
  16051. type AdvertiserLandingPagesListCall struct {
  16052. s *Service
  16053. profileId int64
  16054. urlParams_ gensupport.URLParams
  16055. ifNoneMatch_ string
  16056. ctx_ context.Context
  16057. header_ http.Header
  16058. }
  16059. // List: Retrieves a list of landing pages.
  16060. func (r *AdvertiserLandingPagesService) List(profileId int64) *AdvertiserLandingPagesListCall {
  16061. c := &AdvertiserLandingPagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16062. c.profileId = profileId
  16063. return c
  16064. }
  16065. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  16066. // only landing pages that belong to these advertisers.
  16067. func (c *AdvertiserLandingPagesListCall) AdvertiserIds(advertiserIds ...int64) *AdvertiserLandingPagesListCall {
  16068. var advertiserIds_ []string
  16069. for _, v := range advertiserIds {
  16070. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  16071. }
  16072. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  16073. return c
  16074. }
  16075. // Archived sets the optional parameter "archived": Select only archived
  16076. // landing pages. Don't set this field to select both archived and
  16077. // non-archived landing pages.
  16078. func (c *AdvertiserLandingPagesListCall) Archived(archived bool) *AdvertiserLandingPagesListCall {
  16079. c.urlParams_.Set("archived", fmt.Sprint(archived))
  16080. return c
  16081. }
  16082. // Ids sets the optional parameter "ids": Select only landing pages with
  16083. // these IDs.
  16084. func (c *AdvertiserLandingPagesListCall) Ids(ids ...int64) *AdvertiserLandingPagesListCall {
  16085. var ids_ []string
  16086. for _, v := range ids {
  16087. ids_ = append(ids_, fmt.Sprint(v))
  16088. }
  16089. c.urlParams_.SetMulti("ids", ids_)
  16090. return c
  16091. }
  16092. // MaxResults sets the optional parameter "maxResults": Maximum number
  16093. // of results to return.
  16094. func (c *AdvertiserLandingPagesListCall) MaxResults(maxResults int64) *AdvertiserLandingPagesListCall {
  16095. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16096. return c
  16097. }
  16098. // PageToken sets the optional parameter "pageToken": Value of the
  16099. // nextPageToken from the previous result page.
  16100. func (c *AdvertiserLandingPagesListCall) PageToken(pageToken string) *AdvertiserLandingPagesListCall {
  16101. c.urlParams_.Set("pageToken", pageToken)
  16102. return c
  16103. }
  16104. // SearchString sets the optional parameter "searchString": Allows
  16105. // searching for landing pages by name or ID. Wildcards (*) are allowed.
  16106. // For example, "landingpage*2017" will return landing pages with names
  16107. // like "landingpage July 2017", "landingpage March 2017", or simply
  16108. // "landingpage 2017". Most of the searches also add wildcards
  16109. // implicitly at the start and the end of the search string. For
  16110. // example, a search string of "landingpage" will match campaigns with
  16111. // name "my landingpage", "landingpage 2015", or simply "landingpage".
  16112. func (c *AdvertiserLandingPagesListCall) SearchString(searchString string) *AdvertiserLandingPagesListCall {
  16113. c.urlParams_.Set("searchString", searchString)
  16114. return c
  16115. }
  16116. // SortField sets the optional parameter "sortField": Field by which to
  16117. // sort the list.
  16118. //
  16119. // Possible values:
  16120. // "ID" (default)
  16121. // "NAME"
  16122. func (c *AdvertiserLandingPagesListCall) SortField(sortField string) *AdvertiserLandingPagesListCall {
  16123. c.urlParams_.Set("sortField", sortField)
  16124. return c
  16125. }
  16126. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  16127. // results.
  16128. //
  16129. // Possible values:
  16130. // "ASCENDING" (default)
  16131. // "DESCENDING"
  16132. func (c *AdvertiserLandingPagesListCall) SortOrder(sortOrder string) *AdvertiserLandingPagesListCall {
  16133. c.urlParams_.Set("sortOrder", sortOrder)
  16134. return c
  16135. }
  16136. // SubaccountId sets the optional parameter "subaccountId": Select only
  16137. // landing pages that belong to this subaccount.
  16138. func (c *AdvertiserLandingPagesListCall) SubaccountId(subaccountId int64) *AdvertiserLandingPagesListCall {
  16139. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  16140. return c
  16141. }
  16142. // Fields allows partial responses to be retrieved. See
  16143. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16144. // for more information.
  16145. func (c *AdvertiserLandingPagesListCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesListCall {
  16146. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16147. return c
  16148. }
  16149. // IfNoneMatch sets the optional parameter which makes the operation
  16150. // fail if the object's ETag matches the given value. This is useful for
  16151. // getting updates only after the object has changed since the last
  16152. // request. Use googleapi.IsNotModified to check whether the response
  16153. // error from Do is the result of In-None-Match.
  16154. func (c *AdvertiserLandingPagesListCall) IfNoneMatch(entityTag string) *AdvertiserLandingPagesListCall {
  16155. c.ifNoneMatch_ = entityTag
  16156. return c
  16157. }
  16158. // Context sets the context to be used in this call's Do method. Any
  16159. // pending HTTP request will be aborted if the provided context is
  16160. // canceled.
  16161. func (c *AdvertiserLandingPagesListCall) Context(ctx context.Context) *AdvertiserLandingPagesListCall {
  16162. c.ctx_ = ctx
  16163. return c
  16164. }
  16165. // Header returns an http.Header that can be modified by the caller to
  16166. // add HTTP headers to the request.
  16167. func (c *AdvertiserLandingPagesListCall) Header() http.Header {
  16168. if c.header_ == nil {
  16169. c.header_ = make(http.Header)
  16170. }
  16171. return c.header_
  16172. }
  16173. func (c *AdvertiserLandingPagesListCall) doRequest(alt string) (*http.Response, error) {
  16174. reqHeaders := make(http.Header)
  16175. for k, v := range c.header_ {
  16176. reqHeaders[k] = v
  16177. }
  16178. reqHeaders.Set("User-Agent", c.s.userAgent())
  16179. if c.ifNoneMatch_ != "" {
  16180. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16181. }
  16182. var body io.Reader = nil
  16183. c.urlParams_.Set("alt", alt)
  16184. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16185. urls += "?" + c.urlParams_.Encode()
  16186. req, _ := http.NewRequest("GET", urls, body)
  16187. req.Header = reqHeaders
  16188. googleapi.Expand(req.URL, map[string]string{
  16189. "profileId": strconv.FormatInt(c.profileId, 10),
  16190. })
  16191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16192. }
  16193. // Do executes the "dfareporting.advertiserLandingPages.list" call.
  16194. // Exactly one of *AdvertiserLandingPagesListResponse or error will be
  16195. // non-nil. Any non-2xx status code is an error. Response headers are in
  16196. // either *AdvertiserLandingPagesListResponse.ServerResponse.Header or
  16197. // (if a response was returned at all) in
  16198. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16199. // whether the returned error was because http.StatusNotModified was
  16200. // returned.
  16201. func (c *AdvertiserLandingPagesListCall) Do(opts ...googleapi.CallOption) (*AdvertiserLandingPagesListResponse, error) {
  16202. gensupport.SetOptions(c.urlParams_, opts...)
  16203. res, err := c.doRequest("json")
  16204. if res != nil && res.StatusCode == http.StatusNotModified {
  16205. if res.Body != nil {
  16206. res.Body.Close()
  16207. }
  16208. return nil, &googleapi.Error{
  16209. Code: res.StatusCode,
  16210. Header: res.Header,
  16211. }
  16212. }
  16213. if err != nil {
  16214. return nil, err
  16215. }
  16216. defer googleapi.CloseBody(res)
  16217. if err := googleapi.CheckResponse(res); err != nil {
  16218. return nil, err
  16219. }
  16220. ret := &AdvertiserLandingPagesListResponse{
  16221. ServerResponse: googleapi.ServerResponse{
  16222. Header: res.Header,
  16223. HTTPStatusCode: res.StatusCode,
  16224. },
  16225. }
  16226. target := &ret
  16227. if err := gensupport.DecodeResponse(target, res); err != nil {
  16228. return nil, err
  16229. }
  16230. return ret, nil
  16231. // {
  16232. // "description": "Retrieves a list of landing pages.",
  16233. // "httpMethod": "GET",
  16234. // "id": "dfareporting.advertiserLandingPages.list",
  16235. // "parameterOrder": [
  16236. // "profileId"
  16237. // ],
  16238. // "parameters": {
  16239. // "advertiserIds": {
  16240. // "description": "Select only landing pages that belong to these advertisers.",
  16241. // "format": "int64",
  16242. // "location": "query",
  16243. // "repeated": true,
  16244. // "type": "string"
  16245. // },
  16246. // "archived": {
  16247. // "description": "Select only archived landing pages. Don't set this field to select both archived and non-archived landing pages.",
  16248. // "location": "query",
  16249. // "type": "boolean"
  16250. // },
  16251. // "ids": {
  16252. // "description": "Select only landing pages with these IDs.",
  16253. // "format": "int64",
  16254. // "location": "query",
  16255. // "repeated": true,
  16256. // "type": "string"
  16257. // },
  16258. // "maxResults": {
  16259. // "default": "1000",
  16260. // "description": "Maximum number of results to return.",
  16261. // "format": "int32",
  16262. // "location": "query",
  16263. // "maximum": "1000",
  16264. // "minimum": "0",
  16265. // "type": "integer"
  16266. // },
  16267. // "pageToken": {
  16268. // "description": "Value of the nextPageToken from the previous result page.",
  16269. // "location": "query",
  16270. // "type": "string"
  16271. // },
  16272. // "profileId": {
  16273. // "description": "User profile ID associated with this request.",
  16274. // "format": "int64",
  16275. // "location": "path",
  16276. // "required": true,
  16277. // "type": "string"
  16278. // },
  16279. // "searchString": {
  16280. // "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\".",
  16281. // "location": "query",
  16282. // "type": "string"
  16283. // },
  16284. // "sortField": {
  16285. // "default": "ID",
  16286. // "description": "Field by which to sort the list.",
  16287. // "enum": [
  16288. // "ID",
  16289. // "NAME"
  16290. // ],
  16291. // "enumDescriptions": [
  16292. // "",
  16293. // ""
  16294. // ],
  16295. // "location": "query",
  16296. // "type": "string"
  16297. // },
  16298. // "sortOrder": {
  16299. // "default": "ASCENDING",
  16300. // "description": "Order of sorted results.",
  16301. // "enum": [
  16302. // "ASCENDING",
  16303. // "DESCENDING"
  16304. // ],
  16305. // "enumDescriptions": [
  16306. // "",
  16307. // ""
  16308. // ],
  16309. // "location": "query",
  16310. // "type": "string"
  16311. // },
  16312. // "subaccountId": {
  16313. // "description": "Select only landing pages that belong to this subaccount.",
  16314. // "format": "int64",
  16315. // "location": "query",
  16316. // "type": "string"
  16317. // }
  16318. // },
  16319. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16320. // "response": {
  16321. // "$ref": "AdvertiserLandingPagesListResponse"
  16322. // },
  16323. // "scopes": [
  16324. // "https://www.googleapis.com/auth/dfatrafficking"
  16325. // ]
  16326. // }
  16327. }
  16328. // Pages invokes f for each page of results.
  16329. // A non-nil error returned from f will halt the iteration.
  16330. // The provided context supersedes any context provided to the Context method.
  16331. func (c *AdvertiserLandingPagesListCall) Pages(ctx context.Context, f func(*AdvertiserLandingPagesListResponse) error) error {
  16332. c.ctx_ = ctx
  16333. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16334. for {
  16335. x, err := c.Do()
  16336. if err != nil {
  16337. return err
  16338. }
  16339. if err := f(x); err != nil {
  16340. return err
  16341. }
  16342. if x.NextPageToken == "" {
  16343. return nil
  16344. }
  16345. c.PageToken(x.NextPageToken)
  16346. }
  16347. }
  16348. // method id "dfareporting.advertiserLandingPages.patch":
  16349. type AdvertiserLandingPagesPatchCall struct {
  16350. s *Service
  16351. profileId int64
  16352. landingpage *LandingPage
  16353. urlParams_ gensupport.URLParams
  16354. ctx_ context.Context
  16355. header_ http.Header
  16356. }
  16357. // Patch: Updates an existing landing page. This method supports patch
  16358. // semantics.
  16359. func (r *AdvertiserLandingPagesService) Patch(profileId int64, id int64, landingpage *LandingPage) *AdvertiserLandingPagesPatchCall {
  16360. c := &AdvertiserLandingPagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16361. c.profileId = profileId
  16362. c.urlParams_.Set("id", fmt.Sprint(id))
  16363. c.landingpage = landingpage
  16364. return c
  16365. }
  16366. // Fields allows partial responses to be retrieved. See
  16367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16368. // for more information.
  16369. func (c *AdvertiserLandingPagesPatchCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesPatchCall {
  16370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16371. return c
  16372. }
  16373. // Context sets the context to be used in this call's Do method. Any
  16374. // pending HTTP request will be aborted if the provided context is
  16375. // canceled.
  16376. func (c *AdvertiserLandingPagesPatchCall) Context(ctx context.Context) *AdvertiserLandingPagesPatchCall {
  16377. c.ctx_ = ctx
  16378. return c
  16379. }
  16380. // Header returns an http.Header that can be modified by the caller to
  16381. // add HTTP headers to the request.
  16382. func (c *AdvertiserLandingPagesPatchCall) Header() http.Header {
  16383. if c.header_ == nil {
  16384. c.header_ = make(http.Header)
  16385. }
  16386. return c.header_
  16387. }
  16388. func (c *AdvertiserLandingPagesPatchCall) doRequest(alt string) (*http.Response, error) {
  16389. reqHeaders := make(http.Header)
  16390. for k, v := range c.header_ {
  16391. reqHeaders[k] = v
  16392. }
  16393. reqHeaders.Set("User-Agent", c.s.userAgent())
  16394. var body io.Reader = nil
  16395. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16396. if err != nil {
  16397. return nil, err
  16398. }
  16399. reqHeaders.Set("Content-Type", "application/json")
  16400. c.urlParams_.Set("alt", alt)
  16401. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16402. urls += "?" + c.urlParams_.Encode()
  16403. req, _ := http.NewRequest("PATCH", urls, body)
  16404. req.Header = reqHeaders
  16405. googleapi.Expand(req.URL, map[string]string{
  16406. "profileId": strconv.FormatInt(c.profileId, 10),
  16407. })
  16408. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16409. }
  16410. // Do executes the "dfareporting.advertiserLandingPages.patch" call.
  16411. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16412. // status code is an error. Response headers are in either
  16413. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16414. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16415. // to check whether the returned error was because
  16416. // http.StatusNotModified was returned.
  16417. func (c *AdvertiserLandingPagesPatchCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16418. gensupport.SetOptions(c.urlParams_, opts...)
  16419. res, err := c.doRequest("json")
  16420. if res != nil && res.StatusCode == http.StatusNotModified {
  16421. if res.Body != nil {
  16422. res.Body.Close()
  16423. }
  16424. return nil, &googleapi.Error{
  16425. Code: res.StatusCode,
  16426. Header: res.Header,
  16427. }
  16428. }
  16429. if err != nil {
  16430. return nil, err
  16431. }
  16432. defer googleapi.CloseBody(res)
  16433. if err := googleapi.CheckResponse(res); err != nil {
  16434. return nil, err
  16435. }
  16436. ret := &LandingPage{
  16437. ServerResponse: googleapi.ServerResponse{
  16438. Header: res.Header,
  16439. HTTPStatusCode: res.StatusCode,
  16440. },
  16441. }
  16442. target := &ret
  16443. if err := gensupport.DecodeResponse(target, res); err != nil {
  16444. return nil, err
  16445. }
  16446. return ret, nil
  16447. // {
  16448. // "description": "Updates an existing landing page. This method supports patch semantics.",
  16449. // "httpMethod": "PATCH",
  16450. // "id": "dfareporting.advertiserLandingPages.patch",
  16451. // "parameterOrder": [
  16452. // "profileId",
  16453. // "id"
  16454. // ],
  16455. // "parameters": {
  16456. // "id": {
  16457. // "description": "Landing page ID.",
  16458. // "format": "int64",
  16459. // "location": "query",
  16460. // "required": true,
  16461. // "type": "string"
  16462. // },
  16463. // "profileId": {
  16464. // "description": "User profile ID associated with this request.",
  16465. // "format": "int64",
  16466. // "location": "path",
  16467. // "required": true,
  16468. // "type": "string"
  16469. // }
  16470. // },
  16471. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16472. // "request": {
  16473. // "$ref": "LandingPage"
  16474. // },
  16475. // "response": {
  16476. // "$ref": "LandingPage"
  16477. // },
  16478. // "scopes": [
  16479. // "https://www.googleapis.com/auth/dfatrafficking"
  16480. // ]
  16481. // }
  16482. }
  16483. // method id "dfareporting.advertiserLandingPages.update":
  16484. type AdvertiserLandingPagesUpdateCall struct {
  16485. s *Service
  16486. profileId int64
  16487. landingpage *LandingPage
  16488. urlParams_ gensupport.URLParams
  16489. ctx_ context.Context
  16490. header_ http.Header
  16491. }
  16492. // Update: Updates an existing landing page.
  16493. func (r *AdvertiserLandingPagesService) Update(profileId int64, landingpage *LandingPage) *AdvertiserLandingPagesUpdateCall {
  16494. c := &AdvertiserLandingPagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16495. c.profileId = profileId
  16496. c.landingpage = landingpage
  16497. return c
  16498. }
  16499. // Fields allows partial responses to be retrieved. See
  16500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16501. // for more information.
  16502. func (c *AdvertiserLandingPagesUpdateCall) Fields(s ...googleapi.Field) *AdvertiserLandingPagesUpdateCall {
  16503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16504. return c
  16505. }
  16506. // Context sets the context to be used in this call's Do method. Any
  16507. // pending HTTP request will be aborted if the provided context is
  16508. // canceled.
  16509. func (c *AdvertiserLandingPagesUpdateCall) Context(ctx context.Context) *AdvertiserLandingPagesUpdateCall {
  16510. c.ctx_ = ctx
  16511. return c
  16512. }
  16513. // Header returns an http.Header that can be modified by the caller to
  16514. // add HTTP headers to the request.
  16515. func (c *AdvertiserLandingPagesUpdateCall) Header() http.Header {
  16516. if c.header_ == nil {
  16517. c.header_ = make(http.Header)
  16518. }
  16519. return c.header_
  16520. }
  16521. func (c *AdvertiserLandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  16522. reqHeaders := make(http.Header)
  16523. for k, v := range c.header_ {
  16524. reqHeaders[k] = v
  16525. }
  16526. reqHeaders.Set("User-Agent", c.s.userAgent())
  16527. var body io.Reader = nil
  16528. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  16529. if err != nil {
  16530. return nil, err
  16531. }
  16532. reqHeaders.Set("Content-Type", "application/json")
  16533. c.urlParams_.Set("alt", alt)
  16534. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserLandingPages")
  16535. urls += "?" + c.urlParams_.Encode()
  16536. req, _ := http.NewRequest("PUT", urls, body)
  16537. req.Header = reqHeaders
  16538. googleapi.Expand(req.URL, map[string]string{
  16539. "profileId": strconv.FormatInt(c.profileId, 10),
  16540. })
  16541. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16542. }
  16543. // Do executes the "dfareporting.advertiserLandingPages.update" call.
  16544. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  16545. // status code is an error. Response headers are in either
  16546. // *LandingPage.ServerResponse.Header or (if a response was returned at
  16547. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16548. // to check whether the returned error was because
  16549. // http.StatusNotModified was returned.
  16550. func (c *AdvertiserLandingPagesUpdateCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  16551. gensupport.SetOptions(c.urlParams_, opts...)
  16552. res, err := c.doRequest("json")
  16553. if res != nil && res.StatusCode == http.StatusNotModified {
  16554. if res.Body != nil {
  16555. res.Body.Close()
  16556. }
  16557. return nil, &googleapi.Error{
  16558. Code: res.StatusCode,
  16559. Header: res.Header,
  16560. }
  16561. }
  16562. if err != nil {
  16563. return nil, err
  16564. }
  16565. defer googleapi.CloseBody(res)
  16566. if err := googleapi.CheckResponse(res); err != nil {
  16567. return nil, err
  16568. }
  16569. ret := &LandingPage{
  16570. ServerResponse: googleapi.ServerResponse{
  16571. Header: res.Header,
  16572. HTTPStatusCode: res.StatusCode,
  16573. },
  16574. }
  16575. target := &ret
  16576. if err := gensupport.DecodeResponse(target, res); err != nil {
  16577. return nil, err
  16578. }
  16579. return ret, nil
  16580. // {
  16581. // "description": "Updates an existing landing page.",
  16582. // "httpMethod": "PUT",
  16583. // "id": "dfareporting.advertiserLandingPages.update",
  16584. // "parameterOrder": [
  16585. // "profileId"
  16586. // ],
  16587. // "parameters": {
  16588. // "profileId": {
  16589. // "description": "User profile ID associated with this request.",
  16590. // "format": "int64",
  16591. // "location": "path",
  16592. // "required": true,
  16593. // "type": "string"
  16594. // }
  16595. // },
  16596. // "path": "userprofiles/{profileId}/advertiserLandingPages",
  16597. // "request": {
  16598. // "$ref": "LandingPage"
  16599. // },
  16600. // "response": {
  16601. // "$ref": "LandingPage"
  16602. // },
  16603. // "scopes": [
  16604. // "https://www.googleapis.com/auth/dfatrafficking"
  16605. // ]
  16606. // }
  16607. }
  16608. // method id "dfareporting.advertisers.get":
  16609. type AdvertisersGetCall struct {
  16610. s *Service
  16611. profileId int64
  16612. id int64
  16613. urlParams_ gensupport.URLParams
  16614. ifNoneMatch_ string
  16615. ctx_ context.Context
  16616. header_ http.Header
  16617. }
  16618. // Get: Gets one advertiser by ID.
  16619. func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall {
  16620. c := &AdvertisersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16621. c.profileId = profileId
  16622. c.id = id
  16623. return c
  16624. }
  16625. // Fields allows partial responses to be retrieved. See
  16626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16627. // for more information.
  16628. func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall {
  16629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16630. return c
  16631. }
  16632. // IfNoneMatch sets the optional parameter which makes the operation
  16633. // fail if the object's ETag matches the given value. This is useful for
  16634. // getting updates only after the object has changed since the last
  16635. // request. Use googleapi.IsNotModified to check whether the response
  16636. // error from Do is the result of In-None-Match.
  16637. func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall {
  16638. c.ifNoneMatch_ = entityTag
  16639. return c
  16640. }
  16641. // Context sets the context to be used in this call's Do method. Any
  16642. // pending HTTP request will be aborted if the provided context is
  16643. // canceled.
  16644. func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall {
  16645. c.ctx_ = ctx
  16646. return c
  16647. }
  16648. // Header returns an http.Header that can be modified by the caller to
  16649. // add HTTP headers to the request.
  16650. func (c *AdvertisersGetCall) Header() http.Header {
  16651. if c.header_ == nil {
  16652. c.header_ = make(http.Header)
  16653. }
  16654. return c.header_
  16655. }
  16656. func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) {
  16657. reqHeaders := make(http.Header)
  16658. for k, v := range c.header_ {
  16659. reqHeaders[k] = v
  16660. }
  16661. reqHeaders.Set("User-Agent", c.s.userAgent())
  16662. if c.ifNoneMatch_ != "" {
  16663. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16664. }
  16665. var body io.Reader = nil
  16666. c.urlParams_.Set("alt", alt)
  16667. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}")
  16668. urls += "?" + c.urlParams_.Encode()
  16669. req, _ := http.NewRequest("GET", urls, body)
  16670. req.Header = reqHeaders
  16671. googleapi.Expand(req.URL, map[string]string{
  16672. "profileId": strconv.FormatInt(c.profileId, 10),
  16673. "id": strconv.FormatInt(c.id, 10),
  16674. })
  16675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16676. }
  16677. // Do executes the "dfareporting.advertisers.get" call.
  16678. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  16679. // status code is an error. Response headers are in either
  16680. // *Advertiser.ServerResponse.Header or (if a response was returned at
  16681. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16682. // to check whether the returned error was because
  16683. // http.StatusNotModified was returned.
  16684. func (c *AdvertisersGetCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  16685. gensupport.SetOptions(c.urlParams_, opts...)
  16686. res, err := c.doRequest("json")
  16687. if res != nil && res.StatusCode == http.StatusNotModified {
  16688. if res.Body != nil {
  16689. res.Body.Close()
  16690. }
  16691. return nil, &googleapi.Error{
  16692. Code: res.StatusCode,
  16693. Header: res.Header,
  16694. }
  16695. }
  16696. if err != nil {
  16697. return nil, err
  16698. }
  16699. defer googleapi.CloseBody(res)
  16700. if err := googleapi.CheckResponse(res); err != nil {
  16701. return nil, err
  16702. }
  16703. ret := &Advertiser{
  16704. ServerResponse: googleapi.ServerResponse{
  16705. Header: res.Header,
  16706. HTTPStatusCode: res.StatusCode,
  16707. },
  16708. }
  16709. target := &ret
  16710. if err := gensupport.DecodeResponse(target, res); err != nil {
  16711. return nil, err
  16712. }
  16713. return ret, nil
  16714. // {
  16715. // "description": "Gets one advertiser by ID.",
  16716. // "httpMethod": "GET",
  16717. // "id": "dfareporting.advertisers.get",
  16718. // "parameterOrder": [
  16719. // "profileId",
  16720. // "id"
  16721. // ],
  16722. // "parameters": {
  16723. // "id": {
  16724. // "description": "Advertiser ID.",
  16725. // "format": "int64",
  16726. // "location": "path",
  16727. // "required": true,
  16728. // "type": "string"
  16729. // },
  16730. // "profileId": {
  16731. // "description": "User profile ID associated with this request.",
  16732. // "format": "int64",
  16733. // "location": "path",
  16734. // "required": true,
  16735. // "type": "string"
  16736. // }
  16737. // },
  16738. // "path": "userprofiles/{profileId}/advertisers/{id}",
  16739. // "response": {
  16740. // "$ref": "Advertiser"
  16741. // },
  16742. // "scopes": [
  16743. // "https://www.googleapis.com/auth/dfatrafficking"
  16744. // ]
  16745. // }
  16746. }
  16747. // method id "dfareporting.advertisers.insert":
  16748. type AdvertisersInsertCall struct {
  16749. s *Service
  16750. profileId int64
  16751. advertiser *Advertiser
  16752. urlParams_ gensupport.URLParams
  16753. ctx_ context.Context
  16754. header_ http.Header
  16755. }
  16756. // Insert: Inserts a new advertiser.
  16757. func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall {
  16758. c := &AdvertisersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16759. c.profileId = profileId
  16760. c.advertiser = advertiser
  16761. return c
  16762. }
  16763. // Fields allows partial responses to be retrieved. See
  16764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16765. // for more information.
  16766. func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall {
  16767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16768. return c
  16769. }
  16770. // Context sets the context to be used in this call's Do method. Any
  16771. // pending HTTP request will be aborted if the provided context is
  16772. // canceled.
  16773. func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall {
  16774. c.ctx_ = ctx
  16775. return c
  16776. }
  16777. // Header returns an http.Header that can be modified by the caller to
  16778. // add HTTP headers to the request.
  16779. func (c *AdvertisersInsertCall) Header() http.Header {
  16780. if c.header_ == nil {
  16781. c.header_ = make(http.Header)
  16782. }
  16783. return c.header_
  16784. }
  16785. func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) {
  16786. reqHeaders := make(http.Header)
  16787. for k, v := range c.header_ {
  16788. reqHeaders[k] = v
  16789. }
  16790. reqHeaders.Set("User-Agent", c.s.userAgent())
  16791. var body io.Reader = nil
  16792. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  16793. if err != nil {
  16794. return nil, err
  16795. }
  16796. reqHeaders.Set("Content-Type", "application/json")
  16797. c.urlParams_.Set("alt", alt)
  16798. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  16799. urls += "?" + c.urlParams_.Encode()
  16800. req, _ := http.NewRequest("POST", urls, body)
  16801. req.Header = reqHeaders
  16802. googleapi.Expand(req.URL, map[string]string{
  16803. "profileId": strconv.FormatInt(c.profileId, 10),
  16804. })
  16805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16806. }
  16807. // Do executes the "dfareporting.advertisers.insert" call.
  16808. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  16809. // status code is an error. Response headers are in either
  16810. // *Advertiser.ServerResponse.Header or (if a response was returned at
  16811. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16812. // to check whether the returned error was because
  16813. // http.StatusNotModified was returned.
  16814. func (c *AdvertisersInsertCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  16815. gensupport.SetOptions(c.urlParams_, opts...)
  16816. res, err := c.doRequest("json")
  16817. if res != nil && res.StatusCode == http.StatusNotModified {
  16818. if res.Body != nil {
  16819. res.Body.Close()
  16820. }
  16821. return nil, &googleapi.Error{
  16822. Code: res.StatusCode,
  16823. Header: res.Header,
  16824. }
  16825. }
  16826. if err != nil {
  16827. return nil, err
  16828. }
  16829. defer googleapi.CloseBody(res)
  16830. if err := googleapi.CheckResponse(res); err != nil {
  16831. return nil, err
  16832. }
  16833. ret := &Advertiser{
  16834. ServerResponse: googleapi.ServerResponse{
  16835. Header: res.Header,
  16836. HTTPStatusCode: res.StatusCode,
  16837. },
  16838. }
  16839. target := &ret
  16840. if err := gensupport.DecodeResponse(target, res); err != nil {
  16841. return nil, err
  16842. }
  16843. return ret, nil
  16844. // {
  16845. // "description": "Inserts a new advertiser.",
  16846. // "httpMethod": "POST",
  16847. // "id": "dfareporting.advertisers.insert",
  16848. // "parameterOrder": [
  16849. // "profileId"
  16850. // ],
  16851. // "parameters": {
  16852. // "profileId": {
  16853. // "description": "User profile ID associated with this request.",
  16854. // "format": "int64",
  16855. // "location": "path",
  16856. // "required": true,
  16857. // "type": "string"
  16858. // }
  16859. // },
  16860. // "path": "userprofiles/{profileId}/advertisers",
  16861. // "request": {
  16862. // "$ref": "Advertiser"
  16863. // },
  16864. // "response": {
  16865. // "$ref": "Advertiser"
  16866. // },
  16867. // "scopes": [
  16868. // "https://www.googleapis.com/auth/dfatrafficking"
  16869. // ]
  16870. // }
  16871. }
  16872. // method id "dfareporting.advertisers.list":
  16873. type AdvertisersListCall struct {
  16874. s *Service
  16875. profileId int64
  16876. urlParams_ gensupport.URLParams
  16877. ifNoneMatch_ string
  16878. ctx_ context.Context
  16879. header_ http.Header
  16880. }
  16881. // List: Retrieves a list of advertisers, possibly filtered. This method
  16882. // supports paging.
  16883. func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall {
  16884. c := &AdvertisersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16885. c.profileId = profileId
  16886. return c
  16887. }
  16888. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  16889. // Select only advertisers with these advertiser group IDs.
  16890. func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *AdvertisersListCall {
  16891. var advertiserGroupIds_ []string
  16892. for _, v := range advertiserGroupIds {
  16893. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  16894. }
  16895. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  16896. return c
  16897. }
  16898. // FloodlightConfigurationIds sets the optional parameter
  16899. // "floodlightConfigurationIds": Select only advertisers with these
  16900. // floodlight configuration IDs.
  16901. func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds ...int64) *AdvertisersListCall {
  16902. var floodlightConfigurationIds_ []string
  16903. for _, v := range floodlightConfigurationIds {
  16904. floodlightConfigurationIds_ = append(floodlightConfigurationIds_, fmt.Sprint(v))
  16905. }
  16906. c.urlParams_.SetMulti("floodlightConfigurationIds", floodlightConfigurationIds_)
  16907. return c
  16908. }
  16909. // Ids sets the optional parameter "ids": Select only advertisers with
  16910. // these IDs.
  16911. func (c *AdvertisersListCall) Ids(ids ...int64) *AdvertisersListCall {
  16912. var ids_ []string
  16913. for _, v := range ids {
  16914. ids_ = append(ids_, fmt.Sprint(v))
  16915. }
  16916. c.urlParams_.SetMulti("ids", ids_)
  16917. return c
  16918. }
  16919. // IncludeAdvertisersWithoutGroupsOnly sets the optional parameter
  16920. // "includeAdvertisersWithoutGroupsOnly": Select only advertisers which
  16921. // do not belong to any advertiser group.
  16922. func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall {
  16923. c.urlParams_.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprint(includeAdvertisersWithoutGroupsOnly))
  16924. return c
  16925. }
  16926. // MaxResults sets the optional parameter "maxResults": Maximum number
  16927. // of results to return.
  16928. func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall {
  16929. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16930. return c
  16931. }
  16932. // OnlyParent sets the optional parameter "onlyParent": Select only
  16933. // advertisers which use another advertiser's floodlight configuration.
  16934. func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall {
  16935. c.urlParams_.Set("onlyParent", fmt.Sprint(onlyParent))
  16936. return c
  16937. }
  16938. // PageToken sets the optional parameter "pageToken": Value of the
  16939. // nextPageToken from the previous result page.
  16940. func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall {
  16941. c.urlParams_.Set("pageToken", pageToken)
  16942. return c
  16943. }
  16944. // SearchString sets the optional parameter "searchString": Allows
  16945. // searching for objects by name or ID. Wildcards (*) are allowed. For
  16946. // example, "advertiser*2015" will return objects with names like
  16947. // "advertiser June 2015", "advertiser April 2015", or simply
  16948. // "advertiser 2015". Most of the searches also add wildcards implicitly
  16949. // at the start and the end of the search string. For example, a search
  16950. // string of "advertiser" will match objects with name "my advertiser",
  16951. // "advertiser 2015", or simply "advertiser".
  16952. func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall {
  16953. c.urlParams_.Set("searchString", searchString)
  16954. return c
  16955. }
  16956. // SortField sets the optional parameter "sortField": Field by which to
  16957. // sort the list.
  16958. //
  16959. // Possible values:
  16960. // "ID" (default)
  16961. // "NAME"
  16962. func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall {
  16963. c.urlParams_.Set("sortField", sortField)
  16964. return c
  16965. }
  16966. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  16967. // results.
  16968. //
  16969. // Possible values:
  16970. // "ASCENDING" (default)
  16971. // "DESCENDING"
  16972. func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall {
  16973. c.urlParams_.Set("sortOrder", sortOrder)
  16974. return c
  16975. }
  16976. // Status sets the optional parameter "status": Select only advertisers
  16977. // with the specified status.
  16978. //
  16979. // Possible values:
  16980. // "APPROVED"
  16981. // "ON_HOLD"
  16982. func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall {
  16983. c.urlParams_.Set("status", status)
  16984. return c
  16985. }
  16986. // SubaccountId sets the optional parameter "subaccountId": Select only
  16987. // advertisers with these subaccount IDs.
  16988. func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall {
  16989. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  16990. return c
  16991. }
  16992. // Fields allows partial responses to be retrieved. See
  16993. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16994. // for more information.
  16995. func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall {
  16996. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16997. return c
  16998. }
  16999. // IfNoneMatch sets the optional parameter which makes the operation
  17000. // fail if the object's ETag matches the given value. This is useful for
  17001. // getting updates only after the object has changed since the last
  17002. // request. Use googleapi.IsNotModified to check whether the response
  17003. // error from Do is the result of In-None-Match.
  17004. func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall {
  17005. c.ifNoneMatch_ = entityTag
  17006. return c
  17007. }
  17008. // Context sets the context to be used in this call's Do method. Any
  17009. // pending HTTP request will be aborted if the provided context is
  17010. // canceled.
  17011. func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall {
  17012. c.ctx_ = ctx
  17013. return c
  17014. }
  17015. // Header returns an http.Header that can be modified by the caller to
  17016. // add HTTP headers to the request.
  17017. func (c *AdvertisersListCall) Header() http.Header {
  17018. if c.header_ == nil {
  17019. c.header_ = make(http.Header)
  17020. }
  17021. return c.header_
  17022. }
  17023. func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) {
  17024. reqHeaders := make(http.Header)
  17025. for k, v := range c.header_ {
  17026. reqHeaders[k] = v
  17027. }
  17028. reqHeaders.Set("User-Agent", c.s.userAgent())
  17029. if c.ifNoneMatch_ != "" {
  17030. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17031. }
  17032. var body io.Reader = nil
  17033. c.urlParams_.Set("alt", alt)
  17034. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17035. urls += "?" + c.urlParams_.Encode()
  17036. req, _ := http.NewRequest("GET", urls, body)
  17037. req.Header = reqHeaders
  17038. googleapi.Expand(req.URL, map[string]string{
  17039. "profileId": strconv.FormatInt(c.profileId, 10),
  17040. })
  17041. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17042. }
  17043. // Do executes the "dfareporting.advertisers.list" call.
  17044. // Exactly one of *AdvertisersListResponse or error will be non-nil. Any
  17045. // non-2xx status code is an error. Response headers are in either
  17046. // *AdvertisersListResponse.ServerResponse.Header or (if a response was
  17047. // returned at all) in error.(*googleapi.Error).Header. Use
  17048. // googleapi.IsNotModified to check whether the returned error was
  17049. // because http.StatusNotModified was returned.
  17050. func (c *AdvertisersListCall) Do(opts ...googleapi.CallOption) (*AdvertisersListResponse, error) {
  17051. gensupport.SetOptions(c.urlParams_, opts...)
  17052. res, err := c.doRequest("json")
  17053. if res != nil && res.StatusCode == http.StatusNotModified {
  17054. if res.Body != nil {
  17055. res.Body.Close()
  17056. }
  17057. return nil, &googleapi.Error{
  17058. Code: res.StatusCode,
  17059. Header: res.Header,
  17060. }
  17061. }
  17062. if err != nil {
  17063. return nil, err
  17064. }
  17065. defer googleapi.CloseBody(res)
  17066. if err := googleapi.CheckResponse(res); err != nil {
  17067. return nil, err
  17068. }
  17069. ret := &AdvertisersListResponse{
  17070. ServerResponse: googleapi.ServerResponse{
  17071. Header: res.Header,
  17072. HTTPStatusCode: res.StatusCode,
  17073. },
  17074. }
  17075. target := &ret
  17076. if err := gensupport.DecodeResponse(target, res); err != nil {
  17077. return nil, err
  17078. }
  17079. return ret, nil
  17080. // {
  17081. // "description": "Retrieves a list of advertisers, possibly filtered. This method supports paging.",
  17082. // "httpMethod": "GET",
  17083. // "id": "dfareporting.advertisers.list",
  17084. // "parameterOrder": [
  17085. // "profileId"
  17086. // ],
  17087. // "parameters": {
  17088. // "advertiserGroupIds": {
  17089. // "description": "Select only advertisers with these advertiser group IDs.",
  17090. // "format": "int64",
  17091. // "location": "query",
  17092. // "repeated": true,
  17093. // "type": "string"
  17094. // },
  17095. // "floodlightConfigurationIds": {
  17096. // "description": "Select only advertisers with these floodlight configuration IDs.",
  17097. // "format": "int64",
  17098. // "location": "query",
  17099. // "repeated": true,
  17100. // "type": "string"
  17101. // },
  17102. // "ids": {
  17103. // "description": "Select only advertisers with these IDs.",
  17104. // "format": "int64",
  17105. // "location": "query",
  17106. // "repeated": true,
  17107. // "type": "string"
  17108. // },
  17109. // "includeAdvertisersWithoutGroupsOnly": {
  17110. // "description": "Select only advertisers which do not belong to any advertiser group.",
  17111. // "location": "query",
  17112. // "type": "boolean"
  17113. // },
  17114. // "maxResults": {
  17115. // "default": "1000",
  17116. // "description": "Maximum number of results to return.",
  17117. // "format": "int32",
  17118. // "location": "query",
  17119. // "maximum": "1000",
  17120. // "minimum": "0",
  17121. // "type": "integer"
  17122. // },
  17123. // "onlyParent": {
  17124. // "description": "Select only advertisers which use another advertiser's floodlight configuration.",
  17125. // "location": "query",
  17126. // "type": "boolean"
  17127. // },
  17128. // "pageToken": {
  17129. // "description": "Value of the nextPageToken from the previous result page.",
  17130. // "location": "query",
  17131. // "type": "string"
  17132. // },
  17133. // "profileId": {
  17134. // "description": "User profile ID associated with this request.",
  17135. // "format": "int64",
  17136. // "location": "path",
  17137. // "required": true,
  17138. // "type": "string"
  17139. // },
  17140. // "searchString": {
  17141. // "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\".",
  17142. // "location": "query",
  17143. // "type": "string"
  17144. // },
  17145. // "sortField": {
  17146. // "default": "ID",
  17147. // "description": "Field by which to sort the list.",
  17148. // "enum": [
  17149. // "ID",
  17150. // "NAME"
  17151. // ],
  17152. // "enumDescriptions": [
  17153. // "",
  17154. // ""
  17155. // ],
  17156. // "location": "query",
  17157. // "type": "string"
  17158. // },
  17159. // "sortOrder": {
  17160. // "default": "ASCENDING",
  17161. // "description": "Order of sorted results.",
  17162. // "enum": [
  17163. // "ASCENDING",
  17164. // "DESCENDING"
  17165. // ],
  17166. // "enumDescriptions": [
  17167. // "",
  17168. // ""
  17169. // ],
  17170. // "location": "query",
  17171. // "type": "string"
  17172. // },
  17173. // "status": {
  17174. // "description": "Select only advertisers with the specified status.",
  17175. // "enum": [
  17176. // "APPROVED",
  17177. // "ON_HOLD"
  17178. // ],
  17179. // "enumDescriptions": [
  17180. // "",
  17181. // ""
  17182. // ],
  17183. // "location": "query",
  17184. // "type": "string"
  17185. // },
  17186. // "subaccountId": {
  17187. // "description": "Select only advertisers with these subaccount IDs.",
  17188. // "format": "int64",
  17189. // "location": "query",
  17190. // "type": "string"
  17191. // }
  17192. // },
  17193. // "path": "userprofiles/{profileId}/advertisers",
  17194. // "response": {
  17195. // "$ref": "AdvertisersListResponse"
  17196. // },
  17197. // "scopes": [
  17198. // "https://www.googleapis.com/auth/dfatrafficking"
  17199. // ]
  17200. // }
  17201. }
  17202. // Pages invokes f for each page of results.
  17203. // A non-nil error returned from f will halt the iteration.
  17204. // The provided context supersedes any context provided to the Context method.
  17205. func (c *AdvertisersListCall) Pages(ctx context.Context, f func(*AdvertisersListResponse) error) error {
  17206. c.ctx_ = ctx
  17207. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17208. for {
  17209. x, err := c.Do()
  17210. if err != nil {
  17211. return err
  17212. }
  17213. if err := f(x); err != nil {
  17214. return err
  17215. }
  17216. if x.NextPageToken == "" {
  17217. return nil
  17218. }
  17219. c.PageToken(x.NextPageToken)
  17220. }
  17221. }
  17222. // method id "dfareporting.advertisers.patch":
  17223. type AdvertisersPatchCall struct {
  17224. s *Service
  17225. profileId int64
  17226. advertiser *Advertiser
  17227. urlParams_ gensupport.URLParams
  17228. ctx_ context.Context
  17229. header_ http.Header
  17230. }
  17231. // Patch: Updates an existing advertiser. This method supports patch
  17232. // semantics.
  17233. func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall {
  17234. c := &AdvertisersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17235. c.profileId = profileId
  17236. c.urlParams_.Set("id", fmt.Sprint(id))
  17237. c.advertiser = advertiser
  17238. return c
  17239. }
  17240. // Fields allows partial responses to be retrieved. See
  17241. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17242. // for more information.
  17243. func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall {
  17244. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17245. return c
  17246. }
  17247. // Context sets the context to be used in this call's Do method. Any
  17248. // pending HTTP request will be aborted if the provided context is
  17249. // canceled.
  17250. func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall {
  17251. c.ctx_ = ctx
  17252. return c
  17253. }
  17254. // Header returns an http.Header that can be modified by the caller to
  17255. // add HTTP headers to the request.
  17256. func (c *AdvertisersPatchCall) Header() http.Header {
  17257. if c.header_ == nil {
  17258. c.header_ = make(http.Header)
  17259. }
  17260. return c.header_
  17261. }
  17262. func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) {
  17263. reqHeaders := make(http.Header)
  17264. for k, v := range c.header_ {
  17265. reqHeaders[k] = v
  17266. }
  17267. reqHeaders.Set("User-Agent", c.s.userAgent())
  17268. var body io.Reader = nil
  17269. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17270. if err != nil {
  17271. return nil, err
  17272. }
  17273. reqHeaders.Set("Content-Type", "application/json")
  17274. c.urlParams_.Set("alt", alt)
  17275. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17276. urls += "?" + c.urlParams_.Encode()
  17277. req, _ := http.NewRequest("PATCH", urls, body)
  17278. req.Header = reqHeaders
  17279. googleapi.Expand(req.URL, map[string]string{
  17280. "profileId": strconv.FormatInt(c.profileId, 10),
  17281. })
  17282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17283. }
  17284. // Do executes the "dfareporting.advertisers.patch" call.
  17285. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17286. // status code is an error. Response headers are in either
  17287. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17288. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17289. // to check whether the returned error was because
  17290. // http.StatusNotModified was returned.
  17291. func (c *AdvertisersPatchCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17292. gensupport.SetOptions(c.urlParams_, opts...)
  17293. res, err := c.doRequest("json")
  17294. if res != nil && res.StatusCode == http.StatusNotModified {
  17295. if res.Body != nil {
  17296. res.Body.Close()
  17297. }
  17298. return nil, &googleapi.Error{
  17299. Code: res.StatusCode,
  17300. Header: res.Header,
  17301. }
  17302. }
  17303. if err != nil {
  17304. return nil, err
  17305. }
  17306. defer googleapi.CloseBody(res)
  17307. if err := googleapi.CheckResponse(res); err != nil {
  17308. return nil, err
  17309. }
  17310. ret := &Advertiser{
  17311. ServerResponse: googleapi.ServerResponse{
  17312. Header: res.Header,
  17313. HTTPStatusCode: res.StatusCode,
  17314. },
  17315. }
  17316. target := &ret
  17317. if err := gensupport.DecodeResponse(target, res); err != nil {
  17318. return nil, err
  17319. }
  17320. return ret, nil
  17321. // {
  17322. // "description": "Updates an existing advertiser. This method supports patch semantics.",
  17323. // "httpMethod": "PATCH",
  17324. // "id": "dfareporting.advertisers.patch",
  17325. // "parameterOrder": [
  17326. // "profileId",
  17327. // "id"
  17328. // ],
  17329. // "parameters": {
  17330. // "id": {
  17331. // "description": "Advertiser ID.",
  17332. // "format": "int64",
  17333. // "location": "query",
  17334. // "required": true,
  17335. // "type": "string"
  17336. // },
  17337. // "profileId": {
  17338. // "description": "User profile ID associated with this request.",
  17339. // "format": "int64",
  17340. // "location": "path",
  17341. // "required": true,
  17342. // "type": "string"
  17343. // }
  17344. // },
  17345. // "path": "userprofiles/{profileId}/advertisers",
  17346. // "request": {
  17347. // "$ref": "Advertiser"
  17348. // },
  17349. // "response": {
  17350. // "$ref": "Advertiser"
  17351. // },
  17352. // "scopes": [
  17353. // "https://www.googleapis.com/auth/dfatrafficking"
  17354. // ]
  17355. // }
  17356. }
  17357. // method id "dfareporting.advertisers.update":
  17358. type AdvertisersUpdateCall struct {
  17359. s *Service
  17360. profileId int64
  17361. advertiser *Advertiser
  17362. urlParams_ gensupport.URLParams
  17363. ctx_ context.Context
  17364. header_ http.Header
  17365. }
  17366. // Update: Updates an existing advertiser.
  17367. func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall {
  17368. c := &AdvertisersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17369. c.profileId = profileId
  17370. c.advertiser = advertiser
  17371. return c
  17372. }
  17373. // Fields allows partial responses to be retrieved. See
  17374. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17375. // for more information.
  17376. func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall {
  17377. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17378. return c
  17379. }
  17380. // Context sets the context to be used in this call's Do method. Any
  17381. // pending HTTP request will be aborted if the provided context is
  17382. // canceled.
  17383. func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall {
  17384. c.ctx_ = ctx
  17385. return c
  17386. }
  17387. // Header returns an http.Header that can be modified by the caller to
  17388. // add HTTP headers to the request.
  17389. func (c *AdvertisersUpdateCall) Header() http.Header {
  17390. if c.header_ == nil {
  17391. c.header_ = make(http.Header)
  17392. }
  17393. return c.header_
  17394. }
  17395. func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) {
  17396. reqHeaders := make(http.Header)
  17397. for k, v := range c.header_ {
  17398. reqHeaders[k] = v
  17399. }
  17400. reqHeaders.Set("User-Agent", c.s.userAgent())
  17401. var body io.Reader = nil
  17402. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  17403. if err != nil {
  17404. return nil, err
  17405. }
  17406. reqHeaders.Set("Content-Type", "application/json")
  17407. c.urlParams_.Set("alt", alt)
  17408. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  17409. urls += "?" + c.urlParams_.Encode()
  17410. req, _ := http.NewRequest("PUT", urls, body)
  17411. req.Header = reqHeaders
  17412. googleapi.Expand(req.URL, map[string]string{
  17413. "profileId": strconv.FormatInt(c.profileId, 10),
  17414. })
  17415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17416. }
  17417. // Do executes the "dfareporting.advertisers.update" call.
  17418. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  17419. // status code is an error. Response headers are in either
  17420. // *Advertiser.ServerResponse.Header or (if a response was returned at
  17421. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17422. // to check whether the returned error was because
  17423. // http.StatusNotModified was returned.
  17424. func (c *AdvertisersUpdateCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  17425. gensupport.SetOptions(c.urlParams_, opts...)
  17426. res, err := c.doRequest("json")
  17427. if res != nil && res.StatusCode == http.StatusNotModified {
  17428. if res.Body != nil {
  17429. res.Body.Close()
  17430. }
  17431. return nil, &googleapi.Error{
  17432. Code: res.StatusCode,
  17433. Header: res.Header,
  17434. }
  17435. }
  17436. if err != nil {
  17437. return nil, err
  17438. }
  17439. defer googleapi.CloseBody(res)
  17440. if err := googleapi.CheckResponse(res); err != nil {
  17441. return nil, err
  17442. }
  17443. ret := &Advertiser{
  17444. ServerResponse: googleapi.ServerResponse{
  17445. Header: res.Header,
  17446. HTTPStatusCode: res.StatusCode,
  17447. },
  17448. }
  17449. target := &ret
  17450. if err := gensupport.DecodeResponse(target, res); err != nil {
  17451. return nil, err
  17452. }
  17453. return ret, nil
  17454. // {
  17455. // "description": "Updates an existing advertiser.",
  17456. // "httpMethod": "PUT",
  17457. // "id": "dfareporting.advertisers.update",
  17458. // "parameterOrder": [
  17459. // "profileId"
  17460. // ],
  17461. // "parameters": {
  17462. // "profileId": {
  17463. // "description": "User profile ID associated with this request.",
  17464. // "format": "int64",
  17465. // "location": "path",
  17466. // "required": true,
  17467. // "type": "string"
  17468. // }
  17469. // },
  17470. // "path": "userprofiles/{profileId}/advertisers",
  17471. // "request": {
  17472. // "$ref": "Advertiser"
  17473. // },
  17474. // "response": {
  17475. // "$ref": "Advertiser"
  17476. // },
  17477. // "scopes": [
  17478. // "https://www.googleapis.com/auth/dfatrafficking"
  17479. // ]
  17480. // }
  17481. }
  17482. // method id "dfareporting.browsers.list":
  17483. type BrowsersListCall struct {
  17484. s *Service
  17485. profileId int64
  17486. urlParams_ gensupport.URLParams
  17487. ifNoneMatch_ string
  17488. ctx_ context.Context
  17489. header_ http.Header
  17490. }
  17491. // List: Retrieves a list of browsers.
  17492. func (r *BrowsersService) List(profileId int64) *BrowsersListCall {
  17493. c := &BrowsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17494. c.profileId = profileId
  17495. return c
  17496. }
  17497. // Fields allows partial responses to be retrieved. See
  17498. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17499. // for more information.
  17500. func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall {
  17501. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17502. return c
  17503. }
  17504. // IfNoneMatch sets the optional parameter which makes the operation
  17505. // fail if the object's ETag matches the given value. This is useful for
  17506. // getting updates only after the object has changed since the last
  17507. // request. Use googleapi.IsNotModified to check whether the response
  17508. // error from Do is the result of In-None-Match.
  17509. func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall {
  17510. c.ifNoneMatch_ = entityTag
  17511. return c
  17512. }
  17513. // Context sets the context to be used in this call's Do method. Any
  17514. // pending HTTP request will be aborted if the provided context is
  17515. // canceled.
  17516. func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall {
  17517. c.ctx_ = ctx
  17518. return c
  17519. }
  17520. // Header returns an http.Header that can be modified by the caller to
  17521. // add HTTP headers to the request.
  17522. func (c *BrowsersListCall) Header() http.Header {
  17523. if c.header_ == nil {
  17524. c.header_ = make(http.Header)
  17525. }
  17526. return c.header_
  17527. }
  17528. func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) {
  17529. reqHeaders := make(http.Header)
  17530. for k, v := range c.header_ {
  17531. reqHeaders[k] = v
  17532. }
  17533. reqHeaders.Set("User-Agent", c.s.userAgent())
  17534. if c.ifNoneMatch_ != "" {
  17535. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17536. }
  17537. var body io.Reader = nil
  17538. c.urlParams_.Set("alt", alt)
  17539. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers")
  17540. urls += "?" + c.urlParams_.Encode()
  17541. req, _ := http.NewRequest("GET", urls, body)
  17542. req.Header = reqHeaders
  17543. googleapi.Expand(req.URL, map[string]string{
  17544. "profileId": strconv.FormatInt(c.profileId, 10),
  17545. })
  17546. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17547. }
  17548. // Do executes the "dfareporting.browsers.list" call.
  17549. // Exactly one of *BrowsersListResponse or error will be non-nil. Any
  17550. // non-2xx status code is an error. Response headers are in either
  17551. // *BrowsersListResponse.ServerResponse.Header or (if a response was
  17552. // returned at all) in error.(*googleapi.Error).Header. Use
  17553. // googleapi.IsNotModified to check whether the returned error was
  17554. // because http.StatusNotModified was returned.
  17555. func (c *BrowsersListCall) Do(opts ...googleapi.CallOption) (*BrowsersListResponse, error) {
  17556. gensupport.SetOptions(c.urlParams_, opts...)
  17557. res, err := c.doRequest("json")
  17558. if res != nil && res.StatusCode == http.StatusNotModified {
  17559. if res.Body != nil {
  17560. res.Body.Close()
  17561. }
  17562. return nil, &googleapi.Error{
  17563. Code: res.StatusCode,
  17564. Header: res.Header,
  17565. }
  17566. }
  17567. if err != nil {
  17568. return nil, err
  17569. }
  17570. defer googleapi.CloseBody(res)
  17571. if err := googleapi.CheckResponse(res); err != nil {
  17572. return nil, err
  17573. }
  17574. ret := &BrowsersListResponse{
  17575. ServerResponse: googleapi.ServerResponse{
  17576. Header: res.Header,
  17577. HTTPStatusCode: res.StatusCode,
  17578. },
  17579. }
  17580. target := &ret
  17581. if err := gensupport.DecodeResponse(target, res); err != nil {
  17582. return nil, err
  17583. }
  17584. return ret, nil
  17585. // {
  17586. // "description": "Retrieves a list of browsers.",
  17587. // "httpMethod": "GET",
  17588. // "id": "dfareporting.browsers.list",
  17589. // "parameterOrder": [
  17590. // "profileId"
  17591. // ],
  17592. // "parameters": {
  17593. // "profileId": {
  17594. // "description": "User profile ID associated with this request.",
  17595. // "format": "int64",
  17596. // "location": "path",
  17597. // "required": true,
  17598. // "type": "string"
  17599. // }
  17600. // },
  17601. // "path": "userprofiles/{profileId}/browsers",
  17602. // "response": {
  17603. // "$ref": "BrowsersListResponse"
  17604. // },
  17605. // "scopes": [
  17606. // "https://www.googleapis.com/auth/dfatrafficking"
  17607. // ]
  17608. // }
  17609. }
  17610. // method id "dfareporting.campaignCreativeAssociations.insert":
  17611. type CampaignCreativeAssociationsInsertCall struct {
  17612. s *Service
  17613. profileId int64
  17614. campaignId int64
  17615. campaigncreativeassociation *CampaignCreativeAssociation
  17616. urlParams_ gensupport.URLParams
  17617. ctx_ context.Context
  17618. header_ http.Header
  17619. }
  17620. // Insert: Associates a creative with the specified campaign. This
  17621. // method creates a default ad with dimensions matching the creative in
  17622. // the campaign if such a default ad does not exist already.
  17623. func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall {
  17624. c := &CampaignCreativeAssociationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17625. c.profileId = profileId
  17626. c.campaignId = campaignId
  17627. c.campaigncreativeassociation = campaigncreativeassociation
  17628. return c
  17629. }
  17630. // Fields allows partial responses to be retrieved. See
  17631. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17632. // for more information.
  17633. func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall {
  17634. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17635. return c
  17636. }
  17637. // Context sets the context to be used in this call's Do method. Any
  17638. // pending HTTP request will be aborted if the provided context is
  17639. // canceled.
  17640. func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall {
  17641. c.ctx_ = ctx
  17642. return c
  17643. }
  17644. // Header returns an http.Header that can be modified by the caller to
  17645. // add HTTP headers to the request.
  17646. func (c *CampaignCreativeAssociationsInsertCall) Header() http.Header {
  17647. if c.header_ == nil {
  17648. c.header_ = make(http.Header)
  17649. }
  17650. return c.header_
  17651. }
  17652. func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) {
  17653. reqHeaders := make(http.Header)
  17654. for k, v := range c.header_ {
  17655. reqHeaders[k] = v
  17656. }
  17657. reqHeaders.Set("User-Agent", c.s.userAgent())
  17658. var body io.Reader = nil
  17659. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation)
  17660. if err != nil {
  17661. return nil, err
  17662. }
  17663. reqHeaders.Set("Content-Type", "application/json")
  17664. c.urlParams_.Set("alt", alt)
  17665. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  17666. urls += "?" + c.urlParams_.Encode()
  17667. req, _ := http.NewRequest("POST", urls, body)
  17668. req.Header = reqHeaders
  17669. googleapi.Expand(req.URL, map[string]string{
  17670. "profileId": strconv.FormatInt(c.profileId, 10),
  17671. "campaignId": strconv.FormatInt(c.campaignId, 10),
  17672. })
  17673. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17674. }
  17675. // Do executes the "dfareporting.campaignCreativeAssociations.insert" call.
  17676. // Exactly one of *CampaignCreativeAssociation or error will be non-nil.
  17677. // Any non-2xx status code is an error. Response headers are in either
  17678. // *CampaignCreativeAssociation.ServerResponse.Header or (if a response
  17679. // was returned at all) in error.(*googleapi.Error).Header. Use
  17680. // googleapi.IsNotModified to check whether the returned error was
  17681. // because http.StatusNotModified was returned.
  17682. func (c *CampaignCreativeAssociationsInsertCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociation, error) {
  17683. gensupport.SetOptions(c.urlParams_, opts...)
  17684. res, err := c.doRequest("json")
  17685. if res != nil && res.StatusCode == http.StatusNotModified {
  17686. if res.Body != nil {
  17687. res.Body.Close()
  17688. }
  17689. return nil, &googleapi.Error{
  17690. Code: res.StatusCode,
  17691. Header: res.Header,
  17692. }
  17693. }
  17694. if err != nil {
  17695. return nil, err
  17696. }
  17697. defer googleapi.CloseBody(res)
  17698. if err := googleapi.CheckResponse(res); err != nil {
  17699. return nil, err
  17700. }
  17701. ret := &CampaignCreativeAssociation{
  17702. ServerResponse: googleapi.ServerResponse{
  17703. Header: res.Header,
  17704. HTTPStatusCode: res.StatusCode,
  17705. },
  17706. }
  17707. target := &ret
  17708. if err := gensupport.DecodeResponse(target, res); err != nil {
  17709. return nil, err
  17710. }
  17711. return ret, nil
  17712. // {
  17713. // "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.",
  17714. // "httpMethod": "POST",
  17715. // "id": "dfareporting.campaignCreativeAssociations.insert",
  17716. // "parameterOrder": [
  17717. // "profileId",
  17718. // "campaignId"
  17719. // ],
  17720. // "parameters": {
  17721. // "campaignId": {
  17722. // "description": "Campaign ID in this association.",
  17723. // "format": "int64",
  17724. // "location": "path",
  17725. // "required": true,
  17726. // "type": "string"
  17727. // },
  17728. // "profileId": {
  17729. // "description": "User profile ID associated with this request.",
  17730. // "format": "int64",
  17731. // "location": "path",
  17732. // "required": true,
  17733. // "type": "string"
  17734. // }
  17735. // },
  17736. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  17737. // "request": {
  17738. // "$ref": "CampaignCreativeAssociation"
  17739. // },
  17740. // "response": {
  17741. // "$ref": "CampaignCreativeAssociation"
  17742. // },
  17743. // "scopes": [
  17744. // "https://www.googleapis.com/auth/dfatrafficking"
  17745. // ]
  17746. // }
  17747. }
  17748. // method id "dfareporting.campaignCreativeAssociations.list":
  17749. type CampaignCreativeAssociationsListCall struct {
  17750. s *Service
  17751. profileId int64
  17752. campaignId int64
  17753. urlParams_ gensupport.URLParams
  17754. ifNoneMatch_ string
  17755. ctx_ context.Context
  17756. header_ http.Header
  17757. }
  17758. // List: Retrieves the list of creative IDs associated with the
  17759. // specified campaign. This method supports paging.
  17760. func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall {
  17761. c := &CampaignCreativeAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17762. c.profileId = profileId
  17763. c.campaignId = campaignId
  17764. return c
  17765. }
  17766. // MaxResults sets the optional parameter "maxResults": Maximum number
  17767. // of results to return.
  17768. func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall {
  17769. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17770. return c
  17771. }
  17772. // PageToken sets the optional parameter "pageToken": Value of the
  17773. // nextPageToken from the previous result page.
  17774. func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall {
  17775. c.urlParams_.Set("pageToken", pageToken)
  17776. return c
  17777. }
  17778. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  17779. // results.
  17780. //
  17781. // Possible values:
  17782. // "ASCENDING" (default)
  17783. // "DESCENDING"
  17784. func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall {
  17785. c.urlParams_.Set("sortOrder", sortOrder)
  17786. return c
  17787. }
  17788. // Fields allows partial responses to be retrieved. See
  17789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17790. // for more information.
  17791. func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall {
  17792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17793. return c
  17794. }
  17795. // IfNoneMatch sets the optional parameter which makes the operation
  17796. // fail if the object's ETag matches the given value. This is useful for
  17797. // getting updates only after the object has changed since the last
  17798. // request. Use googleapi.IsNotModified to check whether the response
  17799. // error from Do is the result of In-None-Match.
  17800. func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall {
  17801. c.ifNoneMatch_ = entityTag
  17802. return c
  17803. }
  17804. // Context sets the context to be used in this call's Do method. Any
  17805. // pending HTTP request will be aborted if the provided context is
  17806. // canceled.
  17807. func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall {
  17808. c.ctx_ = ctx
  17809. return c
  17810. }
  17811. // Header returns an http.Header that can be modified by the caller to
  17812. // add HTTP headers to the request.
  17813. func (c *CampaignCreativeAssociationsListCall) Header() http.Header {
  17814. if c.header_ == nil {
  17815. c.header_ = make(http.Header)
  17816. }
  17817. return c.header_
  17818. }
  17819. func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  17820. reqHeaders := make(http.Header)
  17821. for k, v := range c.header_ {
  17822. reqHeaders[k] = v
  17823. }
  17824. reqHeaders.Set("User-Agent", c.s.userAgent())
  17825. if c.ifNoneMatch_ != "" {
  17826. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17827. }
  17828. var body io.Reader = nil
  17829. c.urlParams_.Set("alt", alt)
  17830. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  17831. urls += "?" + c.urlParams_.Encode()
  17832. req, _ := http.NewRequest("GET", urls, body)
  17833. req.Header = reqHeaders
  17834. googleapi.Expand(req.URL, map[string]string{
  17835. "profileId": strconv.FormatInt(c.profileId, 10),
  17836. "campaignId": strconv.FormatInt(c.campaignId, 10),
  17837. })
  17838. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17839. }
  17840. // Do executes the "dfareporting.campaignCreativeAssociations.list" call.
  17841. // Exactly one of *CampaignCreativeAssociationsListResponse or error
  17842. // will be non-nil. Any non-2xx status code is an error. Response
  17843. // headers are in either
  17844. // *CampaignCreativeAssociationsListResponse.ServerResponse.Header or
  17845. // (if a response was returned at all) in
  17846. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  17847. // whether the returned error was because http.StatusNotModified was
  17848. // returned.
  17849. func (c *CampaignCreativeAssociationsListCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociationsListResponse, error) {
  17850. gensupport.SetOptions(c.urlParams_, opts...)
  17851. res, err := c.doRequest("json")
  17852. if res != nil && res.StatusCode == http.StatusNotModified {
  17853. if res.Body != nil {
  17854. res.Body.Close()
  17855. }
  17856. return nil, &googleapi.Error{
  17857. Code: res.StatusCode,
  17858. Header: res.Header,
  17859. }
  17860. }
  17861. if err != nil {
  17862. return nil, err
  17863. }
  17864. defer googleapi.CloseBody(res)
  17865. if err := googleapi.CheckResponse(res); err != nil {
  17866. return nil, err
  17867. }
  17868. ret := &CampaignCreativeAssociationsListResponse{
  17869. ServerResponse: googleapi.ServerResponse{
  17870. Header: res.Header,
  17871. HTTPStatusCode: res.StatusCode,
  17872. },
  17873. }
  17874. target := &ret
  17875. if err := gensupport.DecodeResponse(target, res); err != nil {
  17876. return nil, err
  17877. }
  17878. return ret, nil
  17879. // {
  17880. // "description": "Retrieves the list of creative IDs associated with the specified campaign. This method supports paging.",
  17881. // "httpMethod": "GET",
  17882. // "id": "dfareporting.campaignCreativeAssociations.list",
  17883. // "parameterOrder": [
  17884. // "profileId",
  17885. // "campaignId"
  17886. // ],
  17887. // "parameters": {
  17888. // "campaignId": {
  17889. // "description": "Campaign ID in this association.",
  17890. // "format": "int64",
  17891. // "location": "path",
  17892. // "required": true,
  17893. // "type": "string"
  17894. // },
  17895. // "maxResults": {
  17896. // "default": "1000",
  17897. // "description": "Maximum number of results to return.",
  17898. // "format": "int32",
  17899. // "location": "query",
  17900. // "maximum": "1000",
  17901. // "minimum": "0",
  17902. // "type": "integer"
  17903. // },
  17904. // "pageToken": {
  17905. // "description": "Value of the nextPageToken from the previous result page.",
  17906. // "location": "query",
  17907. // "type": "string"
  17908. // },
  17909. // "profileId": {
  17910. // "description": "User profile ID associated with this request.",
  17911. // "format": "int64",
  17912. // "location": "path",
  17913. // "required": true,
  17914. // "type": "string"
  17915. // },
  17916. // "sortOrder": {
  17917. // "default": "ASCENDING",
  17918. // "description": "Order of sorted results.",
  17919. // "enum": [
  17920. // "ASCENDING",
  17921. // "DESCENDING"
  17922. // ],
  17923. // "enumDescriptions": [
  17924. // "",
  17925. // ""
  17926. // ],
  17927. // "location": "query",
  17928. // "type": "string"
  17929. // }
  17930. // },
  17931. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  17932. // "response": {
  17933. // "$ref": "CampaignCreativeAssociationsListResponse"
  17934. // },
  17935. // "scopes": [
  17936. // "https://www.googleapis.com/auth/dfatrafficking"
  17937. // ]
  17938. // }
  17939. }
  17940. // Pages invokes f for each page of results.
  17941. // A non-nil error returned from f will halt the iteration.
  17942. // The provided context supersedes any context provided to the Context method.
  17943. func (c *CampaignCreativeAssociationsListCall) Pages(ctx context.Context, f func(*CampaignCreativeAssociationsListResponse) error) error {
  17944. c.ctx_ = ctx
  17945. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17946. for {
  17947. x, err := c.Do()
  17948. if err != nil {
  17949. return err
  17950. }
  17951. if err := f(x); err != nil {
  17952. return err
  17953. }
  17954. if x.NextPageToken == "" {
  17955. return nil
  17956. }
  17957. c.PageToken(x.NextPageToken)
  17958. }
  17959. }
  17960. // method id "dfareporting.campaigns.get":
  17961. type CampaignsGetCall struct {
  17962. s *Service
  17963. profileId int64
  17964. id int64
  17965. urlParams_ gensupport.URLParams
  17966. ifNoneMatch_ string
  17967. ctx_ context.Context
  17968. header_ http.Header
  17969. }
  17970. // Get: Gets one campaign by ID.
  17971. func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall {
  17972. c := &CampaignsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17973. c.profileId = profileId
  17974. c.id = id
  17975. return c
  17976. }
  17977. // Fields allows partial responses to be retrieved. See
  17978. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17979. // for more information.
  17980. func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall {
  17981. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17982. return c
  17983. }
  17984. // IfNoneMatch sets the optional parameter which makes the operation
  17985. // fail if the object's ETag matches the given value. This is useful for
  17986. // getting updates only after the object has changed since the last
  17987. // request. Use googleapi.IsNotModified to check whether the response
  17988. // error from Do is the result of In-None-Match.
  17989. func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall {
  17990. c.ifNoneMatch_ = entityTag
  17991. return c
  17992. }
  17993. // Context sets the context to be used in this call's Do method. Any
  17994. // pending HTTP request will be aborted if the provided context is
  17995. // canceled.
  17996. func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall {
  17997. c.ctx_ = ctx
  17998. return c
  17999. }
  18000. // Header returns an http.Header that can be modified by the caller to
  18001. // add HTTP headers to the request.
  18002. func (c *CampaignsGetCall) Header() http.Header {
  18003. if c.header_ == nil {
  18004. c.header_ = make(http.Header)
  18005. }
  18006. return c.header_
  18007. }
  18008. func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) {
  18009. reqHeaders := make(http.Header)
  18010. for k, v := range c.header_ {
  18011. reqHeaders[k] = v
  18012. }
  18013. reqHeaders.Set("User-Agent", c.s.userAgent())
  18014. if c.ifNoneMatch_ != "" {
  18015. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18016. }
  18017. var body io.Reader = nil
  18018. c.urlParams_.Set("alt", alt)
  18019. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}")
  18020. urls += "?" + c.urlParams_.Encode()
  18021. req, _ := http.NewRequest("GET", urls, body)
  18022. req.Header = reqHeaders
  18023. googleapi.Expand(req.URL, map[string]string{
  18024. "profileId": strconv.FormatInt(c.profileId, 10),
  18025. "id": strconv.FormatInt(c.id, 10),
  18026. })
  18027. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18028. }
  18029. // Do executes the "dfareporting.campaigns.get" call.
  18030. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18031. // code is an error. Response headers are in either
  18032. // *Campaign.ServerResponse.Header or (if a response was returned at
  18033. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18034. // to check whether the returned error was because
  18035. // http.StatusNotModified was returned.
  18036. func (c *CampaignsGetCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18037. gensupport.SetOptions(c.urlParams_, opts...)
  18038. res, err := c.doRequest("json")
  18039. if res != nil && res.StatusCode == http.StatusNotModified {
  18040. if res.Body != nil {
  18041. res.Body.Close()
  18042. }
  18043. return nil, &googleapi.Error{
  18044. Code: res.StatusCode,
  18045. Header: res.Header,
  18046. }
  18047. }
  18048. if err != nil {
  18049. return nil, err
  18050. }
  18051. defer googleapi.CloseBody(res)
  18052. if err := googleapi.CheckResponse(res); err != nil {
  18053. return nil, err
  18054. }
  18055. ret := &Campaign{
  18056. ServerResponse: googleapi.ServerResponse{
  18057. Header: res.Header,
  18058. HTTPStatusCode: res.StatusCode,
  18059. },
  18060. }
  18061. target := &ret
  18062. if err := gensupport.DecodeResponse(target, res); err != nil {
  18063. return nil, err
  18064. }
  18065. return ret, nil
  18066. // {
  18067. // "description": "Gets one campaign by ID.",
  18068. // "httpMethod": "GET",
  18069. // "id": "dfareporting.campaigns.get",
  18070. // "parameterOrder": [
  18071. // "profileId",
  18072. // "id"
  18073. // ],
  18074. // "parameters": {
  18075. // "id": {
  18076. // "description": "Campaign ID.",
  18077. // "format": "int64",
  18078. // "location": "path",
  18079. // "required": true,
  18080. // "type": "string"
  18081. // },
  18082. // "profileId": {
  18083. // "description": "User profile ID associated with this request.",
  18084. // "format": "int64",
  18085. // "location": "path",
  18086. // "required": true,
  18087. // "type": "string"
  18088. // }
  18089. // },
  18090. // "path": "userprofiles/{profileId}/campaigns/{id}",
  18091. // "response": {
  18092. // "$ref": "Campaign"
  18093. // },
  18094. // "scopes": [
  18095. // "https://www.googleapis.com/auth/dfatrafficking"
  18096. // ]
  18097. // }
  18098. }
  18099. // method id "dfareporting.campaigns.insert":
  18100. type CampaignsInsertCall struct {
  18101. s *Service
  18102. profileId int64
  18103. campaign *Campaign
  18104. urlParams_ gensupport.URLParams
  18105. ctx_ context.Context
  18106. header_ http.Header
  18107. }
  18108. // Insert: Inserts a new campaign.
  18109. func (r *CampaignsService) Insert(profileId int64, campaign *Campaign) *CampaignsInsertCall {
  18110. c := &CampaignsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18111. c.profileId = profileId
  18112. c.campaign = campaign
  18113. return c
  18114. }
  18115. // Fields allows partial responses to be retrieved. See
  18116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18117. // for more information.
  18118. func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall {
  18119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18120. return c
  18121. }
  18122. // Context sets the context to be used in this call's Do method. Any
  18123. // pending HTTP request will be aborted if the provided context is
  18124. // canceled.
  18125. func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall {
  18126. c.ctx_ = ctx
  18127. return c
  18128. }
  18129. // Header returns an http.Header that can be modified by the caller to
  18130. // add HTTP headers to the request.
  18131. func (c *CampaignsInsertCall) Header() http.Header {
  18132. if c.header_ == nil {
  18133. c.header_ = make(http.Header)
  18134. }
  18135. return c.header_
  18136. }
  18137. func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) {
  18138. reqHeaders := make(http.Header)
  18139. for k, v := range c.header_ {
  18140. reqHeaders[k] = v
  18141. }
  18142. reqHeaders.Set("User-Agent", c.s.userAgent())
  18143. var body io.Reader = nil
  18144. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18145. if err != nil {
  18146. return nil, err
  18147. }
  18148. reqHeaders.Set("Content-Type", "application/json")
  18149. c.urlParams_.Set("alt", alt)
  18150. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18151. urls += "?" + c.urlParams_.Encode()
  18152. req, _ := http.NewRequest("POST", urls, body)
  18153. req.Header = reqHeaders
  18154. googleapi.Expand(req.URL, map[string]string{
  18155. "profileId": strconv.FormatInt(c.profileId, 10),
  18156. })
  18157. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18158. }
  18159. // Do executes the "dfareporting.campaigns.insert" call.
  18160. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18161. // code is an error. Response headers are in either
  18162. // *Campaign.ServerResponse.Header or (if a response was returned at
  18163. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18164. // to check whether the returned error was because
  18165. // http.StatusNotModified was returned.
  18166. func (c *CampaignsInsertCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18167. gensupport.SetOptions(c.urlParams_, opts...)
  18168. res, err := c.doRequest("json")
  18169. if res != nil && res.StatusCode == http.StatusNotModified {
  18170. if res.Body != nil {
  18171. res.Body.Close()
  18172. }
  18173. return nil, &googleapi.Error{
  18174. Code: res.StatusCode,
  18175. Header: res.Header,
  18176. }
  18177. }
  18178. if err != nil {
  18179. return nil, err
  18180. }
  18181. defer googleapi.CloseBody(res)
  18182. if err := googleapi.CheckResponse(res); err != nil {
  18183. return nil, err
  18184. }
  18185. ret := &Campaign{
  18186. ServerResponse: googleapi.ServerResponse{
  18187. Header: res.Header,
  18188. HTTPStatusCode: res.StatusCode,
  18189. },
  18190. }
  18191. target := &ret
  18192. if err := gensupport.DecodeResponse(target, res); err != nil {
  18193. return nil, err
  18194. }
  18195. return ret, nil
  18196. // {
  18197. // "description": "Inserts a new campaign.",
  18198. // "httpMethod": "POST",
  18199. // "id": "dfareporting.campaigns.insert",
  18200. // "parameterOrder": [
  18201. // "profileId"
  18202. // ],
  18203. // "parameters": {
  18204. // "profileId": {
  18205. // "description": "User profile ID associated with this request.",
  18206. // "format": "int64",
  18207. // "location": "path",
  18208. // "required": true,
  18209. // "type": "string"
  18210. // }
  18211. // },
  18212. // "path": "userprofiles/{profileId}/campaigns",
  18213. // "request": {
  18214. // "$ref": "Campaign"
  18215. // },
  18216. // "response": {
  18217. // "$ref": "Campaign"
  18218. // },
  18219. // "scopes": [
  18220. // "https://www.googleapis.com/auth/dfatrafficking"
  18221. // ]
  18222. // }
  18223. }
  18224. // method id "dfareporting.campaigns.list":
  18225. type CampaignsListCall struct {
  18226. s *Service
  18227. profileId int64
  18228. urlParams_ gensupport.URLParams
  18229. ifNoneMatch_ string
  18230. ctx_ context.Context
  18231. header_ http.Header
  18232. }
  18233. // List: Retrieves a list of campaigns, possibly filtered. This method
  18234. // supports paging.
  18235. func (r *CampaignsService) List(profileId int64) *CampaignsListCall {
  18236. c := &CampaignsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18237. c.profileId = profileId
  18238. return c
  18239. }
  18240. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  18241. // Select only campaigns whose advertisers belong to these advertiser
  18242. // groups.
  18243. func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *CampaignsListCall {
  18244. var advertiserGroupIds_ []string
  18245. for _, v := range advertiserGroupIds {
  18246. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  18247. }
  18248. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  18249. return c
  18250. }
  18251. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  18252. // only campaigns that belong to these advertisers.
  18253. func (c *CampaignsListCall) AdvertiserIds(advertiserIds ...int64) *CampaignsListCall {
  18254. var advertiserIds_ []string
  18255. for _, v := range advertiserIds {
  18256. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  18257. }
  18258. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  18259. return c
  18260. }
  18261. // Archived sets the optional parameter "archived": Select only archived
  18262. // campaigns. Don't set this field to select both archived and
  18263. // non-archived campaigns.
  18264. func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall {
  18265. c.urlParams_.Set("archived", fmt.Sprint(archived))
  18266. return c
  18267. }
  18268. // AtLeastOneOptimizationActivity sets the optional parameter
  18269. // "atLeastOneOptimizationActivity": Select only campaigns that have at
  18270. // least one optimization activity.
  18271. func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall {
  18272. c.urlParams_.Set("atLeastOneOptimizationActivity", fmt.Sprint(atLeastOneOptimizationActivity))
  18273. return c
  18274. }
  18275. // ExcludedIds sets the optional parameter "excludedIds": Exclude
  18276. // campaigns with these IDs.
  18277. func (c *CampaignsListCall) ExcludedIds(excludedIds ...int64) *CampaignsListCall {
  18278. var excludedIds_ []string
  18279. for _, v := range excludedIds {
  18280. excludedIds_ = append(excludedIds_, fmt.Sprint(v))
  18281. }
  18282. c.urlParams_.SetMulti("excludedIds", excludedIds_)
  18283. return c
  18284. }
  18285. // Ids sets the optional parameter "ids": Select only campaigns with
  18286. // these IDs.
  18287. func (c *CampaignsListCall) Ids(ids ...int64) *CampaignsListCall {
  18288. var ids_ []string
  18289. for _, v := range ids {
  18290. ids_ = append(ids_, fmt.Sprint(v))
  18291. }
  18292. c.urlParams_.SetMulti("ids", ids_)
  18293. return c
  18294. }
  18295. // MaxResults sets the optional parameter "maxResults": Maximum number
  18296. // of results to return.
  18297. func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall {
  18298. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18299. return c
  18300. }
  18301. // OverriddenEventTagId sets the optional parameter
  18302. // "overriddenEventTagId": Select only campaigns that have overridden
  18303. // this event tag ID.
  18304. func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall {
  18305. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  18306. return c
  18307. }
  18308. // PageToken sets the optional parameter "pageToken": Value of the
  18309. // nextPageToken from the previous result page.
  18310. func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall {
  18311. c.urlParams_.Set("pageToken", pageToken)
  18312. return c
  18313. }
  18314. // SearchString sets the optional parameter "searchString": Allows
  18315. // searching for campaigns by name or ID. Wildcards (*) are allowed. For
  18316. // example, "campaign*2015" will return campaigns with names like
  18317. // "campaign June 2015", "campaign April 2015", or simply "campaign
  18318. // 2015". Most of the searches also add wildcards implicitly at the
  18319. // start and the end of the search string. For example, a search string
  18320. // of "campaign" will match campaigns with name "my campaign", "campaign
  18321. // 2015", or simply "campaign".
  18322. func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall {
  18323. c.urlParams_.Set("searchString", searchString)
  18324. return c
  18325. }
  18326. // SortField sets the optional parameter "sortField": Field by which to
  18327. // sort the list.
  18328. //
  18329. // Possible values:
  18330. // "ID" (default)
  18331. // "NAME"
  18332. func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall {
  18333. c.urlParams_.Set("sortField", sortField)
  18334. return c
  18335. }
  18336. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  18337. // results.
  18338. //
  18339. // Possible values:
  18340. // "ASCENDING" (default)
  18341. // "DESCENDING"
  18342. func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall {
  18343. c.urlParams_.Set("sortOrder", sortOrder)
  18344. return c
  18345. }
  18346. // SubaccountId sets the optional parameter "subaccountId": Select only
  18347. // campaigns that belong to this subaccount.
  18348. func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall {
  18349. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  18350. return c
  18351. }
  18352. // Fields allows partial responses to be retrieved. See
  18353. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18354. // for more information.
  18355. func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall {
  18356. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18357. return c
  18358. }
  18359. // IfNoneMatch sets the optional parameter which makes the operation
  18360. // fail if the object's ETag matches the given value. This is useful for
  18361. // getting updates only after the object has changed since the last
  18362. // request. Use googleapi.IsNotModified to check whether the response
  18363. // error from Do is the result of In-None-Match.
  18364. func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall {
  18365. c.ifNoneMatch_ = entityTag
  18366. return c
  18367. }
  18368. // Context sets the context to be used in this call's Do method. Any
  18369. // pending HTTP request will be aborted if the provided context is
  18370. // canceled.
  18371. func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall {
  18372. c.ctx_ = ctx
  18373. return c
  18374. }
  18375. // Header returns an http.Header that can be modified by the caller to
  18376. // add HTTP headers to the request.
  18377. func (c *CampaignsListCall) Header() http.Header {
  18378. if c.header_ == nil {
  18379. c.header_ = make(http.Header)
  18380. }
  18381. return c.header_
  18382. }
  18383. func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) {
  18384. reqHeaders := make(http.Header)
  18385. for k, v := range c.header_ {
  18386. reqHeaders[k] = v
  18387. }
  18388. reqHeaders.Set("User-Agent", c.s.userAgent())
  18389. if c.ifNoneMatch_ != "" {
  18390. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18391. }
  18392. var body io.Reader = nil
  18393. c.urlParams_.Set("alt", alt)
  18394. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18395. urls += "?" + c.urlParams_.Encode()
  18396. req, _ := http.NewRequest("GET", urls, body)
  18397. req.Header = reqHeaders
  18398. googleapi.Expand(req.URL, map[string]string{
  18399. "profileId": strconv.FormatInt(c.profileId, 10),
  18400. })
  18401. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18402. }
  18403. // Do executes the "dfareporting.campaigns.list" call.
  18404. // Exactly one of *CampaignsListResponse or error will be non-nil. Any
  18405. // non-2xx status code is an error. Response headers are in either
  18406. // *CampaignsListResponse.ServerResponse.Header or (if a response was
  18407. // returned at all) in error.(*googleapi.Error).Header. Use
  18408. // googleapi.IsNotModified to check whether the returned error was
  18409. // because http.StatusNotModified was returned.
  18410. func (c *CampaignsListCall) Do(opts ...googleapi.CallOption) (*CampaignsListResponse, error) {
  18411. gensupport.SetOptions(c.urlParams_, opts...)
  18412. res, err := c.doRequest("json")
  18413. if res != nil && res.StatusCode == http.StatusNotModified {
  18414. if res.Body != nil {
  18415. res.Body.Close()
  18416. }
  18417. return nil, &googleapi.Error{
  18418. Code: res.StatusCode,
  18419. Header: res.Header,
  18420. }
  18421. }
  18422. if err != nil {
  18423. return nil, err
  18424. }
  18425. defer googleapi.CloseBody(res)
  18426. if err := googleapi.CheckResponse(res); err != nil {
  18427. return nil, err
  18428. }
  18429. ret := &CampaignsListResponse{
  18430. ServerResponse: googleapi.ServerResponse{
  18431. Header: res.Header,
  18432. HTTPStatusCode: res.StatusCode,
  18433. },
  18434. }
  18435. target := &ret
  18436. if err := gensupport.DecodeResponse(target, res); err != nil {
  18437. return nil, err
  18438. }
  18439. return ret, nil
  18440. // {
  18441. // "description": "Retrieves a list of campaigns, possibly filtered. This method supports paging.",
  18442. // "httpMethod": "GET",
  18443. // "id": "dfareporting.campaigns.list",
  18444. // "parameterOrder": [
  18445. // "profileId"
  18446. // ],
  18447. // "parameters": {
  18448. // "advertiserGroupIds": {
  18449. // "description": "Select only campaigns whose advertisers belong to these advertiser groups.",
  18450. // "format": "int64",
  18451. // "location": "query",
  18452. // "repeated": true,
  18453. // "type": "string"
  18454. // },
  18455. // "advertiserIds": {
  18456. // "description": "Select only campaigns that belong to these advertisers.",
  18457. // "format": "int64",
  18458. // "location": "query",
  18459. // "repeated": true,
  18460. // "type": "string"
  18461. // },
  18462. // "archived": {
  18463. // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.",
  18464. // "location": "query",
  18465. // "type": "boolean"
  18466. // },
  18467. // "atLeastOneOptimizationActivity": {
  18468. // "description": "Select only campaigns that have at least one optimization activity.",
  18469. // "location": "query",
  18470. // "type": "boolean"
  18471. // },
  18472. // "excludedIds": {
  18473. // "description": "Exclude campaigns with these IDs.",
  18474. // "format": "int64",
  18475. // "location": "query",
  18476. // "repeated": true,
  18477. // "type": "string"
  18478. // },
  18479. // "ids": {
  18480. // "description": "Select only campaigns with these IDs.",
  18481. // "format": "int64",
  18482. // "location": "query",
  18483. // "repeated": true,
  18484. // "type": "string"
  18485. // },
  18486. // "maxResults": {
  18487. // "default": "1000",
  18488. // "description": "Maximum number of results to return.",
  18489. // "format": "int32",
  18490. // "location": "query",
  18491. // "maximum": "1000",
  18492. // "minimum": "0",
  18493. // "type": "integer"
  18494. // },
  18495. // "overriddenEventTagId": {
  18496. // "description": "Select only campaigns that have overridden this event tag ID.",
  18497. // "format": "int64",
  18498. // "location": "query",
  18499. // "type": "string"
  18500. // },
  18501. // "pageToken": {
  18502. // "description": "Value of the nextPageToken from the previous result page.",
  18503. // "location": "query",
  18504. // "type": "string"
  18505. // },
  18506. // "profileId": {
  18507. // "description": "User profile ID associated with this request.",
  18508. // "format": "int64",
  18509. // "location": "path",
  18510. // "required": true,
  18511. // "type": "string"
  18512. // },
  18513. // "searchString": {
  18514. // "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\".",
  18515. // "location": "query",
  18516. // "type": "string"
  18517. // },
  18518. // "sortField": {
  18519. // "default": "ID",
  18520. // "description": "Field by which to sort the list.",
  18521. // "enum": [
  18522. // "ID",
  18523. // "NAME"
  18524. // ],
  18525. // "enumDescriptions": [
  18526. // "",
  18527. // ""
  18528. // ],
  18529. // "location": "query",
  18530. // "type": "string"
  18531. // },
  18532. // "sortOrder": {
  18533. // "default": "ASCENDING",
  18534. // "description": "Order of sorted results.",
  18535. // "enum": [
  18536. // "ASCENDING",
  18537. // "DESCENDING"
  18538. // ],
  18539. // "enumDescriptions": [
  18540. // "",
  18541. // ""
  18542. // ],
  18543. // "location": "query",
  18544. // "type": "string"
  18545. // },
  18546. // "subaccountId": {
  18547. // "description": "Select only campaigns that belong to this subaccount.",
  18548. // "format": "int64",
  18549. // "location": "query",
  18550. // "type": "string"
  18551. // }
  18552. // },
  18553. // "path": "userprofiles/{profileId}/campaigns",
  18554. // "response": {
  18555. // "$ref": "CampaignsListResponse"
  18556. // },
  18557. // "scopes": [
  18558. // "https://www.googleapis.com/auth/dfatrafficking"
  18559. // ]
  18560. // }
  18561. }
  18562. // Pages invokes f for each page of results.
  18563. // A non-nil error returned from f will halt the iteration.
  18564. // The provided context supersedes any context provided to the Context method.
  18565. func (c *CampaignsListCall) Pages(ctx context.Context, f func(*CampaignsListResponse) error) error {
  18566. c.ctx_ = ctx
  18567. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18568. for {
  18569. x, err := c.Do()
  18570. if err != nil {
  18571. return err
  18572. }
  18573. if err := f(x); err != nil {
  18574. return err
  18575. }
  18576. if x.NextPageToken == "" {
  18577. return nil
  18578. }
  18579. c.PageToken(x.NextPageToken)
  18580. }
  18581. }
  18582. // method id "dfareporting.campaigns.patch":
  18583. type CampaignsPatchCall struct {
  18584. s *Service
  18585. profileId int64
  18586. campaign *Campaign
  18587. urlParams_ gensupport.URLParams
  18588. ctx_ context.Context
  18589. header_ http.Header
  18590. }
  18591. // Patch: Updates an existing campaign. This method supports patch
  18592. // semantics.
  18593. func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall {
  18594. c := &CampaignsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18595. c.profileId = profileId
  18596. c.urlParams_.Set("id", fmt.Sprint(id))
  18597. c.campaign = campaign
  18598. return c
  18599. }
  18600. // Fields allows partial responses to be retrieved. See
  18601. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18602. // for more information.
  18603. func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall {
  18604. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18605. return c
  18606. }
  18607. // Context sets the context to be used in this call's Do method. Any
  18608. // pending HTTP request will be aborted if the provided context is
  18609. // canceled.
  18610. func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall {
  18611. c.ctx_ = ctx
  18612. return c
  18613. }
  18614. // Header returns an http.Header that can be modified by the caller to
  18615. // add HTTP headers to the request.
  18616. func (c *CampaignsPatchCall) Header() http.Header {
  18617. if c.header_ == nil {
  18618. c.header_ = make(http.Header)
  18619. }
  18620. return c.header_
  18621. }
  18622. func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) {
  18623. reqHeaders := make(http.Header)
  18624. for k, v := range c.header_ {
  18625. reqHeaders[k] = v
  18626. }
  18627. reqHeaders.Set("User-Agent", c.s.userAgent())
  18628. var body io.Reader = nil
  18629. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18630. if err != nil {
  18631. return nil, err
  18632. }
  18633. reqHeaders.Set("Content-Type", "application/json")
  18634. c.urlParams_.Set("alt", alt)
  18635. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18636. urls += "?" + c.urlParams_.Encode()
  18637. req, _ := http.NewRequest("PATCH", urls, body)
  18638. req.Header = reqHeaders
  18639. googleapi.Expand(req.URL, map[string]string{
  18640. "profileId": strconv.FormatInt(c.profileId, 10),
  18641. })
  18642. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18643. }
  18644. // Do executes the "dfareporting.campaigns.patch" call.
  18645. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18646. // code is an error. Response headers are in either
  18647. // *Campaign.ServerResponse.Header or (if a response was returned at
  18648. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18649. // to check whether the returned error was because
  18650. // http.StatusNotModified was returned.
  18651. func (c *CampaignsPatchCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18652. gensupport.SetOptions(c.urlParams_, opts...)
  18653. res, err := c.doRequest("json")
  18654. if res != nil && res.StatusCode == http.StatusNotModified {
  18655. if res.Body != nil {
  18656. res.Body.Close()
  18657. }
  18658. return nil, &googleapi.Error{
  18659. Code: res.StatusCode,
  18660. Header: res.Header,
  18661. }
  18662. }
  18663. if err != nil {
  18664. return nil, err
  18665. }
  18666. defer googleapi.CloseBody(res)
  18667. if err := googleapi.CheckResponse(res); err != nil {
  18668. return nil, err
  18669. }
  18670. ret := &Campaign{
  18671. ServerResponse: googleapi.ServerResponse{
  18672. Header: res.Header,
  18673. HTTPStatusCode: res.StatusCode,
  18674. },
  18675. }
  18676. target := &ret
  18677. if err := gensupport.DecodeResponse(target, res); err != nil {
  18678. return nil, err
  18679. }
  18680. return ret, nil
  18681. // {
  18682. // "description": "Updates an existing campaign. This method supports patch semantics.",
  18683. // "httpMethod": "PATCH",
  18684. // "id": "dfareporting.campaigns.patch",
  18685. // "parameterOrder": [
  18686. // "profileId",
  18687. // "id"
  18688. // ],
  18689. // "parameters": {
  18690. // "id": {
  18691. // "description": "Campaign ID.",
  18692. // "format": "int64",
  18693. // "location": "query",
  18694. // "required": true,
  18695. // "type": "string"
  18696. // },
  18697. // "profileId": {
  18698. // "description": "User profile ID associated with this request.",
  18699. // "format": "int64",
  18700. // "location": "path",
  18701. // "required": true,
  18702. // "type": "string"
  18703. // }
  18704. // },
  18705. // "path": "userprofiles/{profileId}/campaigns",
  18706. // "request": {
  18707. // "$ref": "Campaign"
  18708. // },
  18709. // "response": {
  18710. // "$ref": "Campaign"
  18711. // },
  18712. // "scopes": [
  18713. // "https://www.googleapis.com/auth/dfatrafficking"
  18714. // ]
  18715. // }
  18716. }
  18717. // method id "dfareporting.campaigns.update":
  18718. type CampaignsUpdateCall struct {
  18719. s *Service
  18720. profileId int64
  18721. campaign *Campaign
  18722. urlParams_ gensupport.URLParams
  18723. ctx_ context.Context
  18724. header_ http.Header
  18725. }
  18726. // Update: Updates an existing campaign.
  18727. func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall {
  18728. c := &CampaignsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18729. c.profileId = profileId
  18730. c.campaign = campaign
  18731. return c
  18732. }
  18733. // Fields allows partial responses to be retrieved. See
  18734. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18735. // for more information.
  18736. func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall {
  18737. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18738. return c
  18739. }
  18740. // Context sets the context to be used in this call's Do method. Any
  18741. // pending HTTP request will be aborted if the provided context is
  18742. // canceled.
  18743. func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall {
  18744. c.ctx_ = ctx
  18745. return c
  18746. }
  18747. // Header returns an http.Header that can be modified by the caller to
  18748. // add HTTP headers to the request.
  18749. func (c *CampaignsUpdateCall) Header() http.Header {
  18750. if c.header_ == nil {
  18751. c.header_ = make(http.Header)
  18752. }
  18753. return c.header_
  18754. }
  18755. func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) {
  18756. reqHeaders := make(http.Header)
  18757. for k, v := range c.header_ {
  18758. reqHeaders[k] = v
  18759. }
  18760. reqHeaders.Set("User-Agent", c.s.userAgent())
  18761. var body io.Reader = nil
  18762. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  18763. if err != nil {
  18764. return nil, err
  18765. }
  18766. reqHeaders.Set("Content-Type", "application/json")
  18767. c.urlParams_.Set("alt", alt)
  18768. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  18769. urls += "?" + c.urlParams_.Encode()
  18770. req, _ := http.NewRequest("PUT", urls, body)
  18771. req.Header = reqHeaders
  18772. googleapi.Expand(req.URL, map[string]string{
  18773. "profileId": strconv.FormatInt(c.profileId, 10),
  18774. })
  18775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18776. }
  18777. // Do executes the "dfareporting.campaigns.update" call.
  18778. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  18779. // code is an error. Response headers are in either
  18780. // *Campaign.ServerResponse.Header or (if a response was returned at
  18781. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18782. // to check whether the returned error was because
  18783. // http.StatusNotModified was returned.
  18784. func (c *CampaignsUpdateCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  18785. gensupport.SetOptions(c.urlParams_, opts...)
  18786. res, err := c.doRequest("json")
  18787. if res != nil && res.StatusCode == http.StatusNotModified {
  18788. if res.Body != nil {
  18789. res.Body.Close()
  18790. }
  18791. return nil, &googleapi.Error{
  18792. Code: res.StatusCode,
  18793. Header: res.Header,
  18794. }
  18795. }
  18796. if err != nil {
  18797. return nil, err
  18798. }
  18799. defer googleapi.CloseBody(res)
  18800. if err := googleapi.CheckResponse(res); err != nil {
  18801. return nil, err
  18802. }
  18803. ret := &Campaign{
  18804. ServerResponse: googleapi.ServerResponse{
  18805. Header: res.Header,
  18806. HTTPStatusCode: res.StatusCode,
  18807. },
  18808. }
  18809. target := &ret
  18810. if err := gensupport.DecodeResponse(target, res); err != nil {
  18811. return nil, err
  18812. }
  18813. return ret, nil
  18814. // {
  18815. // "description": "Updates an existing campaign.",
  18816. // "httpMethod": "PUT",
  18817. // "id": "dfareporting.campaigns.update",
  18818. // "parameterOrder": [
  18819. // "profileId"
  18820. // ],
  18821. // "parameters": {
  18822. // "profileId": {
  18823. // "description": "User profile ID associated with this request.",
  18824. // "format": "int64",
  18825. // "location": "path",
  18826. // "required": true,
  18827. // "type": "string"
  18828. // }
  18829. // },
  18830. // "path": "userprofiles/{profileId}/campaigns",
  18831. // "request": {
  18832. // "$ref": "Campaign"
  18833. // },
  18834. // "response": {
  18835. // "$ref": "Campaign"
  18836. // },
  18837. // "scopes": [
  18838. // "https://www.googleapis.com/auth/dfatrafficking"
  18839. // ]
  18840. // }
  18841. }
  18842. // method id "dfareporting.changeLogs.get":
  18843. type ChangeLogsGetCall struct {
  18844. s *Service
  18845. profileId int64
  18846. id int64
  18847. urlParams_ gensupport.URLParams
  18848. ifNoneMatch_ string
  18849. ctx_ context.Context
  18850. header_ http.Header
  18851. }
  18852. // Get: Gets one change log by ID.
  18853. func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall {
  18854. c := &ChangeLogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18855. c.profileId = profileId
  18856. c.id = id
  18857. return c
  18858. }
  18859. // Fields allows partial responses to be retrieved. See
  18860. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18861. // for more information.
  18862. func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall {
  18863. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18864. return c
  18865. }
  18866. // IfNoneMatch sets the optional parameter which makes the operation
  18867. // fail if the object's ETag matches the given value. This is useful for
  18868. // getting updates only after the object has changed since the last
  18869. // request. Use googleapi.IsNotModified to check whether the response
  18870. // error from Do is the result of In-None-Match.
  18871. func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall {
  18872. c.ifNoneMatch_ = entityTag
  18873. return c
  18874. }
  18875. // Context sets the context to be used in this call's Do method. Any
  18876. // pending HTTP request will be aborted if the provided context is
  18877. // canceled.
  18878. func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall {
  18879. c.ctx_ = ctx
  18880. return c
  18881. }
  18882. // Header returns an http.Header that can be modified by the caller to
  18883. // add HTTP headers to the request.
  18884. func (c *ChangeLogsGetCall) Header() http.Header {
  18885. if c.header_ == nil {
  18886. c.header_ = make(http.Header)
  18887. }
  18888. return c.header_
  18889. }
  18890. func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) {
  18891. reqHeaders := make(http.Header)
  18892. for k, v := range c.header_ {
  18893. reqHeaders[k] = v
  18894. }
  18895. reqHeaders.Set("User-Agent", c.s.userAgent())
  18896. if c.ifNoneMatch_ != "" {
  18897. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18898. }
  18899. var body io.Reader = nil
  18900. c.urlParams_.Set("alt", alt)
  18901. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}")
  18902. urls += "?" + c.urlParams_.Encode()
  18903. req, _ := http.NewRequest("GET", urls, body)
  18904. req.Header = reqHeaders
  18905. googleapi.Expand(req.URL, map[string]string{
  18906. "profileId": strconv.FormatInt(c.profileId, 10),
  18907. "id": strconv.FormatInt(c.id, 10),
  18908. })
  18909. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18910. }
  18911. // Do executes the "dfareporting.changeLogs.get" call.
  18912. // Exactly one of *ChangeLog or error will be non-nil. Any non-2xx
  18913. // status code is an error. Response headers are in either
  18914. // *ChangeLog.ServerResponse.Header or (if a response was returned at
  18915. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  18916. // to check whether the returned error was because
  18917. // http.StatusNotModified was returned.
  18918. func (c *ChangeLogsGetCall) Do(opts ...googleapi.CallOption) (*ChangeLog, error) {
  18919. gensupport.SetOptions(c.urlParams_, opts...)
  18920. res, err := c.doRequest("json")
  18921. if res != nil && res.StatusCode == http.StatusNotModified {
  18922. if res.Body != nil {
  18923. res.Body.Close()
  18924. }
  18925. return nil, &googleapi.Error{
  18926. Code: res.StatusCode,
  18927. Header: res.Header,
  18928. }
  18929. }
  18930. if err != nil {
  18931. return nil, err
  18932. }
  18933. defer googleapi.CloseBody(res)
  18934. if err := googleapi.CheckResponse(res); err != nil {
  18935. return nil, err
  18936. }
  18937. ret := &ChangeLog{
  18938. ServerResponse: googleapi.ServerResponse{
  18939. Header: res.Header,
  18940. HTTPStatusCode: res.StatusCode,
  18941. },
  18942. }
  18943. target := &ret
  18944. if err := gensupport.DecodeResponse(target, res); err != nil {
  18945. return nil, err
  18946. }
  18947. return ret, nil
  18948. // {
  18949. // "description": "Gets one change log by ID.",
  18950. // "httpMethod": "GET",
  18951. // "id": "dfareporting.changeLogs.get",
  18952. // "parameterOrder": [
  18953. // "profileId",
  18954. // "id"
  18955. // ],
  18956. // "parameters": {
  18957. // "id": {
  18958. // "description": "Change log ID.",
  18959. // "format": "int64",
  18960. // "location": "path",
  18961. // "required": true,
  18962. // "type": "string"
  18963. // },
  18964. // "profileId": {
  18965. // "description": "User profile ID associated with this request.",
  18966. // "format": "int64",
  18967. // "location": "path",
  18968. // "required": true,
  18969. // "type": "string"
  18970. // }
  18971. // },
  18972. // "path": "userprofiles/{profileId}/changeLogs/{id}",
  18973. // "response": {
  18974. // "$ref": "ChangeLog"
  18975. // },
  18976. // "scopes": [
  18977. // "https://www.googleapis.com/auth/dfatrafficking"
  18978. // ]
  18979. // }
  18980. }
  18981. // method id "dfareporting.changeLogs.list":
  18982. type ChangeLogsListCall struct {
  18983. s *Service
  18984. profileId int64
  18985. urlParams_ gensupport.URLParams
  18986. ifNoneMatch_ string
  18987. ctx_ context.Context
  18988. header_ http.Header
  18989. }
  18990. // List: Retrieves a list of change logs. This method supports paging.
  18991. func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall {
  18992. c := &ChangeLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18993. c.profileId = profileId
  18994. return c
  18995. }
  18996. // Action sets the optional parameter "action": Select only change logs
  18997. // with the specified action.
  18998. //
  18999. // Possible values:
  19000. // "ACTION_ADD"
  19001. // "ACTION_ASSIGN"
  19002. // "ACTION_ASSOCIATE"
  19003. // "ACTION_CREATE"
  19004. // "ACTION_DELETE"
  19005. // "ACTION_DISABLE"
  19006. // "ACTION_EMAIL_TAGS"
  19007. // "ACTION_ENABLE"
  19008. // "ACTION_LINK"
  19009. // "ACTION_MARK_AS_DEFAULT"
  19010. // "ACTION_PUSH"
  19011. // "ACTION_REMOVE"
  19012. // "ACTION_SEND"
  19013. // "ACTION_SHARE"
  19014. // "ACTION_UNASSIGN"
  19015. // "ACTION_UNLINK"
  19016. // "ACTION_UPDATE"
  19017. func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall {
  19018. c.urlParams_.Set("action", action)
  19019. return c
  19020. }
  19021. // Ids sets the optional parameter "ids": Select only change logs with
  19022. // these IDs.
  19023. func (c *ChangeLogsListCall) Ids(ids ...int64) *ChangeLogsListCall {
  19024. var ids_ []string
  19025. for _, v := range ids {
  19026. ids_ = append(ids_, fmt.Sprint(v))
  19027. }
  19028. c.urlParams_.SetMulti("ids", ids_)
  19029. return c
  19030. }
  19031. // MaxChangeTime sets the optional parameter "maxChangeTime": Select
  19032. // only change logs whose change time is before the specified
  19033. // maxChangeTime.The time should be formatted as an RFC3339 date/time
  19034. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19035. // America/New York time zone, the format is
  19036. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19037. // the letter T, the hour (24-hour clock system), minute, second, and
  19038. // then the time zone offset.
  19039. func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall {
  19040. c.urlParams_.Set("maxChangeTime", maxChangeTime)
  19041. return c
  19042. }
  19043. // MaxResults sets the optional parameter "maxResults": Maximum number
  19044. // of results to return.
  19045. func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall {
  19046. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19047. return c
  19048. }
  19049. // MinChangeTime sets the optional parameter "minChangeTime": Select
  19050. // only change logs whose change time is before the specified
  19051. // minChangeTime.The time should be formatted as an RFC3339 date/time
  19052. // string. For example, for 10:54 PM on July 18th, 2015, in the
  19053. // America/New York time zone, the format is
  19054. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  19055. // the letter T, the hour (24-hour clock system), minute, second, and
  19056. // then the time zone offset.
  19057. func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall {
  19058. c.urlParams_.Set("minChangeTime", minChangeTime)
  19059. return c
  19060. }
  19061. // ObjectIds sets the optional parameter "objectIds": Select only change
  19062. // logs with these object IDs.
  19063. func (c *ChangeLogsListCall) ObjectIds(objectIds ...int64) *ChangeLogsListCall {
  19064. var objectIds_ []string
  19065. for _, v := range objectIds {
  19066. objectIds_ = append(objectIds_, fmt.Sprint(v))
  19067. }
  19068. c.urlParams_.SetMulti("objectIds", objectIds_)
  19069. return c
  19070. }
  19071. // ObjectType sets the optional parameter "objectType": Select only
  19072. // change logs with the specified object type.
  19073. //
  19074. // Possible values:
  19075. // "OBJECT_ACCOUNT"
  19076. // "OBJECT_ACCOUNT_BILLING_FEATURE"
  19077. // "OBJECT_AD"
  19078. // "OBJECT_ADVERTISER"
  19079. // "OBJECT_ADVERTISER_GROUP"
  19080. // "OBJECT_BILLING_ACCOUNT_GROUP"
  19081. // "OBJECT_BILLING_FEATURE"
  19082. // "OBJECT_BILLING_MINIMUM_FEE"
  19083. // "OBJECT_BILLING_PROFILE"
  19084. // "OBJECT_CAMPAIGN"
  19085. // "OBJECT_CONTENT_CATEGORY"
  19086. // "OBJECT_CREATIVE"
  19087. // "OBJECT_CREATIVE_ASSET"
  19088. // "OBJECT_CREATIVE_BUNDLE"
  19089. // "OBJECT_CREATIVE_FIELD"
  19090. // "OBJECT_CREATIVE_GROUP"
  19091. // "OBJECT_DFA_SITE"
  19092. // "OBJECT_EVENT_TAG"
  19093. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP"
  19094. // "OBJECT_FLOODLIGHT_ACTVITY"
  19095. // "OBJECT_FLOODLIGHT_CONFIGURATION"
  19096. // "OBJECT_INSTREAM_CREATIVE"
  19097. // "OBJECT_LANDING_PAGE"
  19098. // "OBJECT_MEDIA_ORDER"
  19099. // "OBJECT_PLACEMENT"
  19100. // "OBJECT_PLACEMENT_STRATEGY"
  19101. // "OBJECT_PLAYSTORE_LINK"
  19102. // "OBJECT_PROVIDED_LIST_CLIENT"
  19103. // "OBJECT_RATE_CARD"
  19104. // "OBJECT_REMARKETING_LIST"
  19105. // "OBJECT_RICHMEDIA_CREATIVE"
  19106. // "OBJECT_SD_SITE"
  19107. // "OBJECT_SEARCH_LIFT_STUDY"
  19108. // "OBJECT_SIZE"
  19109. // "OBJECT_SUBACCOUNT"
  19110. // "OBJECT_TARGETING_TEMPLATE"
  19111. // "OBJECT_USER_PROFILE"
  19112. // "OBJECT_USER_PROFILE_FILTER"
  19113. // "OBJECT_USER_ROLE"
  19114. func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall {
  19115. c.urlParams_.Set("objectType", objectType)
  19116. return c
  19117. }
  19118. // PageToken sets the optional parameter "pageToken": Value of the
  19119. // nextPageToken from the previous result page.
  19120. func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall {
  19121. c.urlParams_.Set("pageToken", pageToken)
  19122. return c
  19123. }
  19124. // SearchString sets the optional parameter "searchString": Select only
  19125. // change logs whose object ID, user name, old or new values match the
  19126. // search string.
  19127. func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall {
  19128. c.urlParams_.Set("searchString", searchString)
  19129. return c
  19130. }
  19131. // UserProfileIds sets the optional parameter "userProfileIds": Select
  19132. // only change logs with these user profile IDs.
  19133. func (c *ChangeLogsListCall) UserProfileIds(userProfileIds ...int64) *ChangeLogsListCall {
  19134. var userProfileIds_ []string
  19135. for _, v := range userProfileIds {
  19136. userProfileIds_ = append(userProfileIds_, fmt.Sprint(v))
  19137. }
  19138. c.urlParams_.SetMulti("userProfileIds", userProfileIds_)
  19139. return c
  19140. }
  19141. // Fields allows partial responses to be retrieved. See
  19142. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19143. // for more information.
  19144. func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall {
  19145. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19146. return c
  19147. }
  19148. // IfNoneMatch sets the optional parameter which makes the operation
  19149. // fail if the object's ETag matches the given value. This is useful for
  19150. // getting updates only after the object has changed since the last
  19151. // request. Use googleapi.IsNotModified to check whether the response
  19152. // error from Do is the result of In-None-Match.
  19153. func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall {
  19154. c.ifNoneMatch_ = entityTag
  19155. return c
  19156. }
  19157. // Context sets the context to be used in this call's Do method. Any
  19158. // pending HTTP request will be aborted if the provided context is
  19159. // canceled.
  19160. func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall {
  19161. c.ctx_ = ctx
  19162. return c
  19163. }
  19164. // Header returns an http.Header that can be modified by the caller to
  19165. // add HTTP headers to the request.
  19166. func (c *ChangeLogsListCall) Header() http.Header {
  19167. if c.header_ == nil {
  19168. c.header_ = make(http.Header)
  19169. }
  19170. return c.header_
  19171. }
  19172. func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) {
  19173. reqHeaders := make(http.Header)
  19174. for k, v := range c.header_ {
  19175. reqHeaders[k] = v
  19176. }
  19177. reqHeaders.Set("User-Agent", c.s.userAgent())
  19178. if c.ifNoneMatch_ != "" {
  19179. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19180. }
  19181. var body io.Reader = nil
  19182. c.urlParams_.Set("alt", alt)
  19183. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs")
  19184. urls += "?" + c.urlParams_.Encode()
  19185. req, _ := http.NewRequest("GET", urls, body)
  19186. req.Header = reqHeaders
  19187. googleapi.Expand(req.URL, map[string]string{
  19188. "profileId": strconv.FormatInt(c.profileId, 10),
  19189. })
  19190. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19191. }
  19192. // Do executes the "dfareporting.changeLogs.list" call.
  19193. // Exactly one of *ChangeLogsListResponse or error will be non-nil. Any
  19194. // non-2xx status code is an error. Response headers are in either
  19195. // *ChangeLogsListResponse.ServerResponse.Header or (if a response was
  19196. // returned at all) in error.(*googleapi.Error).Header. Use
  19197. // googleapi.IsNotModified to check whether the returned error was
  19198. // because http.StatusNotModified was returned.
  19199. func (c *ChangeLogsListCall) Do(opts ...googleapi.CallOption) (*ChangeLogsListResponse, error) {
  19200. gensupport.SetOptions(c.urlParams_, opts...)
  19201. res, err := c.doRequest("json")
  19202. if res != nil && res.StatusCode == http.StatusNotModified {
  19203. if res.Body != nil {
  19204. res.Body.Close()
  19205. }
  19206. return nil, &googleapi.Error{
  19207. Code: res.StatusCode,
  19208. Header: res.Header,
  19209. }
  19210. }
  19211. if err != nil {
  19212. return nil, err
  19213. }
  19214. defer googleapi.CloseBody(res)
  19215. if err := googleapi.CheckResponse(res); err != nil {
  19216. return nil, err
  19217. }
  19218. ret := &ChangeLogsListResponse{
  19219. ServerResponse: googleapi.ServerResponse{
  19220. Header: res.Header,
  19221. HTTPStatusCode: res.StatusCode,
  19222. },
  19223. }
  19224. target := &ret
  19225. if err := gensupport.DecodeResponse(target, res); err != nil {
  19226. return nil, err
  19227. }
  19228. return ret, nil
  19229. // {
  19230. // "description": "Retrieves a list of change logs. This method supports paging.",
  19231. // "httpMethod": "GET",
  19232. // "id": "dfareporting.changeLogs.list",
  19233. // "parameterOrder": [
  19234. // "profileId"
  19235. // ],
  19236. // "parameters": {
  19237. // "action": {
  19238. // "description": "Select only change logs with the specified action.",
  19239. // "enum": [
  19240. // "ACTION_ADD",
  19241. // "ACTION_ASSIGN",
  19242. // "ACTION_ASSOCIATE",
  19243. // "ACTION_CREATE",
  19244. // "ACTION_DELETE",
  19245. // "ACTION_DISABLE",
  19246. // "ACTION_EMAIL_TAGS",
  19247. // "ACTION_ENABLE",
  19248. // "ACTION_LINK",
  19249. // "ACTION_MARK_AS_DEFAULT",
  19250. // "ACTION_PUSH",
  19251. // "ACTION_REMOVE",
  19252. // "ACTION_SEND",
  19253. // "ACTION_SHARE",
  19254. // "ACTION_UNASSIGN",
  19255. // "ACTION_UNLINK",
  19256. // "ACTION_UPDATE"
  19257. // ],
  19258. // "enumDescriptions": [
  19259. // "",
  19260. // "",
  19261. // "",
  19262. // "",
  19263. // "",
  19264. // "",
  19265. // "",
  19266. // "",
  19267. // "",
  19268. // "",
  19269. // "",
  19270. // "",
  19271. // "",
  19272. // "",
  19273. // "",
  19274. // "",
  19275. // ""
  19276. // ],
  19277. // "location": "query",
  19278. // "type": "string"
  19279. // },
  19280. // "ids": {
  19281. // "description": "Select only change logs with these IDs.",
  19282. // "format": "int64",
  19283. // "location": "query",
  19284. // "repeated": true,
  19285. // "type": "string"
  19286. // },
  19287. // "maxChangeTime": {
  19288. // "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.",
  19289. // "location": "query",
  19290. // "type": "string"
  19291. // },
  19292. // "maxResults": {
  19293. // "default": "1000",
  19294. // "description": "Maximum number of results to return.",
  19295. // "format": "int32",
  19296. // "location": "query",
  19297. // "maximum": "1000",
  19298. // "minimum": "0",
  19299. // "type": "integer"
  19300. // },
  19301. // "minChangeTime": {
  19302. // "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.",
  19303. // "location": "query",
  19304. // "type": "string"
  19305. // },
  19306. // "objectIds": {
  19307. // "description": "Select only change logs with these object IDs.",
  19308. // "format": "int64",
  19309. // "location": "query",
  19310. // "repeated": true,
  19311. // "type": "string"
  19312. // },
  19313. // "objectType": {
  19314. // "description": "Select only change logs with the specified object type.",
  19315. // "enum": [
  19316. // "OBJECT_ACCOUNT",
  19317. // "OBJECT_ACCOUNT_BILLING_FEATURE",
  19318. // "OBJECT_AD",
  19319. // "OBJECT_ADVERTISER",
  19320. // "OBJECT_ADVERTISER_GROUP",
  19321. // "OBJECT_BILLING_ACCOUNT_GROUP",
  19322. // "OBJECT_BILLING_FEATURE",
  19323. // "OBJECT_BILLING_MINIMUM_FEE",
  19324. // "OBJECT_BILLING_PROFILE",
  19325. // "OBJECT_CAMPAIGN",
  19326. // "OBJECT_CONTENT_CATEGORY",
  19327. // "OBJECT_CREATIVE",
  19328. // "OBJECT_CREATIVE_ASSET",
  19329. // "OBJECT_CREATIVE_BUNDLE",
  19330. // "OBJECT_CREATIVE_FIELD",
  19331. // "OBJECT_CREATIVE_GROUP",
  19332. // "OBJECT_DFA_SITE",
  19333. // "OBJECT_EVENT_TAG",
  19334. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP",
  19335. // "OBJECT_FLOODLIGHT_ACTVITY",
  19336. // "OBJECT_FLOODLIGHT_CONFIGURATION",
  19337. // "OBJECT_INSTREAM_CREATIVE",
  19338. // "OBJECT_LANDING_PAGE",
  19339. // "OBJECT_MEDIA_ORDER",
  19340. // "OBJECT_PLACEMENT",
  19341. // "OBJECT_PLACEMENT_STRATEGY",
  19342. // "OBJECT_PLAYSTORE_LINK",
  19343. // "OBJECT_PROVIDED_LIST_CLIENT",
  19344. // "OBJECT_RATE_CARD",
  19345. // "OBJECT_REMARKETING_LIST",
  19346. // "OBJECT_RICHMEDIA_CREATIVE",
  19347. // "OBJECT_SD_SITE",
  19348. // "OBJECT_SEARCH_LIFT_STUDY",
  19349. // "OBJECT_SIZE",
  19350. // "OBJECT_SUBACCOUNT",
  19351. // "OBJECT_TARGETING_TEMPLATE",
  19352. // "OBJECT_USER_PROFILE",
  19353. // "OBJECT_USER_PROFILE_FILTER",
  19354. // "OBJECT_USER_ROLE"
  19355. // ],
  19356. // "enumDescriptions": [
  19357. // "",
  19358. // "",
  19359. // "",
  19360. // "",
  19361. // "",
  19362. // "",
  19363. // "",
  19364. // "",
  19365. // "",
  19366. // "",
  19367. // "",
  19368. // "",
  19369. // "",
  19370. // "",
  19371. // "",
  19372. // "",
  19373. // "",
  19374. // "",
  19375. // "",
  19376. // "",
  19377. // "",
  19378. // "",
  19379. // "",
  19380. // "",
  19381. // "",
  19382. // "",
  19383. // "",
  19384. // "",
  19385. // "",
  19386. // "",
  19387. // "",
  19388. // "",
  19389. // "",
  19390. // "",
  19391. // "",
  19392. // "",
  19393. // "",
  19394. // "",
  19395. // ""
  19396. // ],
  19397. // "location": "query",
  19398. // "type": "string"
  19399. // },
  19400. // "pageToken": {
  19401. // "description": "Value of the nextPageToken from the previous result page.",
  19402. // "location": "query",
  19403. // "type": "string"
  19404. // },
  19405. // "profileId": {
  19406. // "description": "User profile ID associated with this request.",
  19407. // "format": "int64",
  19408. // "location": "path",
  19409. // "required": true,
  19410. // "type": "string"
  19411. // },
  19412. // "searchString": {
  19413. // "description": "Select only change logs whose object ID, user name, old or new values match the search string.",
  19414. // "location": "query",
  19415. // "type": "string"
  19416. // },
  19417. // "userProfileIds": {
  19418. // "description": "Select only change logs with these user profile IDs.",
  19419. // "format": "int64",
  19420. // "location": "query",
  19421. // "repeated": true,
  19422. // "type": "string"
  19423. // }
  19424. // },
  19425. // "path": "userprofiles/{profileId}/changeLogs",
  19426. // "response": {
  19427. // "$ref": "ChangeLogsListResponse"
  19428. // },
  19429. // "scopes": [
  19430. // "https://www.googleapis.com/auth/dfatrafficking"
  19431. // ]
  19432. // }
  19433. }
  19434. // Pages invokes f for each page of results.
  19435. // A non-nil error returned from f will halt the iteration.
  19436. // The provided context supersedes any context provided to the Context method.
  19437. func (c *ChangeLogsListCall) Pages(ctx context.Context, f func(*ChangeLogsListResponse) error) error {
  19438. c.ctx_ = ctx
  19439. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19440. for {
  19441. x, err := c.Do()
  19442. if err != nil {
  19443. return err
  19444. }
  19445. if err := f(x); err != nil {
  19446. return err
  19447. }
  19448. if x.NextPageToken == "" {
  19449. return nil
  19450. }
  19451. c.PageToken(x.NextPageToken)
  19452. }
  19453. }
  19454. // method id "dfareporting.cities.list":
  19455. type CitiesListCall struct {
  19456. s *Service
  19457. profileId int64
  19458. urlParams_ gensupport.URLParams
  19459. ifNoneMatch_ string
  19460. ctx_ context.Context
  19461. header_ http.Header
  19462. }
  19463. // List: Retrieves a list of cities, possibly filtered.
  19464. func (r *CitiesService) List(profileId int64) *CitiesListCall {
  19465. c := &CitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19466. c.profileId = profileId
  19467. return c
  19468. }
  19469. // CountryDartIds sets the optional parameter "countryDartIds": Select
  19470. // only cities from these countries.
  19471. func (c *CitiesListCall) CountryDartIds(countryDartIds ...int64) *CitiesListCall {
  19472. var countryDartIds_ []string
  19473. for _, v := range countryDartIds {
  19474. countryDartIds_ = append(countryDartIds_, fmt.Sprint(v))
  19475. }
  19476. c.urlParams_.SetMulti("countryDartIds", countryDartIds_)
  19477. return c
  19478. }
  19479. // DartIds sets the optional parameter "dartIds": Select only cities
  19480. // with these DART IDs.
  19481. func (c *CitiesListCall) DartIds(dartIds ...int64) *CitiesListCall {
  19482. var dartIds_ []string
  19483. for _, v := range dartIds {
  19484. dartIds_ = append(dartIds_, fmt.Sprint(v))
  19485. }
  19486. c.urlParams_.SetMulti("dartIds", dartIds_)
  19487. return c
  19488. }
  19489. // NamePrefix sets the optional parameter "namePrefix": Select only
  19490. // cities with names starting with this prefix.
  19491. func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall {
  19492. c.urlParams_.Set("namePrefix", namePrefix)
  19493. return c
  19494. }
  19495. // RegionDartIds sets the optional parameter "regionDartIds": Select
  19496. // only cities from these regions.
  19497. func (c *CitiesListCall) RegionDartIds(regionDartIds ...int64) *CitiesListCall {
  19498. var regionDartIds_ []string
  19499. for _, v := range regionDartIds {
  19500. regionDartIds_ = append(regionDartIds_, fmt.Sprint(v))
  19501. }
  19502. c.urlParams_.SetMulti("regionDartIds", regionDartIds_)
  19503. return c
  19504. }
  19505. // Fields allows partial responses to be retrieved. See
  19506. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19507. // for more information.
  19508. func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall {
  19509. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19510. return c
  19511. }
  19512. // IfNoneMatch sets the optional parameter which makes the operation
  19513. // fail if the object's ETag matches the given value. This is useful for
  19514. // getting updates only after the object has changed since the last
  19515. // request. Use googleapi.IsNotModified to check whether the response
  19516. // error from Do is the result of In-None-Match.
  19517. func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall {
  19518. c.ifNoneMatch_ = entityTag
  19519. return c
  19520. }
  19521. // Context sets the context to be used in this call's Do method. Any
  19522. // pending HTTP request will be aborted if the provided context is
  19523. // canceled.
  19524. func (c *CitiesListCall) Context(ctx context.Context) *CitiesListCall {
  19525. c.ctx_ = ctx
  19526. return c
  19527. }
  19528. // Header returns an http.Header that can be modified by the caller to
  19529. // add HTTP headers to the request.
  19530. func (c *CitiesListCall) Header() http.Header {
  19531. if c.header_ == nil {
  19532. c.header_ = make(http.Header)
  19533. }
  19534. return c.header_
  19535. }
  19536. func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) {
  19537. reqHeaders := make(http.Header)
  19538. for k, v := range c.header_ {
  19539. reqHeaders[k] = v
  19540. }
  19541. reqHeaders.Set("User-Agent", c.s.userAgent())
  19542. if c.ifNoneMatch_ != "" {
  19543. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19544. }
  19545. var body io.Reader = nil
  19546. c.urlParams_.Set("alt", alt)
  19547. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities")
  19548. urls += "?" + c.urlParams_.Encode()
  19549. req, _ := http.NewRequest("GET", urls, body)
  19550. req.Header = reqHeaders
  19551. googleapi.Expand(req.URL, map[string]string{
  19552. "profileId": strconv.FormatInt(c.profileId, 10),
  19553. })
  19554. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19555. }
  19556. // Do executes the "dfareporting.cities.list" call.
  19557. // Exactly one of *CitiesListResponse or error will be non-nil. Any
  19558. // non-2xx status code is an error. Response headers are in either
  19559. // *CitiesListResponse.ServerResponse.Header or (if a response was
  19560. // returned at all) in error.(*googleapi.Error).Header. Use
  19561. // googleapi.IsNotModified to check whether the returned error was
  19562. // because http.StatusNotModified was returned.
  19563. func (c *CitiesListCall) Do(opts ...googleapi.CallOption) (*CitiesListResponse, error) {
  19564. gensupport.SetOptions(c.urlParams_, opts...)
  19565. res, err := c.doRequest("json")
  19566. if res != nil && res.StatusCode == http.StatusNotModified {
  19567. if res.Body != nil {
  19568. res.Body.Close()
  19569. }
  19570. return nil, &googleapi.Error{
  19571. Code: res.StatusCode,
  19572. Header: res.Header,
  19573. }
  19574. }
  19575. if err != nil {
  19576. return nil, err
  19577. }
  19578. defer googleapi.CloseBody(res)
  19579. if err := googleapi.CheckResponse(res); err != nil {
  19580. return nil, err
  19581. }
  19582. ret := &CitiesListResponse{
  19583. ServerResponse: googleapi.ServerResponse{
  19584. Header: res.Header,
  19585. HTTPStatusCode: res.StatusCode,
  19586. },
  19587. }
  19588. target := &ret
  19589. if err := gensupport.DecodeResponse(target, res); err != nil {
  19590. return nil, err
  19591. }
  19592. return ret, nil
  19593. // {
  19594. // "description": "Retrieves a list of cities, possibly filtered.",
  19595. // "httpMethod": "GET",
  19596. // "id": "dfareporting.cities.list",
  19597. // "parameterOrder": [
  19598. // "profileId"
  19599. // ],
  19600. // "parameters": {
  19601. // "countryDartIds": {
  19602. // "description": "Select only cities from these countries.",
  19603. // "format": "int64",
  19604. // "location": "query",
  19605. // "repeated": true,
  19606. // "type": "string"
  19607. // },
  19608. // "dartIds": {
  19609. // "description": "Select only cities with these DART IDs.",
  19610. // "format": "int64",
  19611. // "location": "query",
  19612. // "repeated": true,
  19613. // "type": "string"
  19614. // },
  19615. // "namePrefix": {
  19616. // "description": "Select only cities with names starting with this prefix.",
  19617. // "location": "query",
  19618. // "type": "string"
  19619. // },
  19620. // "profileId": {
  19621. // "description": "User profile ID associated with this request.",
  19622. // "format": "int64",
  19623. // "location": "path",
  19624. // "required": true,
  19625. // "type": "string"
  19626. // },
  19627. // "regionDartIds": {
  19628. // "description": "Select only cities from these regions.",
  19629. // "format": "int64",
  19630. // "location": "query",
  19631. // "repeated": true,
  19632. // "type": "string"
  19633. // }
  19634. // },
  19635. // "path": "userprofiles/{profileId}/cities",
  19636. // "response": {
  19637. // "$ref": "CitiesListResponse"
  19638. // },
  19639. // "scopes": [
  19640. // "https://www.googleapis.com/auth/dfatrafficking"
  19641. // ]
  19642. // }
  19643. }
  19644. // method id "dfareporting.connectionTypes.get":
  19645. type ConnectionTypesGetCall struct {
  19646. s *Service
  19647. profileId int64
  19648. id int64
  19649. urlParams_ gensupport.URLParams
  19650. ifNoneMatch_ string
  19651. ctx_ context.Context
  19652. header_ http.Header
  19653. }
  19654. // Get: Gets one connection type by ID.
  19655. func (r *ConnectionTypesService) Get(profileId int64, id int64) *ConnectionTypesGetCall {
  19656. c := &ConnectionTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19657. c.profileId = profileId
  19658. c.id = id
  19659. return c
  19660. }
  19661. // Fields allows partial responses to be retrieved. See
  19662. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19663. // for more information.
  19664. func (c *ConnectionTypesGetCall) Fields(s ...googleapi.Field) *ConnectionTypesGetCall {
  19665. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19666. return c
  19667. }
  19668. // IfNoneMatch sets the optional parameter which makes the operation
  19669. // fail if the object's ETag matches the given value. This is useful for
  19670. // getting updates only after the object has changed since the last
  19671. // request. Use googleapi.IsNotModified to check whether the response
  19672. // error from Do is the result of In-None-Match.
  19673. func (c *ConnectionTypesGetCall) IfNoneMatch(entityTag string) *ConnectionTypesGetCall {
  19674. c.ifNoneMatch_ = entityTag
  19675. return c
  19676. }
  19677. // Context sets the context to be used in this call's Do method. Any
  19678. // pending HTTP request will be aborted if the provided context is
  19679. // canceled.
  19680. func (c *ConnectionTypesGetCall) Context(ctx context.Context) *ConnectionTypesGetCall {
  19681. c.ctx_ = ctx
  19682. return c
  19683. }
  19684. // Header returns an http.Header that can be modified by the caller to
  19685. // add HTTP headers to the request.
  19686. func (c *ConnectionTypesGetCall) Header() http.Header {
  19687. if c.header_ == nil {
  19688. c.header_ = make(http.Header)
  19689. }
  19690. return c.header_
  19691. }
  19692. func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) {
  19693. reqHeaders := make(http.Header)
  19694. for k, v := range c.header_ {
  19695. reqHeaders[k] = v
  19696. }
  19697. reqHeaders.Set("User-Agent", c.s.userAgent())
  19698. if c.ifNoneMatch_ != "" {
  19699. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19700. }
  19701. var body io.Reader = nil
  19702. c.urlParams_.Set("alt", alt)
  19703. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes/{id}")
  19704. urls += "?" + c.urlParams_.Encode()
  19705. req, _ := http.NewRequest("GET", urls, body)
  19706. req.Header = reqHeaders
  19707. googleapi.Expand(req.URL, map[string]string{
  19708. "profileId": strconv.FormatInt(c.profileId, 10),
  19709. "id": strconv.FormatInt(c.id, 10),
  19710. })
  19711. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19712. }
  19713. // Do executes the "dfareporting.connectionTypes.get" call.
  19714. // Exactly one of *ConnectionType or error will be non-nil. Any non-2xx
  19715. // status code is an error. Response headers are in either
  19716. // *ConnectionType.ServerResponse.Header or (if a response was returned
  19717. // at all) in error.(*googleapi.Error).Header. Use
  19718. // googleapi.IsNotModified to check whether the returned error was
  19719. // because http.StatusNotModified was returned.
  19720. func (c *ConnectionTypesGetCall) Do(opts ...googleapi.CallOption) (*ConnectionType, error) {
  19721. gensupport.SetOptions(c.urlParams_, opts...)
  19722. res, err := c.doRequest("json")
  19723. if res != nil && res.StatusCode == http.StatusNotModified {
  19724. if res.Body != nil {
  19725. res.Body.Close()
  19726. }
  19727. return nil, &googleapi.Error{
  19728. Code: res.StatusCode,
  19729. Header: res.Header,
  19730. }
  19731. }
  19732. if err != nil {
  19733. return nil, err
  19734. }
  19735. defer googleapi.CloseBody(res)
  19736. if err := googleapi.CheckResponse(res); err != nil {
  19737. return nil, err
  19738. }
  19739. ret := &ConnectionType{
  19740. ServerResponse: googleapi.ServerResponse{
  19741. Header: res.Header,
  19742. HTTPStatusCode: res.StatusCode,
  19743. },
  19744. }
  19745. target := &ret
  19746. if err := gensupport.DecodeResponse(target, res); err != nil {
  19747. return nil, err
  19748. }
  19749. return ret, nil
  19750. // {
  19751. // "description": "Gets one connection type by ID.",
  19752. // "httpMethod": "GET",
  19753. // "id": "dfareporting.connectionTypes.get",
  19754. // "parameterOrder": [
  19755. // "profileId",
  19756. // "id"
  19757. // ],
  19758. // "parameters": {
  19759. // "id": {
  19760. // "description": "Connection type ID.",
  19761. // "format": "int64",
  19762. // "location": "path",
  19763. // "required": true,
  19764. // "type": "string"
  19765. // },
  19766. // "profileId": {
  19767. // "description": "User profile ID associated with this request.",
  19768. // "format": "int64",
  19769. // "location": "path",
  19770. // "required": true,
  19771. // "type": "string"
  19772. // }
  19773. // },
  19774. // "path": "userprofiles/{profileId}/connectionTypes/{id}",
  19775. // "response": {
  19776. // "$ref": "ConnectionType"
  19777. // },
  19778. // "scopes": [
  19779. // "https://www.googleapis.com/auth/dfatrafficking"
  19780. // ]
  19781. // }
  19782. }
  19783. // method id "dfareporting.connectionTypes.list":
  19784. type ConnectionTypesListCall struct {
  19785. s *Service
  19786. profileId int64
  19787. urlParams_ gensupport.URLParams
  19788. ifNoneMatch_ string
  19789. ctx_ context.Context
  19790. header_ http.Header
  19791. }
  19792. // List: Retrieves a list of connection types.
  19793. func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall {
  19794. c := &ConnectionTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19795. c.profileId = profileId
  19796. return c
  19797. }
  19798. // Fields allows partial responses to be retrieved. See
  19799. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19800. // for more information.
  19801. func (c *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall {
  19802. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19803. return c
  19804. }
  19805. // IfNoneMatch sets the optional parameter which makes the operation
  19806. // fail if the object's ETag matches the given value. This is useful for
  19807. // getting updates only after the object has changed since the last
  19808. // request. Use googleapi.IsNotModified to check whether the response
  19809. // error from Do is the result of In-None-Match.
  19810. func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall {
  19811. c.ifNoneMatch_ = entityTag
  19812. return c
  19813. }
  19814. // Context sets the context to be used in this call's Do method. Any
  19815. // pending HTTP request will be aborted if the provided context is
  19816. // canceled.
  19817. func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall {
  19818. c.ctx_ = ctx
  19819. return c
  19820. }
  19821. // Header returns an http.Header that can be modified by the caller to
  19822. // add HTTP headers to the request.
  19823. func (c *ConnectionTypesListCall) Header() http.Header {
  19824. if c.header_ == nil {
  19825. c.header_ = make(http.Header)
  19826. }
  19827. return c.header_
  19828. }
  19829. func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) {
  19830. reqHeaders := make(http.Header)
  19831. for k, v := range c.header_ {
  19832. reqHeaders[k] = v
  19833. }
  19834. reqHeaders.Set("User-Agent", c.s.userAgent())
  19835. if c.ifNoneMatch_ != "" {
  19836. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19837. }
  19838. var body io.Reader = nil
  19839. c.urlParams_.Set("alt", alt)
  19840. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes")
  19841. urls += "?" + c.urlParams_.Encode()
  19842. req, _ := http.NewRequest("GET", urls, body)
  19843. req.Header = reqHeaders
  19844. googleapi.Expand(req.URL, map[string]string{
  19845. "profileId": strconv.FormatInt(c.profileId, 10),
  19846. })
  19847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19848. }
  19849. // Do executes the "dfareporting.connectionTypes.list" call.
  19850. // Exactly one of *ConnectionTypesListResponse or error will be non-nil.
  19851. // Any non-2xx status code is an error. Response headers are in either
  19852. // *ConnectionTypesListResponse.ServerResponse.Header or (if a response
  19853. // was returned at all) in error.(*googleapi.Error).Header. Use
  19854. // googleapi.IsNotModified to check whether the returned error was
  19855. // because http.StatusNotModified was returned.
  19856. func (c *ConnectionTypesListCall) Do(opts ...googleapi.CallOption) (*ConnectionTypesListResponse, error) {
  19857. gensupport.SetOptions(c.urlParams_, opts...)
  19858. res, err := c.doRequest("json")
  19859. if res != nil && res.StatusCode == http.StatusNotModified {
  19860. if res.Body != nil {
  19861. res.Body.Close()
  19862. }
  19863. return nil, &googleapi.Error{
  19864. Code: res.StatusCode,
  19865. Header: res.Header,
  19866. }
  19867. }
  19868. if err != nil {
  19869. return nil, err
  19870. }
  19871. defer googleapi.CloseBody(res)
  19872. if err := googleapi.CheckResponse(res); err != nil {
  19873. return nil, err
  19874. }
  19875. ret := &ConnectionTypesListResponse{
  19876. ServerResponse: googleapi.ServerResponse{
  19877. Header: res.Header,
  19878. HTTPStatusCode: res.StatusCode,
  19879. },
  19880. }
  19881. target := &ret
  19882. if err := gensupport.DecodeResponse(target, res); err != nil {
  19883. return nil, err
  19884. }
  19885. return ret, nil
  19886. // {
  19887. // "description": "Retrieves a list of connection types.",
  19888. // "httpMethod": "GET",
  19889. // "id": "dfareporting.connectionTypes.list",
  19890. // "parameterOrder": [
  19891. // "profileId"
  19892. // ],
  19893. // "parameters": {
  19894. // "profileId": {
  19895. // "description": "User profile ID associated with this request.",
  19896. // "format": "int64",
  19897. // "location": "path",
  19898. // "required": true,
  19899. // "type": "string"
  19900. // }
  19901. // },
  19902. // "path": "userprofiles/{profileId}/connectionTypes",
  19903. // "response": {
  19904. // "$ref": "ConnectionTypesListResponse"
  19905. // },
  19906. // "scopes": [
  19907. // "https://www.googleapis.com/auth/dfatrafficking"
  19908. // ]
  19909. // }
  19910. }
  19911. // method id "dfareporting.contentCategories.delete":
  19912. type ContentCategoriesDeleteCall struct {
  19913. s *Service
  19914. profileId int64
  19915. id int64
  19916. urlParams_ gensupport.URLParams
  19917. ctx_ context.Context
  19918. header_ http.Header
  19919. }
  19920. // Delete: Deletes an existing content category.
  19921. func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall {
  19922. c := &ContentCategoriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19923. c.profileId = profileId
  19924. c.id = id
  19925. return c
  19926. }
  19927. // Fields allows partial responses to be retrieved. See
  19928. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19929. // for more information.
  19930. func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall {
  19931. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19932. return c
  19933. }
  19934. // Context sets the context to be used in this call's Do method. Any
  19935. // pending HTTP request will be aborted if the provided context is
  19936. // canceled.
  19937. func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall {
  19938. c.ctx_ = ctx
  19939. return c
  19940. }
  19941. // Header returns an http.Header that can be modified by the caller to
  19942. // add HTTP headers to the request.
  19943. func (c *ContentCategoriesDeleteCall) Header() http.Header {
  19944. if c.header_ == nil {
  19945. c.header_ = make(http.Header)
  19946. }
  19947. return c.header_
  19948. }
  19949. func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) {
  19950. reqHeaders := make(http.Header)
  19951. for k, v := range c.header_ {
  19952. reqHeaders[k] = v
  19953. }
  19954. reqHeaders.Set("User-Agent", c.s.userAgent())
  19955. var body io.Reader = nil
  19956. c.urlParams_.Set("alt", alt)
  19957. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  19958. urls += "?" + c.urlParams_.Encode()
  19959. req, _ := http.NewRequest("DELETE", urls, body)
  19960. req.Header = reqHeaders
  19961. googleapi.Expand(req.URL, map[string]string{
  19962. "profileId": strconv.FormatInt(c.profileId, 10),
  19963. "id": strconv.FormatInt(c.id, 10),
  19964. })
  19965. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19966. }
  19967. // Do executes the "dfareporting.contentCategories.delete" call.
  19968. func (c *ContentCategoriesDeleteCall) Do(opts ...googleapi.CallOption) error {
  19969. gensupport.SetOptions(c.urlParams_, opts...)
  19970. res, err := c.doRequest("json")
  19971. if err != nil {
  19972. return err
  19973. }
  19974. defer googleapi.CloseBody(res)
  19975. if err := googleapi.CheckResponse(res); err != nil {
  19976. return err
  19977. }
  19978. return nil
  19979. // {
  19980. // "description": "Deletes an existing content category.",
  19981. // "httpMethod": "DELETE",
  19982. // "id": "dfareporting.contentCategories.delete",
  19983. // "parameterOrder": [
  19984. // "profileId",
  19985. // "id"
  19986. // ],
  19987. // "parameters": {
  19988. // "id": {
  19989. // "description": "Content category ID.",
  19990. // "format": "int64",
  19991. // "location": "path",
  19992. // "required": true,
  19993. // "type": "string"
  19994. // },
  19995. // "profileId": {
  19996. // "description": "User profile ID associated with this request.",
  19997. // "format": "int64",
  19998. // "location": "path",
  19999. // "required": true,
  20000. // "type": "string"
  20001. // }
  20002. // },
  20003. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20004. // "scopes": [
  20005. // "https://www.googleapis.com/auth/dfatrafficking"
  20006. // ]
  20007. // }
  20008. }
  20009. // method id "dfareporting.contentCategories.get":
  20010. type ContentCategoriesGetCall struct {
  20011. s *Service
  20012. profileId int64
  20013. id int64
  20014. urlParams_ gensupport.URLParams
  20015. ifNoneMatch_ string
  20016. ctx_ context.Context
  20017. header_ http.Header
  20018. }
  20019. // Get: Gets one content category by ID.
  20020. func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall {
  20021. c := &ContentCategoriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20022. c.profileId = profileId
  20023. c.id = id
  20024. return c
  20025. }
  20026. // Fields allows partial responses to be retrieved. See
  20027. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20028. // for more information.
  20029. func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall {
  20030. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20031. return c
  20032. }
  20033. // IfNoneMatch sets the optional parameter which makes the operation
  20034. // fail if the object's ETag matches the given value. This is useful for
  20035. // getting updates only after the object has changed since the last
  20036. // request. Use googleapi.IsNotModified to check whether the response
  20037. // error from Do is the result of In-None-Match.
  20038. func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall {
  20039. c.ifNoneMatch_ = entityTag
  20040. return c
  20041. }
  20042. // Context sets the context to be used in this call's Do method. Any
  20043. // pending HTTP request will be aborted if the provided context is
  20044. // canceled.
  20045. func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall {
  20046. c.ctx_ = ctx
  20047. return c
  20048. }
  20049. // Header returns an http.Header that can be modified by the caller to
  20050. // add HTTP headers to the request.
  20051. func (c *ContentCategoriesGetCall) Header() http.Header {
  20052. if c.header_ == nil {
  20053. c.header_ = make(http.Header)
  20054. }
  20055. return c.header_
  20056. }
  20057. func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) {
  20058. reqHeaders := make(http.Header)
  20059. for k, v := range c.header_ {
  20060. reqHeaders[k] = v
  20061. }
  20062. reqHeaders.Set("User-Agent", c.s.userAgent())
  20063. if c.ifNoneMatch_ != "" {
  20064. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20065. }
  20066. var body io.Reader = nil
  20067. c.urlParams_.Set("alt", alt)
  20068. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  20069. urls += "?" + c.urlParams_.Encode()
  20070. req, _ := http.NewRequest("GET", urls, body)
  20071. req.Header = reqHeaders
  20072. googleapi.Expand(req.URL, map[string]string{
  20073. "profileId": strconv.FormatInt(c.profileId, 10),
  20074. "id": strconv.FormatInt(c.id, 10),
  20075. })
  20076. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20077. }
  20078. // Do executes the "dfareporting.contentCategories.get" call.
  20079. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20080. // status code is an error. Response headers are in either
  20081. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20082. // at all) in error.(*googleapi.Error).Header. Use
  20083. // googleapi.IsNotModified to check whether the returned error was
  20084. // because http.StatusNotModified was returned.
  20085. func (c *ContentCategoriesGetCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20086. gensupport.SetOptions(c.urlParams_, opts...)
  20087. res, err := c.doRequest("json")
  20088. if res != nil && res.StatusCode == http.StatusNotModified {
  20089. if res.Body != nil {
  20090. res.Body.Close()
  20091. }
  20092. return nil, &googleapi.Error{
  20093. Code: res.StatusCode,
  20094. Header: res.Header,
  20095. }
  20096. }
  20097. if err != nil {
  20098. return nil, err
  20099. }
  20100. defer googleapi.CloseBody(res)
  20101. if err := googleapi.CheckResponse(res); err != nil {
  20102. return nil, err
  20103. }
  20104. ret := &ContentCategory{
  20105. ServerResponse: googleapi.ServerResponse{
  20106. Header: res.Header,
  20107. HTTPStatusCode: res.StatusCode,
  20108. },
  20109. }
  20110. target := &ret
  20111. if err := gensupport.DecodeResponse(target, res); err != nil {
  20112. return nil, err
  20113. }
  20114. return ret, nil
  20115. // {
  20116. // "description": "Gets one content category by ID.",
  20117. // "httpMethod": "GET",
  20118. // "id": "dfareporting.contentCategories.get",
  20119. // "parameterOrder": [
  20120. // "profileId",
  20121. // "id"
  20122. // ],
  20123. // "parameters": {
  20124. // "id": {
  20125. // "description": "Content category ID.",
  20126. // "format": "int64",
  20127. // "location": "path",
  20128. // "required": true,
  20129. // "type": "string"
  20130. // },
  20131. // "profileId": {
  20132. // "description": "User profile ID associated with this request.",
  20133. // "format": "int64",
  20134. // "location": "path",
  20135. // "required": true,
  20136. // "type": "string"
  20137. // }
  20138. // },
  20139. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  20140. // "response": {
  20141. // "$ref": "ContentCategory"
  20142. // },
  20143. // "scopes": [
  20144. // "https://www.googleapis.com/auth/dfatrafficking"
  20145. // ]
  20146. // }
  20147. }
  20148. // method id "dfareporting.contentCategories.insert":
  20149. type ContentCategoriesInsertCall struct {
  20150. s *Service
  20151. profileId int64
  20152. contentcategory *ContentCategory
  20153. urlParams_ gensupport.URLParams
  20154. ctx_ context.Context
  20155. header_ http.Header
  20156. }
  20157. // Insert: Inserts a new content category.
  20158. func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall {
  20159. c := &ContentCategoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20160. c.profileId = profileId
  20161. c.contentcategory = contentcategory
  20162. return c
  20163. }
  20164. // Fields allows partial responses to be retrieved. See
  20165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20166. // for more information.
  20167. func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall {
  20168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20169. return c
  20170. }
  20171. // Context sets the context to be used in this call's Do method. Any
  20172. // pending HTTP request will be aborted if the provided context is
  20173. // canceled.
  20174. func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall {
  20175. c.ctx_ = ctx
  20176. return c
  20177. }
  20178. // Header returns an http.Header that can be modified by the caller to
  20179. // add HTTP headers to the request.
  20180. func (c *ContentCategoriesInsertCall) Header() http.Header {
  20181. if c.header_ == nil {
  20182. c.header_ = make(http.Header)
  20183. }
  20184. return c.header_
  20185. }
  20186. func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) {
  20187. reqHeaders := make(http.Header)
  20188. for k, v := range c.header_ {
  20189. reqHeaders[k] = v
  20190. }
  20191. reqHeaders.Set("User-Agent", c.s.userAgent())
  20192. var body io.Reader = nil
  20193. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20194. if err != nil {
  20195. return nil, err
  20196. }
  20197. reqHeaders.Set("Content-Type", "application/json")
  20198. c.urlParams_.Set("alt", alt)
  20199. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20200. urls += "?" + c.urlParams_.Encode()
  20201. req, _ := http.NewRequest("POST", urls, body)
  20202. req.Header = reqHeaders
  20203. googleapi.Expand(req.URL, map[string]string{
  20204. "profileId": strconv.FormatInt(c.profileId, 10),
  20205. })
  20206. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20207. }
  20208. // Do executes the "dfareporting.contentCategories.insert" call.
  20209. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20210. // status code is an error. Response headers are in either
  20211. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20212. // at all) in error.(*googleapi.Error).Header. Use
  20213. // googleapi.IsNotModified to check whether the returned error was
  20214. // because http.StatusNotModified was returned.
  20215. func (c *ContentCategoriesInsertCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20216. gensupport.SetOptions(c.urlParams_, opts...)
  20217. res, err := c.doRequest("json")
  20218. if res != nil && res.StatusCode == http.StatusNotModified {
  20219. if res.Body != nil {
  20220. res.Body.Close()
  20221. }
  20222. return nil, &googleapi.Error{
  20223. Code: res.StatusCode,
  20224. Header: res.Header,
  20225. }
  20226. }
  20227. if err != nil {
  20228. return nil, err
  20229. }
  20230. defer googleapi.CloseBody(res)
  20231. if err := googleapi.CheckResponse(res); err != nil {
  20232. return nil, err
  20233. }
  20234. ret := &ContentCategory{
  20235. ServerResponse: googleapi.ServerResponse{
  20236. Header: res.Header,
  20237. HTTPStatusCode: res.StatusCode,
  20238. },
  20239. }
  20240. target := &ret
  20241. if err := gensupport.DecodeResponse(target, res); err != nil {
  20242. return nil, err
  20243. }
  20244. return ret, nil
  20245. // {
  20246. // "description": "Inserts a new content category.",
  20247. // "httpMethod": "POST",
  20248. // "id": "dfareporting.contentCategories.insert",
  20249. // "parameterOrder": [
  20250. // "profileId"
  20251. // ],
  20252. // "parameters": {
  20253. // "profileId": {
  20254. // "description": "User profile ID associated with this request.",
  20255. // "format": "int64",
  20256. // "location": "path",
  20257. // "required": true,
  20258. // "type": "string"
  20259. // }
  20260. // },
  20261. // "path": "userprofiles/{profileId}/contentCategories",
  20262. // "request": {
  20263. // "$ref": "ContentCategory"
  20264. // },
  20265. // "response": {
  20266. // "$ref": "ContentCategory"
  20267. // },
  20268. // "scopes": [
  20269. // "https://www.googleapis.com/auth/dfatrafficking"
  20270. // ]
  20271. // }
  20272. }
  20273. // method id "dfareporting.contentCategories.list":
  20274. type ContentCategoriesListCall struct {
  20275. s *Service
  20276. profileId int64
  20277. urlParams_ gensupport.URLParams
  20278. ifNoneMatch_ string
  20279. ctx_ context.Context
  20280. header_ http.Header
  20281. }
  20282. // List: Retrieves a list of content categories, possibly filtered. This
  20283. // method supports paging.
  20284. func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall {
  20285. c := &ContentCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20286. c.profileId = profileId
  20287. return c
  20288. }
  20289. // Ids sets the optional parameter "ids": Select only content categories
  20290. // with these IDs.
  20291. func (c *ContentCategoriesListCall) Ids(ids ...int64) *ContentCategoriesListCall {
  20292. var ids_ []string
  20293. for _, v := range ids {
  20294. ids_ = append(ids_, fmt.Sprint(v))
  20295. }
  20296. c.urlParams_.SetMulti("ids", ids_)
  20297. return c
  20298. }
  20299. // MaxResults sets the optional parameter "maxResults": Maximum number
  20300. // of results to return.
  20301. func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall {
  20302. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20303. return c
  20304. }
  20305. // PageToken sets the optional parameter "pageToken": Value of the
  20306. // nextPageToken from the previous result page.
  20307. func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall {
  20308. c.urlParams_.Set("pageToken", pageToken)
  20309. return c
  20310. }
  20311. // SearchString sets the optional parameter "searchString": Allows
  20312. // searching for objects by name or ID. Wildcards (*) are allowed. For
  20313. // example, "contentcategory*2015" will return objects with names like
  20314. // "contentcategory June 2015", "contentcategory April 2015", or simply
  20315. // "contentcategory 2015". Most of the searches also add wildcards
  20316. // implicitly at the start and the end of the search string. For
  20317. // example, a search string of "contentcategory" will match objects with
  20318. // name "my contentcategory", "contentcategory 2015", or simply
  20319. // "contentcategory".
  20320. func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall {
  20321. c.urlParams_.Set("searchString", searchString)
  20322. return c
  20323. }
  20324. // SortField sets the optional parameter "sortField": Field by which to
  20325. // sort the list.
  20326. //
  20327. // Possible values:
  20328. // "ID" (default)
  20329. // "NAME"
  20330. func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall {
  20331. c.urlParams_.Set("sortField", sortField)
  20332. return c
  20333. }
  20334. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  20335. // results.
  20336. //
  20337. // Possible values:
  20338. // "ASCENDING" (default)
  20339. // "DESCENDING"
  20340. func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall {
  20341. c.urlParams_.Set("sortOrder", sortOrder)
  20342. return c
  20343. }
  20344. // Fields allows partial responses to be retrieved. See
  20345. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20346. // for more information.
  20347. func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall {
  20348. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20349. return c
  20350. }
  20351. // IfNoneMatch sets the optional parameter which makes the operation
  20352. // fail if the object's ETag matches the given value. This is useful for
  20353. // getting updates only after the object has changed since the last
  20354. // request. Use googleapi.IsNotModified to check whether the response
  20355. // error from Do is the result of In-None-Match.
  20356. func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall {
  20357. c.ifNoneMatch_ = entityTag
  20358. return c
  20359. }
  20360. // Context sets the context to be used in this call's Do method. Any
  20361. // pending HTTP request will be aborted if the provided context is
  20362. // canceled.
  20363. func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall {
  20364. c.ctx_ = ctx
  20365. return c
  20366. }
  20367. // Header returns an http.Header that can be modified by the caller to
  20368. // add HTTP headers to the request.
  20369. func (c *ContentCategoriesListCall) Header() http.Header {
  20370. if c.header_ == nil {
  20371. c.header_ = make(http.Header)
  20372. }
  20373. return c.header_
  20374. }
  20375. func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  20376. reqHeaders := make(http.Header)
  20377. for k, v := range c.header_ {
  20378. reqHeaders[k] = v
  20379. }
  20380. reqHeaders.Set("User-Agent", c.s.userAgent())
  20381. if c.ifNoneMatch_ != "" {
  20382. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20383. }
  20384. var body io.Reader = nil
  20385. c.urlParams_.Set("alt", alt)
  20386. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20387. urls += "?" + c.urlParams_.Encode()
  20388. req, _ := http.NewRequest("GET", urls, body)
  20389. req.Header = reqHeaders
  20390. googleapi.Expand(req.URL, map[string]string{
  20391. "profileId": strconv.FormatInt(c.profileId, 10),
  20392. })
  20393. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20394. }
  20395. // Do executes the "dfareporting.contentCategories.list" call.
  20396. // Exactly one of *ContentCategoriesListResponse or error will be
  20397. // non-nil. Any non-2xx status code is an error. Response headers are in
  20398. // either *ContentCategoriesListResponse.ServerResponse.Header or (if a
  20399. // response was returned at all) in error.(*googleapi.Error).Header. Use
  20400. // googleapi.IsNotModified to check whether the returned error was
  20401. // because http.StatusNotModified was returned.
  20402. func (c *ContentCategoriesListCall) Do(opts ...googleapi.CallOption) (*ContentCategoriesListResponse, error) {
  20403. gensupport.SetOptions(c.urlParams_, opts...)
  20404. res, err := c.doRequest("json")
  20405. if res != nil && res.StatusCode == http.StatusNotModified {
  20406. if res.Body != nil {
  20407. res.Body.Close()
  20408. }
  20409. return nil, &googleapi.Error{
  20410. Code: res.StatusCode,
  20411. Header: res.Header,
  20412. }
  20413. }
  20414. if err != nil {
  20415. return nil, err
  20416. }
  20417. defer googleapi.CloseBody(res)
  20418. if err := googleapi.CheckResponse(res); err != nil {
  20419. return nil, err
  20420. }
  20421. ret := &ContentCategoriesListResponse{
  20422. ServerResponse: googleapi.ServerResponse{
  20423. Header: res.Header,
  20424. HTTPStatusCode: res.StatusCode,
  20425. },
  20426. }
  20427. target := &ret
  20428. if err := gensupport.DecodeResponse(target, res); err != nil {
  20429. return nil, err
  20430. }
  20431. return ret, nil
  20432. // {
  20433. // "description": "Retrieves a list of content categories, possibly filtered. This method supports paging.",
  20434. // "httpMethod": "GET",
  20435. // "id": "dfareporting.contentCategories.list",
  20436. // "parameterOrder": [
  20437. // "profileId"
  20438. // ],
  20439. // "parameters": {
  20440. // "ids": {
  20441. // "description": "Select only content categories with these IDs.",
  20442. // "format": "int64",
  20443. // "location": "query",
  20444. // "repeated": true,
  20445. // "type": "string"
  20446. // },
  20447. // "maxResults": {
  20448. // "default": "1000",
  20449. // "description": "Maximum number of results to return.",
  20450. // "format": "int32",
  20451. // "location": "query",
  20452. // "maximum": "1000",
  20453. // "minimum": "0",
  20454. // "type": "integer"
  20455. // },
  20456. // "pageToken": {
  20457. // "description": "Value of the nextPageToken from the previous result page.",
  20458. // "location": "query",
  20459. // "type": "string"
  20460. // },
  20461. // "profileId": {
  20462. // "description": "User profile ID associated with this request.",
  20463. // "format": "int64",
  20464. // "location": "path",
  20465. // "required": true,
  20466. // "type": "string"
  20467. // },
  20468. // "searchString": {
  20469. // "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\".",
  20470. // "location": "query",
  20471. // "type": "string"
  20472. // },
  20473. // "sortField": {
  20474. // "default": "ID",
  20475. // "description": "Field by which to sort the list.",
  20476. // "enum": [
  20477. // "ID",
  20478. // "NAME"
  20479. // ],
  20480. // "enumDescriptions": [
  20481. // "",
  20482. // ""
  20483. // ],
  20484. // "location": "query",
  20485. // "type": "string"
  20486. // },
  20487. // "sortOrder": {
  20488. // "default": "ASCENDING",
  20489. // "description": "Order of sorted results.",
  20490. // "enum": [
  20491. // "ASCENDING",
  20492. // "DESCENDING"
  20493. // ],
  20494. // "enumDescriptions": [
  20495. // "",
  20496. // ""
  20497. // ],
  20498. // "location": "query",
  20499. // "type": "string"
  20500. // }
  20501. // },
  20502. // "path": "userprofiles/{profileId}/contentCategories",
  20503. // "response": {
  20504. // "$ref": "ContentCategoriesListResponse"
  20505. // },
  20506. // "scopes": [
  20507. // "https://www.googleapis.com/auth/dfatrafficking"
  20508. // ]
  20509. // }
  20510. }
  20511. // Pages invokes f for each page of results.
  20512. // A non-nil error returned from f will halt the iteration.
  20513. // The provided context supersedes any context provided to the Context method.
  20514. func (c *ContentCategoriesListCall) Pages(ctx context.Context, f func(*ContentCategoriesListResponse) error) error {
  20515. c.ctx_ = ctx
  20516. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  20517. for {
  20518. x, err := c.Do()
  20519. if err != nil {
  20520. return err
  20521. }
  20522. if err := f(x); err != nil {
  20523. return err
  20524. }
  20525. if x.NextPageToken == "" {
  20526. return nil
  20527. }
  20528. c.PageToken(x.NextPageToken)
  20529. }
  20530. }
  20531. // method id "dfareporting.contentCategories.patch":
  20532. type ContentCategoriesPatchCall struct {
  20533. s *Service
  20534. profileId int64
  20535. contentcategory *ContentCategory
  20536. urlParams_ gensupport.URLParams
  20537. ctx_ context.Context
  20538. header_ http.Header
  20539. }
  20540. // Patch: Updates an existing content category. This method supports
  20541. // patch semantics.
  20542. func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall {
  20543. c := &ContentCategoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20544. c.profileId = profileId
  20545. c.urlParams_.Set("id", fmt.Sprint(id))
  20546. c.contentcategory = contentcategory
  20547. return c
  20548. }
  20549. // Fields allows partial responses to be retrieved. See
  20550. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20551. // for more information.
  20552. func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall {
  20553. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20554. return c
  20555. }
  20556. // Context sets the context to be used in this call's Do method. Any
  20557. // pending HTTP request will be aborted if the provided context is
  20558. // canceled.
  20559. func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall {
  20560. c.ctx_ = ctx
  20561. return c
  20562. }
  20563. // Header returns an http.Header that can be modified by the caller to
  20564. // add HTTP headers to the request.
  20565. func (c *ContentCategoriesPatchCall) Header() http.Header {
  20566. if c.header_ == nil {
  20567. c.header_ = make(http.Header)
  20568. }
  20569. return c.header_
  20570. }
  20571. func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) {
  20572. reqHeaders := make(http.Header)
  20573. for k, v := range c.header_ {
  20574. reqHeaders[k] = v
  20575. }
  20576. reqHeaders.Set("User-Agent", c.s.userAgent())
  20577. var body io.Reader = nil
  20578. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20579. if err != nil {
  20580. return nil, err
  20581. }
  20582. reqHeaders.Set("Content-Type", "application/json")
  20583. c.urlParams_.Set("alt", alt)
  20584. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20585. urls += "?" + c.urlParams_.Encode()
  20586. req, _ := http.NewRequest("PATCH", urls, body)
  20587. req.Header = reqHeaders
  20588. googleapi.Expand(req.URL, map[string]string{
  20589. "profileId": strconv.FormatInt(c.profileId, 10),
  20590. })
  20591. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20592. }
  20593. // Do executes the "dfareporting.contentCategories.patch" call.
  20594. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20595. // status code is an error. Response headers are in either
  20596. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20597. // at all) in error.(*googleapi.Error).Header. Use
  20598. // googleapi.IsNotModified to check whether the returned error was
  20599. // because http.StatusNotModified was returned.
  20600. func (c *ContentCategoriesPatchCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20601. gensupport.SetOptions(c.urlParams_, opts...)
  20602. res, err := c.doRequest("json")
  20603. if res != nil && res.StatusCode == http.StatusNotModified {
  20604. if res.Body != nil {
  20605. res.Body.Close()
  20606. }
  20607. return nil, &googleapi.Error{
  20608. Code: res.StatusCode,
  20609. Header: res.Header,
  20610. }
  20611. }
  20612. if err != nil {
  20613. return nil, err
  20614. }
  20615. defer googleapi.CloseBody(res)
  20616. if err := googleapi.CheckResponse(res); err != nil {
  20617. return nil, err
  20618. }
  20619. ret := &ContentCategory{
  20620. ServerResponse: googleapi.ServerResponse{
  20621. Header: res.Header,
  20622. HTTPStatusCode: res.StatusCode,
  20623. },
  20624. }
  20625. target := &ret
  20626. if err := gensupport.DecodeResponse(target, res); err != nil {
  20627. return nil, err
  20628. }
  20629. return ret, nil
  20630. // {
  20631. // "description": "Updates an existing content category. This method supports patch semantics.",
  20632. // "httpMethod": "PATCH",
  20633. // "id": "dfareporting.contentCategories.patch",
  20634. // "parameterOrder": [
  20635. // "profileId",
  20636. // "id"
  20637. // ],
  20638. // "parameters": {
  20639. // "id": {
  20640. // "description": "Content category ID.",
  20641. // "format": "int64",
  20642. // "location": "query",
  20643. // "required": true,
  20644. // "type": "string"
  20645. // },
  20646. // "profileId": {
  20647. // "description": "User profile ID associated with this request.",
  20648. // "format": "int64",
  20649. // "location": "path",
  20650. // "required": true,
  20651. // "type": "string"
  20652. // }
  20653. // },
  20654. // "path": "userprofiles/{profileId}/contentCategories",
  20655. // "request": {
  20656. // "$ref": "ContentCategory"
  20657. // },
  20658. // "response": {
  20659. // "$ref": "ContentCategory"
  20660. // },
  20661. // "scopes": [
  20662. // "https://www.googleapis.com/auth/dfatrafficking"
  20663. // ]
  20664. // }
  20665. }
  20666. // method id "dfareporting.contentCategories.update":
  20667. type ContentCategoriesUpdateCall struct {
  20668. s *Service
  20669. profileId int64
  20670. contentcategory *ContentCategory
  20671. urlParams_ gensupport.URLParams
  20672. ctx_ context.Context
  20673. header_ http.Header
  20674. }
  20675. // Update: Updates an existing content category.
  20676. func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall {
  20677. c := &ContentCategoriesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20678. c.profileId = profileId
  20679. c.contentcategory = contentcategory
  20680. return c
  20681. }
  20682. // Fields allows partial responses to be retrieved. See
  20683. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20684. // for more information.
  20685. func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall {
  20686. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20687. return c
  20688. }
  20689. // Context sets the context to be used in this call's Do method. Any
  20690. // pending HTTP request will be aborted if the provided context is
  20691. // canceled.
  20692. func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall {
  20693. c.ctx_ = ctx
  20694. return c
  20695. }
  20696. // Header returns an http.Header that can be modified by the caller to
  20697. // add HTTP headers to the request.
  20698. func (c *ContentCategoriesUpdateCall) Header() http.Header {
  20699. if c.header_ == nil {
  20700. c.header_ = make(http.Header)
  20701. }
  20702. return c.header_
  20703. }
  20704. func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) {
  20705. reqHeaders := make(http.Header)
  20706. for k, v := range c.header_ {
  20707. reqHeaders[k] = v
  20708. }
  20709. reqHeaders.Set("User-Agent", c.s.userAgent())
  20710. var body io.Reader = nil
  20711. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  20712. if err != nil {
  20713. return nil, err
  20714. }
  20715. reqHeaders.Set("Content-Type", "application/json")
  20716. c.urlParams_.Set("alt", alt)
  20717. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  20718. urls += "?" + c.urlParams_.Encode()
  20719. req, _ := http.NewRequest("PUT", urls, body)
  20720. req.Header = reqHeaders
  20721. googleapi.Expand(req.URL, map[string]string{
  20722. "profileId": strconv.FormatInt(c.profileId, 10),
  20723. })
  20724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20725. }
  20726. // Do executes the "dfareporting.contentCategories.update" call.
  20727. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  20728. // status code is an error. Response headers are in either
  20729. // *ContentCategory.ServerResponse.Header or (if a response was returned
  20730. // at all) in error.(*googleapi.Error).Header. Use
  20731. // googleapi.IsNotModified to check whether the returned error was
  20732. // because http.StatusNotModified was returned.
  20733. func (c *ContentCategoriesUpdateCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  20734. gensupport.SetOptions(c.urlParams_, opts...)
  20735. res, err := c.doRequest("json")
  20736. if res != nil && res.StatusCode == http.StatusNotModified {
  20737. if res.Body != nil {
  20738. res.Body.Close()
  20739. }
  20740. return nil, &googleapi.Error{
  20741. Code: res.StatusCode,
  20742. Header: res.Header,
  20743. }
  20744. }
  20745. if err != nil {
  20746. return nil, err
  20747. }
  20748. defer googleapi.CloseBody(res)
  20749. if err := googleapi.CheckResponse(res); err != nil {
  20750. return nil, err
  20751. }
  20752. ret := &ContentCategory{
  20753. ServerResponse: googleapi.ServerResponse{
  20754. Header: res.Header,
  20755. HTTPStatusCode: res.StatusCode,
  20756. },
  20757. }
  20758. target := &ret
  20759. if err := gensupport.DecodeResponse(target, res); err != nil {
  20760. return nil, err
  20761. }
  20762. return ret, nil
  20763. // {
  20764. // "description": "Updates an existing content category.",
  20765. // "httpMethod": "PUT",
  20766. // "id": "dfareporting.contentCategories.update",
  20767. // "parameterOrder": [
  20768. // "profileId"
  20769. // ],
  20770. // "parameters": {
  20771. // "profileId": {
  20772. // "description": "User profile ID associated with this request.",
  20773. // "format": "int64",
  20774. // "location": "path",
  20775. // "required": true,
  20776. // "type": "string"
  20777. // }
  20778. // },
  20779. // "path": "userprofiles/{profileId}/contentCategories",
  20780. // "request": {
  20781. // "$ref": "ContentCategory"
  20782. // },
  20783. // "response": {
  20784. // "$ref": "ContentCategory"
  20785. // },
  20786. // "scopes": [
  20787. // "https://www.googleapis.com/auth/dfatrafficking"
  20788. // ]
  20789. // }
  20790. }
  20791. // method id "dfareporting.conversions.batchinsert":
  20792. type ConversionsBatchinsertCall struct {
  20793. s *Service
  20794. profileId int64
  20795. conversionsbatchinsertrequest *ConversionsBatchInsertRequest
  20796. urlParams_ gensupport.URLParams
  20797. ctx_ context.Context
  20798. header_ http.Header
  20799. }
  20800. // Batchinsert: Inserts conversions.
  20801. func (r *ConversionsService) Batchinsert(profileId int64, conversionsbatchinsertrequest *ConversionsBatchInsertRequest) *ConversionsBatchinsertCall {
  20802. c := &ConversionsBatchinsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20803. c.profileId = profileId
  20804. c.conversionsbatchinsertrequest = conversionsbatchinsertrequest
  20805. return c
  20806. }
  20807. // Fields allows partial responses to be retrieved. See
  20808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20809. // for more information.
  20810. func (c *ConversionsBatchinsertCall) Fields(s ...googleapi.Field) *ConversionsBatchinsertCall {
  20811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20812. return c
  20813. }
  20814. // Context sets the context to be used in this call's Do method. Any
  20815. // pending HTTP request will be aborted if the provided context is
  20816. // canceled.
  20817. func (c *ConversionsBatchinsertCall) Context(ctx context.Context) *ConversionsBatchinsertCall {
  20818. c.ctx_ = ctx
  20819. return c
  20820. }
  20821. // Header returns an http.Header that can be modified by the caller to
  20822. // add HTTP headers to the request.
  20823. func (c *ConversionsBatchinsertCall) Header() http.Header {
  20824. if c.header_ == nil {
  20825. c.header_ = make(http.Header)
  20826. }
  20827. return c.header_
  20828. }
  20829. func (c *ConversionsBatchinsertCall) doRequest(alt string) (*http.Response, error) {
  20830. reqHeaders := make(http.Header)
  20831. for k, v := range c.header_ {
  20832. reqHeaders[k] = v
  20833. }
  20834. reqHeaders.Set("User-Agent", c.s.userAgent())
  20835. var body io.Reader = nil
  20836. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchinsertrequest)
  20837. if err != nil {
  20838. return nil, err
  20839. }
  20840. reqHeaders.Set("Content-Type", "application/json")
  20841. c.urlParams_.Set("alt", alt)
  20842. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchinsert")
  20843. urls += "?" + c.urlParams_.Encode()
  20844. req, _ := http.NewRequest("POST", urls, body)
  20845. req.Header = reqHeaders
  20846. googleapi.Expand(req.URL, map[string]string{
  20847. "profileId": strconv.FormatInt(c.profileId, 10),
  20848. })
  20849. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20850. }
  20851. // Do executes the "dfareporting.conversions.batchinsert" call.
  20852. // Exactly one of *ConversionsBatchInsertResponse or error will be
  20853. // non-nil. Any non-2xx status code is an error. Response headers are in
  20854. // either *ConversionsBatchInsertResponse.ServerResponse.Header or (if a
  20855. // response was returned at all) in error.(*googleapi.Error).Header. Use
  20856. // googleapi.IsNotModified to check whether the returned error was
  20857. // because http.StatusNotModified was returned.
  20858. func (c *ConversionsBatchinsertCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchInsertResponse, error) {
  20859. gensupport.SetOptions(c.urlParams_, opts...)
  20860. res, err := c.doRequest("json")
  20861. if res != nil && res.StatusCode == http.StatusNotModified {
  20862. if res.Body != nil {
  20863. res.Body.Close()
  20864. }
  20865. return nil, &googleapi.Error{
  20866. Code: res.StatusCode,
  20867. Header: res.Header,
  20868. }
  20869. }
  20870. if err != nil {
  20871. return nil, err
  20872. }
  20873. defer googleapi.CloseBody(res)
  20874. if err := googleapi.CheckResponse(res); err != nil {
  20875. return nil, err
  20876. }
  20877. ret := &ConversionsBatchInsertResponse{
  20878. ServerResponse: googleapi.ServerResponse{
  20879. Header: res.Header,
  20880. HTTPStatusCode: res.StatusCode,
  20881. },
  20882. }
  20883. target := &ret
  20884. if err := gensupport.DecodeResponse(target, res); err != nil {
  20885. return nil, err
  20886. }
  20887. return ret, nil
  20888. // {
  20889. // "description": "Inserts conversions.",
  20890. // "httpMethod": "POST",
  20891. // "id": "dfareporting.conversions.batchinsert",
  20892. // "parameterOrder": [
  20893. // "profileId"
  20894. // ],
  20895. // "parameters": {
  20896. // "profileId": {
  20897. // "description": "User profile ID associated with this request.",
  20898. // "format": "int64",
  20899. // "location": "path",
  20900. // "required": true,
  20901. // "type": "string"
  20902. // }
  20903. // },
  20904. // "path": "userprofiles/{profileId}/conversions/batchinsert",
  20905. // "request": {
  20906. // "$ref": "ConversionsBatchInsertRequest"
  20907. // },
  20908. // "response": {
  20909. // "$ref": "ConversionsBatchInsertResponse"
  20910. // },
  20911. // "scopes": [
  20912. // "https://www.googleapis.com/auth/ddmconversions"
  20913. // ]
  20914. // }
  20915. }
  20916. // method id "dfareporting.conversions.batchupdate":
  20917. type ConversionsBatchupdateCall struct {
  20918. s *Service
  20919. profileId int64
  20920. conversionsbatchupdaterequest *ConversionsBatchUpdateRequest
  20921. urlParams_ gensupport.URLParams
  20922. ctx_ context.Context
  20923. header_ http.Header
  20924. }
  20925. // Batchupdate: Updates existing conversions.
  20926. func (r *ConversionsService) Batchupdate(profileId int64, conversionsbatchupdaterequest *ConversionsBatchUpdateRequest) *ConversionsBatchupdateCall {
  20927. c := &ConversionsBatchupdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20928. c.profileId = profileId
  20929. c.conversionsbatchupdaterequest = conversionsbatchupdaterequest
  20930. return c
  20931. }
  20932. // Fields allows partial responses to be retrieved. See
  20933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20934. // for more information.
  20935. func (c *ConversionsBatchupdateCall) Fields(s ...googleapi.Field) *ConversionsBatchupdateCall {
  20936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20937. return c
  20938. }
  20939. // Context sets the context to be used in this call's Do method. Any
  20940. // pending HTTP request will be aborted if the provided context is
  20941. // canceled.
  20942. func (c *ConversionsBatchupdateCall) Context(ctx context.Context) *ConversionsBatchupdateCall {
  20943. c.ctx_ = ctx
  20944. return c
  20945. }
  20946. // Header returns an http.Header that can be modified by the caller to
  20947. // add HTTP headers to the request.
  20948. func (c *ConversionsBatchupdateCall) Header() http.Header {
  20949. if c.header_ == nil {
  20950. c.header_ = make(http.Header)
  20951. }
  20952. return c.header_
  20953. }
  20954. func (c *ConversionsBatchupdateCall) doRequest(alt string) (*http.Response, error) {
  20955. reqHeaders := make(http.Header)
  20956. for k, v := range c.header_ {
  20957. reqHeaders[k] = v
  20958. }
  20959. reqHeaders.Set("User-Agent", c.s.userAgent())
  20960. var body io.Reader = nil
  20961. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchupdaterequest)
  20962. if err != nil {
  20963. return nil, err
  20964. }
  20965. reqHeaders.Set("Content-Type", "application/json")
  20966. c.urlParams_.Set("alt", alt)
  20967. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchupdate")
  20968. urls += "?" + c.urlParams_.Encode()
  20969. req, _ := http.NewRequest("POST", urls, body)
  20970. req.Header = reqHeaders
  20971. googleapi.Expand(req.URL, map[string]string{
  20972. "profileId": strconv.FormatInt(c.profileId, 10),
  20973. })
  20974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20975. }
  20976. // Do executes the "dfareporting.conversions.batchupdate" call.
  20977. // Exactly one of *ConversionsBatchUpdateResponse or error will be
  20978. // non-nil. Any non-2xx status code is an error. Response headers are in
  20979. // either *ConversionsBatchUpdateResponse.ServerResponse.Header or (if a
  20980. // response was returned at all) in error.(*googleapi.Error).Header. Use
  20981. // googleapi.IsNotModified to check whether the returned error was
  20982. // because http.StatusNotModified was returned.
  20983. func (c *ConversionsBatchupdateCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchUpdateResponse, error) {
  20984. gensupport.SetOptions(c.urlParams_, opts...)
  20985. res, err := c.doRequest("json")
  20986. if res != nil && res.StatusCode == http.StatusNotModified {
  20987. if res.Body != nil {
  20988. res.Body.Close()
  20989. }
  20990. return nil, &googleapi.Error{
  20991. Code: res.StatusCode,
  20992. Header: res.Header,
  20993. }
  20994. }
  20995. if err != nil {
  20996. return nil, err
  20997. }
  20998. defer googleapi.CloseBody(res)
  20999. if err := googleapi.CheckResponse(res); err != nil {
  21000. return nil, err
  21001. }
  21002. ret := &ConversionsBatchUpdateResponse{
  21003. ServerResponse: googleapi.ServerResponse{
  21004. Header: res.Header,
  21005. HTTPStatusCode: res.StatusCode,
  21006. },
  21007. }
  21008. target := &ret
  21009. if err := gensupport.DecodeResponse(target, res); err != nil {
  21010. return nil, err
  21011. }
  21012. return ret, nil
  21013. // {
  21014. // "description": "Updates existing conversions.",
  21015. // "httpMethod": "POST",
  21016. // "id": "dfareporting.conversions.batchupdate",
  21017. // "parameterOrder": [
  21018. // "profileId"
  21019. // ],
  21020. // "parameters": {
  21021. // "profileId": {
  21022. // "description": "User profile ID associated with this request.",
  21023. // "format": "int64",
  21024. // "location": "path",
  21025. // "required": true,
  21026. // "type": "string"
  21027. // }
  21028. // },
  21029. // "path": "userprofiles/{profileId}/conversions/batchupdate",
  21030. // "request": {
  21031. // "$ref": "ConversionsBatchUpdateRequest"
  21032. // },
  21033. // "response": {
  21034. // "$ref": "ConversionsBatchUpdateResponse"
  21035. // },
  21036. // "scopes": [
  21037. // "https://www.googleapis.com/auth/ddmconversions"
  21038. // ]
  21039. // }
  21040. }
  21041. // method id "dfareporting.countries.get":
  21042. type CountriesGetCall struct {
  21043. s *Service
  21044. profileId int64
  21045. dartId int64
  21046. urlParams_ gensupport.URLParams
  21047. ifNoneMatch_ string
  21048. ctx_ context.Context
  21049. header_ http.Header
  21050. }
  21051. // Get: Gets one country by ID.
  21052. func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall {
  21053. c := &CountriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21054. c.profileId = profileId
  21055. c.dartId = dartId
  21056. return c
  21057. }
  21058. // Fields allows partial responses to be retrieved. See
  21059. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21060. // for more information.
  21061. func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall {
  21062. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21063. return c
  21064. }
  21065. // IfNoneMatch sets the optional parameter which makes the operation
  21066. // fail if the object's ETag matches the given value. This is useful for
  21067. // getting updates only after the object has changed since the last
  21068. // request. Use googleapi.IsNotModified to check whether the response
  21069. // error from Do is the result of In-None-Match.
  21070. func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall {
  21071. c.ifNoneMatch_ = entityTag
  21072. return c
  21073. }
  21074. // Context sets the context to be used in this call's Do method. Any
  21075. // pending HTTP request will be aborted if the provided context is
  21076. // canceled.
  21077. func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall {
  21078. c.ctx_ = ctx
  21079. return c
  21080. }
  21081. // Header returns an http.Header that can be modified by the caller to
  21082. // add HTTP headers to the request.
  21083. func (c *CountriesGetCall) Header() http.Header {
  21084. if c.header_ == nil {
  21085. c.header_ = make(http.Header)
  21086. }
  21087. return c.header_
  21088. }
  21089. func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) {
  21090. reqHeaders := make(http.Header)
  21091. for k, v := range c.header_ {
  21092. reqHeaders[k] = v
  21093. }
  21094. reqHeaders.Set("User-Agent", c.s.userAgent())
  21095. if c.ifNoneMatch_ != "" {
  21096. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21097. }
  21098. var body io.Reader = nil
  21099. c.urlParams_.Set("alt", alt)
  21100. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}")
  21101. urls += "?" + c.urlParams_.Encode()
  21102. req, _ := http.NewRequest("GET", urls, body)
  21103. req.Header = reqHeaders
  21104. googleapi.Expand(req.URL, map[string]string{
  21105. "profileId": strconv.FormatInt(c.profileId, 10),
  21106. "dartId": strconv.FormatInt(c.dartId, 10),
  21107. })
  21108. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21109. }
  21110. // Do executes the "dfareporting.countries.get" call.
  21111. // Exactly one of *Country or error will be non-nil. Any non-2xx status
  21112. // code is an error. Response headers are in either
  21113. // *Country.ServerResponse.Header or (if a response was returned at all)
  21114. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  21115. // check whether the returned error was because http.StatusNotModified
  21116. // was returned.
  21117. func (c *CountriesGetCall) Do(opts ...googleapi.CallOption) (*Country, error) {
  21118. gensupport.SetOptions(c.urlParams_, opts...)
  21119. res, err := c.doRequest("json")
  21120. if res != nil && res.StatusCode == http.StatusNotModified {
  21121. if res.Body != nil {
  21122. res.Body.Close()
  21123. }
  21124. return nil, &googleapi.Error{
  21125. Code: res.StatusCode,
  21126. Header: res.Header,
  21127. }
  21128. }
  21129. if err != nil {
  21130. return nil, err
  21131. }
  21132. defer googleapi.CloseBody(res)
  21133. if err := googleapi.CheckResponse(res); err != nil {
  21134. return nil, err
  21135. }
  21136. ret := &Country{
  21137. ServerResponse: googleapi.ServerResponse{
  21138. Header: res.Header,
  21139. HTTPStatusCode: res.StatusCode,
  21140. },
  21141. }
  21142. target := &ret
  21143. if err := gensupport.DecodeResponse(target, res); err != nil {
  21144. return nil, err
  21145. }
  21146. return ret, nil
  21147. // {
  21148. // "description": "Gets one country by ID.",
  21149. // "httpMethod": "GET",
  21150. // "id": "dfareporting.countries.get",
  21151. // "parameterOrder": [
  21152. // "profileId",
  21153. // "dartId"
  21154. // ],
  21155. // "parameters": {
  21156. // "dartId": {
  21157. // "description": "Country DART ID.",
  21158. // "format": "int64",
  21159. // "location": "path",
  21160. // "required": true,
  21161. // "type": "string"
  21162. // },
  21163. // "profileId": {
  21164. // "description": "User profile ID associated with this request.",
  21165. // "format": "int64",
  21166. // "location": "path",
  21167. // "required": true,
  21168. // "type": "string"
  21169. // }
  21170. // },
  21171. // "path": "userprofiles/{profileId}/countries/{dartId}",
  21172. // "response": {
  21173. // "$ref": "Country"
  21174. // },
  21175. // "scopes": [
  21176. // "https://www.googleapis.com/auth/dfatrafficking"
  21177. // ]
  21178. // }
  21179. }
  21180. // method id "dfareporting.countries.list":
  21181. type CountriesListCall struct {
  21182. s *Service
  21183. profileId int64
  21184. urlParams_ gensupport.URLParams
  21185. ifNoneMatch_ string
  21186. ctx_ context.Context
  21187. header_ http.Header
  21188. }
  21189. // List: Retrieves a list of countries.
  21190. func (r *CountriesService) List(profileId int64) *CountriesListCall {
  21191. c := &CountriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21192. c.profileId = profileId
  21193. return c
  21194. }
  21195. // Fields allows partial responses to be retrieved. See
  21196. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21197. // for more information.
  21198. func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall {
  21199. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21200. return c
  21201. }
  21202. // IfNoneMatch sets the optional parameter which makes the operation
  21203. // fail if the object's ETag matches the given value. This is useful for
  21204. // getting updates only after the object has changed since the last
  21205. // request. Use googleapi.IsNotModified to check whether the response
  21206. // error from Do is the result of In-None-Match.
  21207. func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall {
  21208. c.ifNoneMatch_ = entityTag
  21209. return c
  21210. }
  21211. // Context sets the context to be used in this call's Do method. Any
  21212. // pending HTTP request will be aborted if the provided context is
  21213. // canceled.
  21214. func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall {
  21215. c.ctx_ = ctx
  21216. return c
  21217. }
  21218. // Header returns an http.Header that can be modified by the caller to
  21219. // add HTTP headers to the request.
  21220. func (c *CountriesListCall) Header() http.Header {
  21221. if c.header_ == nil {
  21222. c.header_ = make(http.Header)
  21223. }
  21224. return c.header_
  21225. }
  21226. func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) {
  21227. reqHeaders := make(http.Header)
  21228. for k, v := range c.header_ {
  21229. reqHeaders[k] = v
  21230. }
  21231. reqHeaders.Set("User-Agent", c.s.userAgent())
  21232. if c.ifNoneMatch_ != "" {
  21233. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21234. }
  21235. var body io.Reader = nil
  21236. c.urlParams_.Set("alt", alt)
  21237. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries")
  21238. urls += "?" + c.urlParams_.Encode()
  21239. req, _ := http.NewRequest("GET", urls, body)
  21240. req.Header = reqHeaders
  21241. googleapi.Expand(req.URL, map[string]string{
  21242. "profileId": strconv.FormatInt(c.profileId, 10),
  21243. })
  21244. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21245. }
  21246. // Do executes the "dfareporting.countries.list" call.
  21247. // Exactly one of *CountriesListResponse or error will be non-nil. Any
  21248. // non-2xx status code is an error. Response headers are in either
  21249. // *CountriesListResponse.ServerResponse.Header or (if a response was
  21250. // returned at all) in error.(*googleapi.Error).Header. Use
  21251. // googleapi.IsNotModified to check whether the returned error was
  21252. // because http.StatusNotModified was returned.
  21253. func (c *CountriesListCall) Do(opts ...googleapi.CallOption) (*CountriesListResponse, error) {
  21254. gensupport.SetOptions(c.urlParams_, opts...)
  21255. res, err := c.doRequest("json")
  21256. if res != nil && res.StatusCode == http.StatusNotModified {
  21257. if res.Body != nil {
  21258. res.Body.Close()
  21259. }
  21260. return nil, &googleapi.Error{
  21261. Code: res.StatusCode,
  21262. Header: res.Header,
  21263. }
  21264. }
  21265. if err != nil {
  21266. return nil, err
  21267. }
  21268. defer googleapi.CloseBody(res)
  21269. if err := googleapi.CheckResponse(res); err != nil {
  21270. return nil, err
  21271. }
  21272. ret := &CountriesListResponse{
  21273. ServerResponse: googleapi.ServerResponse{
  21274. Header: res.Header,
  21275. HTTPStatusCode: res.StatusCode,
  21276. },
  21277. }
  21278. target := &ret
  21279. if err := gensupport.DecodeResponse(target, res); err != nil {
  21280. return nil, err
  21281. }
  21282. return ret, nil
  21283. // {
  21284. // "description": "Retrieves a list of countries.",
  21285. // "httpMethod": "GET",
  21286. // "id": "dfareporting.countries.list",
  21287. // "parameterOrder": [
  21288. // "profileId"
  21289. // ],
  21290. // "parameters": {
  21291. // "profileId": {
  21292. // "description": "User profile ID associated with this request.",
  21293. // "format": "int64",
  21294. // "location": "path",
  21295. // "required": true,
  21296. // "type": "string"
  21297. // }
  21298. // },
  21299. // "path": "userprofiles/{profileId}/countries",
  21300. // "response": {
  21301. // "$ref": "CountriesListResponse"
  21302. // },
  21303. // "scopes": [
  21304. // "https://www.googleapis.com/auth/dfatrafficking"
  21305. // ]
  21306. // }
  21307. }
  21308. // method id "dfareporting.creativeAssets.insert":
  21309. type CreativeAssetsInsertCall struct {
  21310. s *Service
  21311. profileId int64
  21312. advertiserId int64
  21313. creativeassetmetadata *CreativeAssetMetadata
  21314. urlParams_ gensupport.URLParams
  21315. mediaInfo_ *gensupport.MediaInfo
  21316. ctx_ context.Context
  21317. header_ http.Header
  21318. }
  21319. // Insert: Inserts a new creative asset.
  21320. func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall {
  21321. c := &CreativeAssetsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21322. c.profileId = profileId
  21323. c.advertiserId = advertiserId
  21324. c.creativeassetmetadata = creativeassetmetadata
  21325. return c
  21326. }
  21327. // Media specifies the media to upload in one or more chunks. The chunk
  21328. // size may be controlled by supplying a MediaOption generated by
  21329. // googleapi.ChunkSize. The chunk size defaults to
  21330. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  21331. // upload request will be determined by sniffing the contents of r,
  21332. // unless a MediaOption generated by googleapi.ContentType is
  21333. // supplied.
  21334. // At most one of Media and ResumableMedia may be set.
  21335. func (c *CreativeAssetsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CreativeAssetsInsertCall {
  21336. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  21337. return c
  21338. }
  21339. // ResumableMedia specifies the media to upload in chunks and can be
  21340. // canceled with ctx.
  21341. //
  21342. // Deprecated: use Media instead.
  21343. //
  21344. // At most one of Media and ResumableMedia may be set. mediaType
  21345. // identifies the MIME media type of the upload, such as "image/png". If
  21346. // mediaType is "", it will be auto-detected. The provided ctx will
  21347. // supersede any context previously provided to the Context method.
  21348. func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall {
  21349. c.ctx_ = ctx
  21350. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  21351. return c
  21352. }
  21353. // ProgressUpdater provides a callback function that will be called
  21354. // after every chunk. It should be a low-latency function in order to
  21355. // not slow down the upload operation. This should only be called when
  21356. // using ResumableMedia (as opposed to Media).
  21357. func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall {
  21358. c.mediaInfo_.SetProgressUpdater(pu)
  21359. return c
  21360. }
  21361. // Fields allows partial responses to be retrieved. See
  21362. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21363. // for more information.
  21364. func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall {
  21365. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21366. return c
  21367. }
  21368. // Context sets the context to be used in this call's Do method. Any
  21369. // pending HTTP request will be aborted if the provided context is
  21370. // canceled.
  21371. // This context will supersede any context previously provided to the
  21372. // ResumableMedia method.
  21373. func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall {
  21374. c.ctx_ = ctx
  21375. return c
  21376. }
  21377. // Header returns an http.Header that can be modified by the caller to
  21378. // add HTTP headers to the request.
  21379. func (c *CreativeAssetsInsertCall) Header() http.Header {
  21380. if c.header_ == nil {
  21381. c.header_ = make(http.Header)
  21382. }
  21383. return c.header_
  21384. }
  21385. func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) {
  21386. reqHeaders := make(http.Header)
  21387. for k, v := range c.header_ {
  21388. reqHeaders[k] = v
  21389. }
  21390. reqHeaders.Set("User-Agent", c.s.userAgent())
  21391. var body io.Reader = nil
  21392. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata)
  21393. if err != nil {
  21394. return nil, err
  21395. }
  21396. reqHeaders.Set("Content-Type", "application/json")
  21397. c.urlParams_.Set("alt", alt)
  21398. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets")
  21399. if c.mediaInfo_ != nil {
  21400. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  21401. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  21402. }
  21403. if body == nil {
  21404. body = new(bytes.Buffer)
  21405. reqHeaders.Set("Content-Type", "application/json")
  21406. }
  21407. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  21408. defer cleanup()
  21409. urls += "?" + c.urlParams_.Encode()
  21410. req, _ := http.NewRequest("POST", urls, body)
  21411. req.Header = reqHeaders
  21412. gensupport.SetGetBody(req, getBody)
  21413. googleapi.Expand(req.URL, map[string]string{
  21414. "profileId": strconv.FormatInt(c.profileId, 10),
  21415. "advertiserId": strconv.FormatInt(c.advertiserId, 10),
  21416. })
  21417. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21418. }
  21419. // Do executes the "dfareporting.creativeAssets.insert" call.
  21420. // Exactly one of *CreativeAssetMetadata or error will be non-nil. Any
  21421. // non-2xx status code is an error. Response headers are in either
  21422. // *CreativeAssetMetadata.ServerResponse.Header or (if a response was
  21423. // returned at all) in error.(*googleapi.Error).Header. Use
  21424. // googleapi.IsNotModified to check whether the returned error was
  21425. // because http.StatusNotModified was returned.
  21426. func (c *CreativeAssetsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeAssetMetadata, error) {
  21427. gensupport.SetOptions(c.urlParams_, opts...)
  21428. res, err := c.doRequest("json")
  21429. if res != nil && res.StatusCode == http.StatusNotModified {
  21430. if res.Body != nil {
  21431. res.Body.Close()
  21432. }
  21433. return nil, &googleapi.Error{
  21434. Code: res.StatusCode,
  21435. Header: res.Header,
  21436. }
  21437. }
  21438. if err != nil {
  21439. return nil, err
  21440. }
  21441. defer googleapi.CloseBody(res)
  21442. if err := googleapi.CheckResponse(res); err != nil {
  21443. return nil, err
  21444. }
  21445. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  21446. if rx != nil {
  21447. rx.Client = c.s.client
  21448. rx.UserAgent = c.s.userAgent()
  21449. ctx := c.ctx_
  21450. if ctx == nil {
  21451. ctx = context.TODO()
  21452. }
  21453. res, err = rx.Upload(ctx)
  21454. if err != nil {
  21455. return nil, err
  21456. }
  21457. defer res.Body.Close()
  21458. if err := googleapi.CheckResponse(res); err != nil {
  21459. return nil, err
  21460. }
  21461. }
  21462. ret := &CreativeAssetMetadata{
  21463. ServerResponse: googleapi.ServerResponse{
  21464. Header: res.Header,
  21465. HTTPStatusCode: res.StatusCode,
  21466. },
  21467. }
  21468. target := &ret
  21469. if err := gensupport.DecodeResponse(target, res); err != nil {
  21470. return nil, err
  21471. }
  21472. return ret, nil
  21473. // {
  21474. // "description": "Inserts a new creative asset.",
  21475. // "httpMethod": "POST",
  21476. // "id": "dfareporting.creativeAssets.insert",
  21477. // "mediaUpload": {
  21478. // "accept": [
  21479. // "*/*"
  21480. // ],
  21481. // "maxSize": "1024MB",
  21482. // "protocols": {
  21483. // "resumable": {
  21484. // "multipart": true,
  21485. // "path": "/resumable/upload/dfareporting/v3.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21486. // },
  21487. // "simple": {
  21488. // "multipart": true,
  21489. // "path": "/upload/dfareporting/v3.0/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  21490. // }
  21491. // }
  21492. // },
  21493. // "parameterOrder": [
  21494. // "profileId",
  21495. // "advertiserId"
  21496. // ],
  21497. // "parameters": {
  21498. // "advertiserId": {
  21499. // "description": "Advertiser ID of this creative. This is a required field.",
  21500. // "format": "int64",
  21501. // "location": "path",
  21502. // "required": true,
  21503. // "type": "string"
  21504. // },
  21505. // "profileId": {
  21506. // "description": "User profile ID associated with this request.",
  21507. // "format": "int64",
  21508. // "location": "path",
  21509. // "required": true,
  21510. // "type": "string"
  21511. // }
  21512. // },
  21513. // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets",
  21514. // "request": {
  21515. // "$ref": "CreativeAssetMetadata"
  21516. // },
  21517. // "response": {
  21518. // "$ref": "CreativeAssetMetadata"
  21519. // },
  21520. // "scopes": [
  21521. // "https://www.googleapis.com/auth/dfatrafficking"
  21522. // ],
  21523. // "supportsMediaUpload": true
  21524. // }
  21525. }
  21526. // method id "dfareporting.creativeFieldValues.delete":
  21527. type CreativeFieldValuesDeleteCall struct {
  21528. s *Service
  21529. profileId int64
  21530. creativeFieldId int64
  21531. id int64
  21532. urlParams_ gensupport.URLParams
  21533. ctx_ context.Context
  21534. header_ http.Header
  21535. }
  21536. // Delete: Deletes an existing creative field value.
  21537. func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall {
  21538. c := &CreativeFieldValuesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21539. c.profileId = profileId
  21540. c.creativeFieldId = creativeFieldId
  21541. c.id = id
  21542. return c
  21543. }
  21544. // Fields allows partial responses to be retrieved. See
  21545. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21546. // for more information.
  21547. func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall {
  21548. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21549. return c
  21550. }
  21551. // Context sets the context to be used in this call's Do method. Any
  21552. // pending HTTP request will be aborted if the provided context is
  21553. // canceled.
  21554. func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall {
  21555. c.ctx_ = ctx
  21556. return c
  21557. }
  21558. // Header returns an http.Header that can be modified by the caller to
  21559. // add HTTP headers to the request.
  21560. func (c *CreativeFieldValuesDeleteCall) Header() http.Header {
  21561. if c.header_ == nil {
  21562. c.header_ = make(http.Header)
  21563. }
  21564. return c.header_
  21565. }
  21566. func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) {
  21567. reqHeaders := make(http.Header)
  21568. for k, v := range c.header_ {
  21569. reqHeaders[k] = v
  21570. }
  21571. reqHeaders.Set("User-Agent", c.s.userAgent())
  21572. var body io.Reader = nil
  21573. c.urlParams_.Set("alt", alt)
  21574. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  21575. urls += "?" + c.urlParams_.Encode()
  21576. req, _ := http.NewRequest("DELETE", urls, body)
  21577. req.Header = reqHeaders
  21578. googleapi.Expand(req.URL, map[string]string{
  21579. "profileId": strconv.FormatInt(c.profileId, 10),
  21580. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21581. "id": strconv.FormatInt(c.id, 10),
  21582. })
  21583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21584. }
  21585. // Do executes the "dfareporting.creativeFieldValues.delete" call.
  21586. func (c *CreativeFieldValuesDeleteCall) Do(opts ...googleapi.CallOption) error {
  21587. gensupport.SetOptions(c.urlParams_, opts...)
  21588. res, err := c.doRequest("json")
  21589. if err != nil {
  21590. return err
  21591. }
  21592. defer googleapi.CloseBody(res)
  21593. if err := googleapi.CheckResponse(res); err != nil {
  21594. return err
  21595. }
  21596. return nil
  21597. // {
  21598. // "description": "Deletes an existing creative field value.",
  21599. // "httpMethod": "DELETE",
  21600. // "id": "dfareporting.creativeFieldValues.delete",
  21601. // "parameterOrder": [
  21602. // "profileId",
  21603. // "creativeFieldId",
  21604. // "id"
  21605. // ],
  21606. // "parameters": {
  21607. // "creativeFieldId": {
  21608. // "description": "Creative field ID for this creative field value.",
  21609. // "format": "int64",
  21610. // "location": "path",
  21611. // "required": true,
  21612. // "type": "string"
  21613. // },
  21614. // "id": {
  21615. // "description": "Creative Field Value ID",
  21616. // "format": "int64",
  21617. // "location": "path",
  21618. // "required": true,
  21619. // "type": "string"
  21620. // },
  21621. // "profileId": {
  21622. // "description": "User profile ID associated with this request.",
  21623. // "format": "int64",
  21624. // "location": "path",
  21625. // "required": true,
  21626. // "type": "string"
  21627. // }
  21628. // },
  21629. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  21630. // "scopes": [
  21631. // "https://www.googleapis.com/auth/dfatrafficking"
  21632. // ]
  21633. // }
  21634. }
  21635. // method id "dfareporting.creativeFieldValues.get":
  21636. type CreativeFieldValuesGetCall struct {
  21637. s *Service
  21638. profileId int64
  21639. creativeFieldId int64
  21640. id int64
  21641. urlParams_ gensupport.URLParams
  21642. ifNoneMatch_ string
  21643. ctx_ context.Context
  21644. header_ http.Header
  21645. }
  21646. // Get: Gets one creative field value by ID.
  21647. func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall {
  21648. c := &CreativeFieldValuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21649. c.profileId = profileId
  21650. c.creativeFieldId = creativeFieldId
  21651. c.id = id
  21652. return c
  21653. }
  21654. // Fields allows partial responses to be retrieved. See
  21655. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21656. // for more information.
  21657. func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall {
  21658. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21659. return c
  21660. }
  21661. // IfNoneMatch sets the optional parameter which makes the operation
  21662. // fail if the object's ETag matches the given value. This is useful for
  21663. // getting updates only after the object has changed since the last
  21664. // request. Use googleapi.IsNotModified to check whether the response
  21665. // error from Do is the result of In-None-Match.
  21666. func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall {
  21667. c.ifNoneMatch_ = entityTag
  21668. return c
  21669. }
  21670. // Context sets the context to be used in this call's Do method. Any
  21671. // pending HTTP request will be aborted if the provided context is
  21672. // canceled.
  21673. func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall {
  21674. c.ctx_ = ctx
  21675. return c
  21676. }
  21677. // Header returns an http.Header that can be modified by the caller to
  21678. // add HTTP headers to the request.
  21679. func (c *CreativeFieldValuesGetCall) Header() http.Header {
  21680. if c.header_ == nil {
  21681. c.header_ = make(http.Header)
  21682. }
  21683. return c.header_
  21684. }
  21685. func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) {
  21686. reqHeaders := make(http.Header)
  21687. for k, v := range c.header_ {
  21688. reqHeaders[k] = v
  21689. }
  21690. reqHeaders.Set("User-Agent", c.s.userAgent())
  21691. if c.ifNoneMatch_ != "" {
  21692. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21693. }
  21694. var body io.Reader = nil
  21695. c.urlParams_.Set("alt", alt)
  21696. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  21697. urls += "?" + c.urlParams_.Encode()
  21698. req, _ := http.NewRequest("GET", urls, body)
  21699. req.Header = reqHeaders
  21700. googleapi.Expand(req.URL, map[string]string{
  21701. "profileId": strconv.FormatInt(c.profileId, 10),
  21702. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21703. "id": strconv.FormatInt(c.id, 10),
  21704. })
  21705. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21706. }
  21707. // Do executes the "dfareporting.creativeFieldValues.get" call.
  21708. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  21709. // non-2xx status code is an error. Response headers are in either
  21710. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  21711. // returned at all) in error.(*googleapi.Error).Header. Use
  21712. // googleapi.IsNotModified to check whether the returned error was
  21713. // because http.StatusNotModified was returned.
  21714. func (c *CreativeFieldValuesGetCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  21715. gensupport.SetOptions(c.urlParams_, opts...)
  21716. res, err := c.doRequest("json")
  21717. if res != nil && res.StatusCode == http.StatusNotModified {
  21718. if res.Body != nil {
  21719. res.Body.Close()
  21720. }
  21721. return nil, &googleapi.Error{
  21722. Code: res.StatusCode,
  21723. Header: res.Header,
  21724. }
  21725. }
  21726. if err != nil {
  21727. return nil, err
  21728. }
  21729. defer googleapi.CloseBody(res)
  21730. if err := googleapi.CheckResponse(res); err != nil {
  21731. return nil, err
  21732. }
  21733. ret := &CreativeFieldValue{
  21734. ServerResponse: googleapi.ServerResponse{
  21735. Header: res.Header,
  21736. HTTPStatusCode: res.StatusCode,
  21737. },
  21738. }
  21739. target := &ret
  21740. if err := gensupport.DecodeResponse(target, res); err != nil {
  21741. return nil, err
  21742. }
  21743. return ret, nil
  21744. // {
  21745. // "description": "Gets one creative field value by ID.",
  21746. // "httpMethod": "GET",
  21747. // "id": "dfareporting.creativeFieldValues.get",
  21748. // "parameterOrder": [
  21749. // "profileId",
  21750. // "creativeFieldId",
  21751. // "id"
  21752. // ],
  21753. // "parameters": {
  21754. // "creativeFieldId": {
  21755. // "description": "Creative field ID for this creative field value.",
  21756. // "format": "int64",
  21757. // "location": "path",
  21758. // "required": true,
  21759. // "type": "string"
  21760. // },
  21761. // "id": {
  21762. // "description": "Creative Field Value ID",
  21763. // "format": "int64",
  21764. // "location": "path",
  21765. // "required": true,
  21766. // "type": "string"
  21767. // },
  21768. // "profileId": {
  21769. // "description": "User profile ID associated with this request.",
  21770. // "format": "int64",
  21771. // "location": "path",
  21772. // "required": true,
  21773. // "type": "string"
  21774. // }
  21775. // },
  21776. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  21777. // "response": {
  21778. // "$ref": "CreativeFieldValue"
  21779. // },
  21780. // "scopes": [
  21781. // "https://www.googleapis.com/auth/dfatrafficking"
  21782. // ]
  21783. // }
  21784. }
  21785. // method id "dfareporting.creativeFieldValues.insert":
  21786. type CreativeFieldValuesInsertCall struct {
  21787. s *Service
  21788. profileId int64
  21789. creativeFieldId int64
  21790. creativefieldvalue *CreativeFieldValue
  21791. urlParams_ gensupport.URLParams
  21792. ctx_ context.Context
  21793. header_ http.Header
  21794. }
  21795. // Insert: Inserts a new creative field value.
  21796. func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall {
  21797. c := &CreativeFieldValuesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21798. c.profileId = profileId
  21799. c.creativeFieldId = creativeFieldId
  21800. c.creativefieldvalue = creativefieldvalue
  21801. return c
  21802. }
  21803. // Fields allows partial responses to be retrieved. See
  21804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21805. // for more information.
  21806. func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall {
  21807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21808. return c
  21809. }
  21810. // Context sets the context to be used in this call's Do method. Any
  21811. // pending HTTP request will be aborted if the provided context is
  21812. // canceled.
  21813. func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall {
  21814. c.ctx_ = ctx
  21815. return c
  21816. }
  21817. // Header returns an http.Header that can be modified by the caller to
  21818. // add HTTP headers to the request.
  21819. func (c *CreativeFieldValuesInsertCall) Header() http.Header {
  21820. if c.header_ == nil {
  21821. c.header_ = make(http.Header)
  21822. }
  21823. return c.header_
  21824. }
  21825. func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) {
  21826. reqHeaders := make(http.Header)
  21827. for k, v := range c.header_ {
  21828. reqHeaders[k] = v
  21829. }
  21830. reqHeaders.Set("User-Agent", c.s.userAgent())
  21831. var body io.Reader = nil
  21832. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  21833. if err != nil {
  21834. return nil, err
  21835. }
  21836. reqHeaders.Set("Content-Type", "application/json")
  21837. c.urlParams_.Set("alt", alt)
  21838. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  21839. urls += "?" + c.urlParams_.Encode()
  21840. req, _ := http.NewRequest("POST", urls, body)
  21841. req.Header = reqHeaders
  21842. googleapi.Expand(req.URL, map[string]string{
  21843. "profileId": strconv.FormatInt(c.profileId, 10),
  21844. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21845. })
  21846. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21847. }
  21848. // Do executes the "dfareporting.creativeFieldValues.insert" call.
  21849. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  21850. // non-2xx status code is an error. Response headers are in either
  21851. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  21852. // returned at all) in error.(*googleapi.Error).Header. Use
  21853. // googleapi.IsNotModified to check whether the returned error was
  21854. // because http.StatusNotModified was returned.
  21855. func (c *CreativeFieldValuesInsertCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  21856. gensupport.SetOptions(c.urlParams_, opts...)
  21857. res, err := c.doRequest("json")
  21858. if res != nil && res.StatusCode == http.StatusNotModified {
  21859. if res.Body != nil {
  21860. res.Body.Close()
  21861. }
  21862. return nil, &googleapi.Error{
  21863. Code: res.StatusCode,
  21864. Header: res.Header,
  21865. }
  21866. }
  21867. if err != nil {
  21868. return nil, err
  21869. }
  21870. defer googleapi.CloseBody(res)
  21871. if err := googleapi.CheckResponse(res); err != nil {
  21872. return nil, err
  21873. }
  21874. ret := &CreativeFieldValue{
  21875. ServerResponse: googleapi.ServerResponse{
  21876. Header: res.Header,
  21877. HTTPStatusCode: res.StatusCode,
  21878. },
  21879. }
  21880. target := &ret
  21881. if err := gensupport.DecodeResponse(target, res); err != nil {
  21882. return nil, err
  21883. }
  21884. return ret, nil
  21885. // {
  21886. // "description": "Inserts a new creative field value.",
  21887. // "httpMethod": "POST",
  21888. // "id": "dfareporting.creativeFieldValues.insert",
  21889. // "parameterOrder": [
  21890. // "profileId",
  21891. // "creativeFieldId"
  21892. // ],
  21893. // "parameters": {
  21894. // "creativeFieldId": {
  21895. // "description": "Creative field ID for this creative field value.",
  21896. // "format": "int64",
  21897. // "location": "path",
  21898. // "required": true,
  21899. // "type": "string"
  21900. // },
  21901. // "profileId": {
  21902. // "description": "User profile ID associated with this request.",
  21903. // "format": "int64",
  21904. // "location": "path",
  21905. // "required": true,
  21906. // "type": "string"
  21907. // }
  21908. // },
  21909. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  21910. // "request": {
  21911. // "$ref": "CreativeFieldValue"
  21912. // },
  21913. // "response": {
  21914. // "$ref": "CreativeFieldValue"
  21915. // },
  21916. // "scopes": [
  21917. // "https://www.googleapis.com/auth/dfatrafficking"
  21918. // ]
  21919. // }
  21920. }
  21921. // method id "dfareporting.creativeFieldValues.list":
  21922. type CreativeFieldValuesListCall struct {
  21923. s *Service
  21924. profileId int64
  21925. creativeFieldId int64
  21926. urlParams_ gensupport.URLParams
  21927. ifNoneMatch_ string
  21928. ctx_ context.Context
  21929. header_ http.Header
  21930. }
  21931. // List: Retrieves a list of creative field values, possibly filtered.
  21932. // This method supports paging.
  21933. func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall {
  21934. c := &CreativeFieldValuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21935. c.profileId = profileId
  21936. c.creativeFieldId = creativeFieldId
  21937. return c
  21938. }
  21939. // Ids sets the optional parameter "ids": Select only creative field
  21940. // values with these IDs.
  21941. func (c *CreativeFieldValuesListCall) Ids(ids ...int64) *CreativeFieldValuesListCall {
  21942. var ids_ []string
  21943. for _, v := range ids {
  21944. ids_ = append(ids_, fmt.Sprint(v))
  21945. }
  21946. c.urlParams_.SetMulti("ids", ids_)
  21947. return c
  21948. }
  21949. // MaxResults sets the optional parameter "maxResults": Maximum number
  21950. // of results to return.
  21951. func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall {
  21952. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21953. return c
  21954. }
  21955. // PageToken sets the optional parameter "pageToken": Value of the
  21956. // nextPageToken from the previous result page.
  21957. func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall {
  21958. c.urlParams_.Set("pageToken", pageToken)
  21959. return c
  21960. }
  21961. // SearchString sets the optional parameter "searchString": Allows
  21962. // searching for creative field values by their values. Wildcards (e.g.
  21963. // *) are not allowed.
  21964. func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall {
  21965. c.urlParams_.Set("searchString", searchString)
  21966. return c
  21967. }
  21968. // SortField sets the optional parameter "sortField": Field by which to
  21969. // sort the list.
  21970. //
  21971. // Possible values:
  21972. // "ID" (default)
  21973. // "VALUE"
  21974. func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall {
  21975. c.urlParams_.Set("sortField", sortField)
  21976. return c
  21977. }
  21978. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  21979. // results.
  21980. //
  21981. // Possible values:
  21982. // "ASCENDING" (default)
  21983. // "DESCENDING"
  21984. func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall {
  21985. c.urlParams_.Set("sortOrder", sortOrder)
  21986. return c
  21987. }
  21988. // Fields allows partial responses to be retrieved. See
  21989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21990. // for more information.
  21991. func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall {
  21992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21993. return c
  21994. }
  21995. // IfNoneMatch sets the optional parameter which makes the operation
  21996. // fail if the object's ETag matches the given value. This is useful for
  21997. // getting updates only after the object has changed since the last
  21998. // request. Use googleapi.IsNotModified to check whether the response
  21999. // error from Do is the result of In-None-Match.
  22000. func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall {
  22001. c.ifNoneMatch_ = entityTag
  22002. return c
  22003. }
  22004. // Context sets the context to be used in this call's Do method. Any
  22005. // pending HTTP request will be aborted if the provided context is
  22006. // canceled.
  22007. func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall {
  22008. c.ctx_ = ctx
  22009. return c
  22010. }
  22011. // Header returns an http.Header that can be modified by the caller to
  22012. // add HTTP headers to the request.
  22013. func (c *CreativeFieldValuesListCall) Header() http.Header {
  22014. if c.header_ == nil {
  22015. c.header_ = make(http.Header)
  22016. }
  22017. return c.header_
  22018. }
  22019. func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) {
  22020. reqHeaders := make(http.Header)
  22021. for k, v := range c.header_ {
  22022. reqHeaders[k] = v
  22023. }
  22024. reqHeaders.Set("User-Agent", c.s.userAgent())
  22025. if c.ifNoneMatch_ != "" {
  22026. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22027. }
  22028. var body io.Reader = nil
  22029. c.urlParams_.Set("alt", alt)
  22030. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22031. urls += "?" + c.urlParams_.Encode()
  22032. req, _ := http.NewRequest("GET", urls, body)
  22033. req.Header = reqHeaders
  22034. googleapi.Expand(req.URL, map[string]string{
  22035. "profileId": strconv.FormatInt(c.profileId, 10),
  22036. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22037. })
  22038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22039. }
  22040. // Do executes the "dfareporting.creativeFieldValues.list" call.
  22041. // Exactly one of *CreativeFieldValuesListResponse or error will be
  22042. // non-nil. Any non-2xx status code is an error. Response headers are in
  22043. // either *CreativeFieldValuesListResponse.ServerResponse.Header or (if
  22044. // a response was returned at all) in error.(*googleapi.Error).Header.
  22045. // Use googleapi.IsNotModified to check whether the returned error was
  22046. // because http.StatusNotModified was returned.
  22047. func (c *CreativeFieldValuesListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValuesListResponse, error) {
  22048. gensupport.SetOptions(c.urlParams_, opts...)
  22049. res, err := c.doRequest("json")
  22050. if res != nil && res.StatusCode == http.StatusNotModified {
  22051. if res.Body != nil {
  22052. res.Body.Close()
  22053. }
  22054. return nil, &googleapi.Error{
  22055. Code: res.StatusCode,
  22056. Header: res.Header,
  22057. }
  22058. }
  22059. if err != nil {
  22060. return nil, err
  22061. }
  22062. defer googleapi.CloseBody(res)
  22063. if err := googleapi.CheckResponse(res); err != nil {
  22064. return nil, err
  22065. }
  22066. ret := &CreativeFieldValuesListResponse{
  22067. ServerResponse: googleapi.ServerResponse{
  22068. Header: res.Header,
  22069. HTTPStatusCode: res.StatusCode,
  22070. },
  22071. }
  22072. target := &ret
  22073. if err := gensupport.DecodeResponse(target, res); err != nil {
  22074. return nil, err
  22075. }
  22076. return ret, nil
  22077. // {
  22078. // "description": "Retrieves a list of creative field values, possibly filtered. This method supports paging.",
  22079. // "httpMethod": "GET",
  22080. // "id": "dfareporting.creativeFieldValues.list",
  22081. // "parameterOrder": [
  22082. // "profileId",
  22083. // "creativeFieldId"
  22084. // ],
  22085. // "parameters": {
  22086. // "creativeFieldId": {
  22087. // "description": "Creative field ID for this creative field value.",
  22088. // "format": "int64",
  22089. // "location": "path",
  22090. // "required": true,
  22091. // "type": "string"
  22092. // },
  22093. // "ids": {
  22094. // "description": "Select only creative field values with these IDs.",
  22095. // "format": "int64",
  22096. // "location": "query",
  22097. // "repeated": true,
  22098. // "type": "string"
  22099. // },
  22100. // "maxResults": {
  22101. // "default": "1000",
  22102. // "description": "Maximum number of results to return.",
  22103. // "format": "int32",
  22104. // "location": "query",
  22105. // "maximum": "1000",
  22106. // "minimum": "0",
  22107. // "type": "integer"
  22108. // },
  22109. // "pageToken": {
  22110. // "description": "Value of the nextPageToken from the previous result page.",
  22111. // "location": "query",
  22112. // "type": "string"
  22113. // },
  22114. // "profileId": {
  22115. // "description": "User profile ID associated with this request.",
  22116. // "format": "int64",
  22117. // "location": "path",
  22118. // "required": true,
  22119. // "type": "string"
  22120. // },
  22121. // "searchString": {
  22122. // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.",
  22123. // "location": "query",
  22124. // "type": "string"
  22125. // },
  22126. // "sortField": {
  22127. // "default": "ID",
  22128. // "description": "Field by which to sort the list.",
  22129. // "enum": [
  22130. // "ID",
  22131. // "VALUE"
  22132. // ],
  22133. // "enumDescriptions": [
  22134. // "",
  22135. // ""
  22136. // ],
  22137. // "location": "query",
  22138. // "type": "string"
  22139. // },
  22140. // "sortOrder": {
  22141. // "default": "ASCENDING",
  22142. // "description": "Order of sorted results.",
  22143. // "enum": [
  22144. // "ASCENDING",
  22145. // "DESCENDING"
  22146. // ],
  22147. // "enumDescriptions": [
  22148. // "",
  22149. // ""
  22150. // ],
  22151. // "location": "query",
  22152. // "type": "string"
  22153. // }
  22154. // },
  22155. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22156. // "response": {
  22157. // "$ref": "CreativeFieldValuesListResponse"
  22158. // },
  22159. // "scopes": [
  22160. // "https://www.googleapis.com/auth/dfatrafficking"
  22161. // ]
  22162. // }
  22163. }
  22164. // Pages invokes f for each page of results.
  22165. // A non-nil error returned from f will halt the iteration.
  22166. // The provided context supersedes any context provided to the Context method.
  22167. func (c *CreativeFieldValuesListCall) Pages(ctx context.Context, f func(*CreativeFieldValuesListResponse) error) error {
  22168. c.ctx_ = ctx
  22169. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22170. for {
  22171. x, err := c.Do()
  22172. if err != nil {
  22173. return err
  22174. }
  22175. if err := f(x); err != nil {
  22176. return err
  22177. }
  22178. if x.NextPageToken == "" {
  22179. return nil
  22180. }
  22181. c.PageToken(x.NextPageToken)
  22182. }
  22183. }
  22184. // method id "dfareporting.creativeFieldValues.patch":
  22185. type CreativeFieldValuesPatchCall struct {
  22186. s *Service
  22187. profileId int64
  22188. creativeFieldId int64
  22189. creativefieldvalue *CreativeFieldValue
  22190. urlParams_ gensupport.URLParams
  22191. ctx_ context.Context
  22192. header_ http.Header
  22193. }
  22194. // Patch: Updates an existing creative field value. This method supports
  22195. // patch semantics.
  22196. func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall {
  22197. c := &CreativeFieldValuesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22198. c.profileId = profileId
  22199. c.creativeFieldId = creativeFieldId
  22200. c.urlParams_.Set("id", fmt.Sprint(id))
  22201. c.creativefieldvalue = creativefieldvalue
  22202. return c
  22203. }
  22204. // Fields allows partial responses to be retrieved. See
  22205. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22206. // for more information.
  22207. func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall {
  22208. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22209. return c
  22210. }
  22211. // Context sets the context to be used in this call's Do method. Any
  22212. // pending HTTP request will be aborted if the provided context is
  22213. // canceled.
  22214. func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall {
  22215. c.ctx_ = ctx
  22216. return c
  22217. }
  22218. // Header returns an http.Header that can be modified by the caller to
  22219. // add HTTP headers to the request.
  22220. func (c *CreativeFieldValuesPatchCall) Header() http.Header {
  22221. if c.header_ == nil {
  22222. c.header_ = make(http.Header)
  22223. }
  22224. return c.header_
  22225. }
  22226. func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) {
  22227. reqHeaders := make(http.Header)
  22228. for k, v := range c.header_ {
  22229. reqHeaders[k] = v
  22230. }
  22231. reqHeaders.Set("User-Agent", c.s.userAgent())
  22232. var body io.Reader = nil
  22233. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22234. if err != nil {
  22235. return nil, err
  22236. }
  22237. reqHeaders.Set("Content-Type", "application/json")
  22238. c.urlParams_.Set("alt", alt)
  22239. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22240. urls += "?" + c.urlParams_.Encode()
  22241. req, _ := http.NewRequest("PATCH", urls, body)
  22242. req.Header = reqHeaders
  22243. googleapi.Expand(req.URL, map[string]string{
  22244. "profileId": strconv.FormatInt(c.profileId, 10),
  22245. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22246. })
  22247. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22248. }
  22249. // Do executes the "dfareporting.creativeFieldValues.patch" call.
  22250. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22251. // non-2xx status code is an error. Response headers are in either
  22252. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22253. // returned at all) in error.(*googleapi.Error).Header. Use
  22254. // googleapi.IsNotModified to check whether the returned error was
  22255. // because http.StatusNotModified was returned.
  22256. func (c *CreativeFieldValuesPatchCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22257. gensupport.SetOptions(c.urlParams_, opts...)
  22258. res, err := c.doRequest("json")
  22259. if res != nil && res.StatusCode == http.StatusNotModified {
  22260. if res.Body != nil {
  22261. res.Body.Close()
  22262. }
  22263. return nil, &googleapi.Error{
  22264. Code: res.StatusCode,
  22265. Header: res.Header,
  22266. }
  22267. }
  22268. if err != nil {
  22269. return nil, err
  22270. }
  22271. defer googleapi.CloseBody(res)
  22272. if err := googleapi.CheckResponse(res); err != nil {
  22273. return nil, err
  22274. }
  22275. ret := &CreativeFieldValue{
  22276. ServerResponse: googleapi.ServerResponse{
  22277. Header: res.Header,
  22278. HTTPStatusCode: res.StatusCode,
  22279. },
  22280. }
  22281. target := &ret
  22282. if err := gensupport.DecodeResponse(target, res); err != nil {
  22283. return nil, err
  22284. }
  22285. return ret, nil
  22286. // {
  22287. // "description": "Updates an existing creative field value. This method supports patch semantics.",
  22288. // "httpMethod": "PATCH",
  22289. // "id": "dfareporting.creativeFieldValues.patch",
  22290. // "parameterOrder": [
  22291. // "profileId",
  22292. // "creativeFieldId",
  22293. // "id"
  22294. // ],
  22295. // "parameters": {
  22296. // "creativeFieldId": {
  22297. // "description": "Creative field ID for this creative field value.",
  22298. // "format": "int64",
  22299. // "location": "path",
  22300. // "required": true,
  22301. // "type": "string"
  22302. // },
  22303. // "id": {
  22304. // "description": "Creative Field Value ID",
  22305. // "format": "int64",
  22306. // "location": "query",
  22307. // "required": true,
  22308. // "type": "string"
  22309. // },
  22310. // "profileId": {
  22311. // "description": "User profile ID associated with this request.",
  22312. // "format": "int64",
  22313. // "location": "path",
  22314. // "required": true,
  22315. // "type": "string"
  22316. // }
  22317. // },
  22318. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22319. // "request": {
  22320. // "$ref": "CreativeFieldValue"
  22321. // },
  22322. // "response": {
  22323. // "$ref": "CreativeFieldValue"
  22324. // },
  22325. // "scopes": [
  22326. // "https://www.googleapis.com/auth/dfatrafficking"
  22327. // ]
  22328. // }
  22329. }
  22330. // method id "dfareporting.creativeFieldValues.update":
  22331. type CreativeFieldValuesUpdateCall struct {
  22332. s *Service
  22333. profileId int64
  22334. creativeFieldId int64
  22335. creativefieldvalue *CreativeFieldValue
  22336. urlParams_ gensupport.URLParams
  22337. ctx_ context.Context
  22338. header_ http.Header
  22339. }
  22340. // Update: Updates an existing creative field value.
  22341. func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall {
  22342. c := &CreativeFieldValuesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22343. c.profileId = profileId
  22344. c.creativeFieldId = creativeFieldId
  22345. c.creativefieldvalue = creativefieldvalue
  22346. return c
  22347. }
  22348. // Fields allows partial responses to be retrieved. See
  22349. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22350. // for more information.
  22351. func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall {
  22352. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22353. return c
  22354. }
  22355. // Context sets the context to be used in this call's Do method. Any
  22356. // pending HTTP request will be aborted if the provided context is
  22357. // canceled.
  22358. func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall {
  22359. c.ctx_ = ctx
  22360. return c
  22361. }
  22362. // Header returns an http.Header that can be modified by the caller to
  22363. // add HTTP headers to the request.
  22364. func (c *CreativeFieldValuesUpdateCall) Header() http.Header {
  22365. if c.header_ == nil {
  22366. c.header_ = make(http.Header)
  22367. }
  22368. return c.header_
  22369. }
  22370. func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) {
  22371. reqHeaders := make(http.Header)
  22372. for k, v := range c.header_ {
  22373. reqHeaders[k] = v
  22374. }
  22375. reqHeaders.Set("User-Agent", c.s.userAgent())
  22376. var body io.Reader = nil
  22377. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  22378. if err != nil {
  22379. return nil, err
  22380. }
  22381. reqHeaders.Set("Content-Type", "application/json")
  22382. c.urlParams_.Set("alt", alt)
  22383. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  22384. urls += "?" + c.urlParams_.Encode()
  22385. req, _ := http.NewRequest("PUT", urls, body)
  22386. req.Header = reqHeaders
  22387. googleapi.Expand(req.URL, map[string]string{
  22388. "profileId": strconv.FormatInt(c.profileId, 10),
  22389. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  22390. })
  22391. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22392. }
  22393. // Do executes the "dfareporting.creativeFieldValues.update" call.
  22394. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  22395. // non-2xx status code is an error. Response headers are in either
  22396. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  22397. // returned at all) in error.(*googleapi.Error).Header. Use
  22398. // googleapi.IsNotModified to check whether the returned error was
  22399. // because http.StatusNotModified was returned.
  22400. func (c *CreativeFieldValuesUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  22401. gensupport.SetOptions(c.urlParams_, opts...)
  22402. res, err := c.doRequest("json")
  22403. if res != nil && res.StatusCode == http.StatusNotModified {
  22404. if res.Body != nil {
  22405. res.Body.Close()
  22406. }
  22407. return nil, &googleapi.Error{
  22408. Code: res.StatusCode,
  22409. Header: res.Header,
  22410. }
  22411. }
  22412. if err != nil {
  22413. return nil, err
  22414. }
  22415. defer googleapi.CloseBody(res)
  22416. if err := googleapi.CheckResponse(res); err != nil {
  22417. return nil, err
  22418. }
  22419. ret := &CreativeFieldValue{
  22420. ServerResponse: googleapi.ServerResponse{
  22421. Header: res.Header,
  22422. HTTPStatusCode: res.StatusCode,
  22423. },
  22424. }
  22425. target := &ret
  22426. if err := gensupport.DecodeResponse(target, res); err != nil {
  22427. return nil, err
  22428. }
  22429. return ret, nil
  22430. // {
  22431. // "description": "Updates an existing creative field value.",
  22432. // "httpMethod": "PUT",
  22433. // "id": "dfareporting.creativeFieldValues.update",
  22434. // "parameterOrder": [
  22435. // "profileId",
  22436. // "creativeFieldId"
  22437. // ],
  22438. // "parameters": {
  22439. // "creativeFieldId": {
  22440. // "description": "Creative field ID for this creative field value.",
  22441. // "format": "int64",
  22442. // "location": "path",
  22443. // "required": true,
  22444. // "type": "string"
  22445. // },
  22446. // "profileId": {
  22447. // "description": "User profile ID associated with this request.",
  22448. // "format": "int64",
  22449. // "location": "path",
  22450. // "required": true,
  22451. // "type": "string"
  22452. // }
  22453. // },
  22454. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  22455. // "request": {
  22456. // "$ref": "CreativeFieldValue"
  22457. // },
  22458. // "response": {
  22459. // "$ref": "CreativeFieldValue"
  22460. // },
  22461. // "scopes": [
  22462. // "https://www.googleapis.com/auth/dfatrafficking"
  22463. // ]
  22464. // }
  22465. }
  22466. // method id "dfareporting.creativeFields.delete":
  22467. type CreativeFieldsDeleteCall struct {
  22468. s *Service
  22469. profileId int64
  22470. id int64
  22471. urlParams_ gensupport.URLParams
  22472. ctx_ context.Context
  22473. header_ http.Header
  22474. }
  22475. // Delete: Deletes an existing creative field.
  22476. func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall {
  22477. c := &CreativeFieldsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22478. c.profileId = profileId
  22479. c.id = id
  22480. return c
  22481. }
  22482. // Fields allows partial responses to be retrieved. See
  22483. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22484. // for more information.
  22485. func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall {
  22486. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22487. return c
  22488. }
  22489. // Context sets the context to be used in this call's Do method. Any
  22490. // pending HTTP request will be aborted if the provided context is
  22491. // canceled.
  22492. func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall {
  22493. c.ctx_ = ctx
  22494. return c
  22495. }
  22496. // Header returns an http.Header that can be modified by the caller to
  22497. // add HTTP headers to the request.
  22498. func (c *CreativeFieldsDeleteCall) Header() http.Header {
  22499. if c.header_ == nil {
  22500. c.header_ = make(http.Header)
  22501. }
  22502. return c.header_
  22503. }
  22504. func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) {
  22505. reqHeaders := make(http.Header)
  22506. for k, v := range c.header_ {
  22507. reqHeaders[k] = v
  22508. }
  22509. reqHeaders.Set("User-Agent", c.s.userAgent())
  22510. var body io.Reader = nil
  22511. c.urlParams_.Set("alt", alt)
  22512. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  22513. urls += "?" + c.urlParams_.Encode()
  22514. req, _ := http.NewRequest("DELETE", urls, body)
  22515. req.Header = reqHeaders
  22516. googleapi.Expand(req.URL, map[string]string{
  22517. "profileId": strconv.FormatInt(c.profileId, 10),
  22518. "id": strconv.FormatInt(c.id, 10),
  22519. })
  22520. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22521. }
  22522. // Do executes the "dfareporting.creativeFields.delete" call.
  22523. func (c *CreativeFieldsDeleteCall) Do(opts ...googleapi.CallOption) error {
  22524. gensupport.SetOptions(c.urlParams_, opts...)
  22525. res, err := c.doRequest("json")
  22526. if err != nil {
  22527. return err
  22528. }
  22529. defer googleapi.CloseBody(res)
  22530. if err := googleapi.CheckResponse(res); err != nil {
  22531. return err
  22532. }
  22533. return nil
  22534. // {
  22535. // "description": "Deletes an existing creative field.",
  22536. // "httpMethod": "DELETE",
  22537. // "id": "dfareporting.creativeFields.delete",
  22538. // "parameterOrder": [
  22539. // "profileId",
  22540. // "id"
  22541. // ],
  22542. // "parameters": {
  22543. // "id": {
  22544. // "description": "Creative Field ID",
  22545. // "format": "int64",
  22546. // "location": "path",
  22547. // "required": true,
  22548. // "type": "string"
  22549. // },
  22550. // "profileId": {
  22551. // "description": "User profile ID associated with this request.",
  22552. // "format": "int64",
  22553. // "location": "path",
  22554. // "required": true,
  22555. // "type": "string"
  22556. // }
  22557. // },
  22558. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  22559. // "scopes": [
  22560. // "https://www.googleapis.com/auth/dfatrafficking"
  22561. // ]
  22562. // }
  22563. }
  22564. // method id "dfareporting.creativeFields.get":
  22565. type CreativeFieldsGetCall struct {
  22566. s *Service
  22567. profileId int64
  22568. id int64
  22569. urlParams_ gensupport.URLParams
  22570. ifNoneMatch_ string
  22571. ctx_ context.Context
  22572. header_ http.Header
  22573. }
  22574. // Get: Gets one creative field by ID.
  22575. func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall {
  22576. c := &CreativeFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22577. c.profileId = profileId
  22578. c.id = id
  22579. return c
  22580. }
  22581. // Fields allows partial responses to be retrieved. See
  22582. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22583. // for more information.
  22584. func (c *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall {
  22585. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22586. return c
  22587. }
  22588. // IfNoneMatch sets the optional parameter which makes the operation
  22589. // fail if the object's ETag matches the given value. This is useful for
  22590. // getting updates only after the object has changed since the last
  22591. // request. Use googleapi.IsNotModified to check whether the response
  22592. // error from Do is the result of In-None-Match.
  22593. func (c *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall {
  22594. c.ifNoneMatch_ = entityTag
  22595. return c
  22596. }
  22597. // Context sets the context to be used in this call's Do method. Any
  22598. // pending HTTP request will be aborted if the provided context is
  22599. // canceled.
  22600. func (c *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall {
  22601. c.ctx_ = ctx
  22602. return c
  22603. }
  22604. // Header returns an http.Header that can be modified by the caller to
  22605. // add HTTP headers to the request.
  22606. func (c *CreativeFieldsGetCall) Header() http.Header {
  22607. if c.header_ == nil {
  22608. c.header_ = make(http.Header)
  22609. }
  22610. return c.header_
  22611. }
  22612. func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) {
  22613. reqHeaders := make(http.Header)
  22614. for k, v := range c.header_ {
  22615. reqHeaders[k] = v
  22616. }
  22617. reqHeaders.Set("User-Agent", c.s.userAgent())
  22618. if c.ifNoneMatch_ != "" {
  22619. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22620. }
  22621. var body io.Reader = nil
  22622. c.urlParams_.Set("alt", alt)
  22623. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  22624. urls += "?" + c.urlParams_.Encode()
  22625. req, _ := http.NewRequest("GET", urls, body)
  22626. req.Header = reqHeaders
  22627. googleapi.Expand(req.URL, map[string]string{
  22628. "profileId": strconv.FormatInt(c.profileId, 10),
  22629. "id": strconv.FormatInt(c.id, 10),
  22630. })
  22631. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22632. }
  22633. // Do executes the "dfareporting.creativeFields.get" call.
  22634. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  22635. // status code is an error. Response headers are in either
  22636. // *CreativeField.ServerResponse.Header or (if a response was returned
  22637. // at all) in error.(*googleapi.Error).Header. Use
  22638. // googleapi.IsNotModified to check whether the returned error was
  22639. // because http.StatusNotModified was returned.
  22640. func (c *CreativeFieldsGetCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  22641. gensupport.SetOptions(c.urlParams_, opts...)
  22642. res, err := c.doRequest("json")
  22643. if res != nil && res.StatusCode == http.StatusNotModified {
  22644. if res.Body != nil {
  22645. res.Body.Close()
  22646. }
  22647. return nil, &googleapi.Error{
  22648. Code: res.StatusCode,
  22649. Header: res.Header,
  22650. }
  22651. }
  22652. if err != nil {
  22653. return nil, err
  22654. }
  22655. defer googleapi.CloseBody(res)
  22656. if err := googleapi.CheckResponse(res); err != nil {
  22657. return nil, err
  22658. }
  22659. ret := &CreativeField{
  22660. ServerResponse: googleapi.ServerResponse{
  22661. Header: res.Header,
  22662. HTTPStatusCode: res.StatusCode,
  22663. },
  22664. }
  22665. target := &ret
  22666. if err := gensupport.DecodeResponse(target, res); err != nil {
  22667. return nil, err
  22668. }
  22669. return ret, nil
  22670. // {
  22671. // "description": "Gets one creative field by ID.",
  22672. // "httpMethod": "GET",
  22673. // "id": "dfareporting.creativeFields.get",
  22674. // "parameterOrder": [
  22675. // "profileId",
  22676. // "id"
  22677. // ],
  22678. // "parameters": {
  22679. // "id": {
  22680. // "description": "Creative Field ID",
  22681. // "format": "int64",
  22682. // "location": "path",
  22683. // "required": true,
  22684. // "type": "string"
  22685. // },
  22686. // "profileId": {
  22687. // "description": "User profile ID associated with this request.",
  22688. // "format": "int64",
  22689. // "location": "path",
  22690. // "required": true,
  22691. // "type": "string"
  22692. // }
  22693. // },
  22694. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  22695. // "response": {
  22696. // "$ref": "CreativeField"
  22697. // },
  22698. // "scopes": [
  22699. // "https://www.googleapis.com/auth/dfatrafficking"
  22700. // ]
  22701. // }
  22702. }
  22703. // method id "dfareporting.creativeFields.insert":
  22704. type CreativeFieldsInsertCall struct {
  22705. s *Service
  22706. profileId int64
  22707. creativefield *CreativeField
  22708. urlParams_ gensupport.URLParams
  22709. ctx_ context.Context
  22710. header_ http.Header
  22711. }
  22712. // Insert: Inserts a new creative field.
  22713. func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall {
  22714. c := &CreativeFieldsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22715. c.profileId = profileId
  22716. c.creativefield = creativefield
  22717. return c
  22718. }
  22719. // Fields allows partial responses to be retrieved. See
  22720. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22721. // for more information.
  22722. func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall {
  22723. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22724. return c
  22725. }
  22726. // Context sets the context to be used in this call's Do method. Any
  22727. // pending HTTP request will be aborted if the provided context is
  22728. // canceled.
  22729. func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall {
  22730. c.ctx_ = ctx
  22731. return c
  22732. }
  22733. // Header returns an http.Header that can be modified by the caller to
  22734. // add HTTP headers to the request.
  22735. func (c *CreativeFieldsInsertCall) Header() http.Header {
  22736. if c.header_ == nil {
  22737. c.header_ = make(http.Header)
  22738. }
  22739. return c.header_
  22740. }
  22741. func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) {
  22742. reqHeaders := make(http.Header)
  22743. for k, v := range c.header_ {
  22744. reqHeaders[k] = v
  22745. }
  22746. reqHeaders.Set("User-Agent", c.s.userAgent())
  22747. var body io.Reader = nil
  22748. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  22749. if err != nil {
  22750. return nil, err
  22751. }
  22752. reqHeaders.Set("Content-Type", "application/json")
  22753. c.urlParams_.Set("alt", alt)
  22754. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  22755. urls += "?" + c.urlParams_.Encode()
  22756. req, _ := http.NewRequest("POST", urls, body)
  22757. req.Header = reqHeaders
  22758. googleapi.Expand(req.URL, map[string]string{
  22759. "profileId": strconv.FormatInt(c.profileId, 10),
  22760. })
  22761. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22762. }
  22763. // Do executes the "dfareporting.creativeFields.insert" call.
  22764. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  22765. // status code is an error. Response headers are in either
  22766. // *CreativeField.ServerResponse.Header or (if a response was returned
  22767. // at all) in error.(*googleapi.Error).Header. Use
  22768. // googleapi.IsNotModified to check whether the returned error was
  22769. // because http.StatusNotModified was returned.
  22770. func (c *CreativeFieldsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  22771. gensupport.SetOptions(c.urlParams_, opts...)
  22772. res, err := c.doRequest("json")
  22773. if res != nil && res.StatusCode == http.StatusNotModified {
  22774. if res.Body != nil {
  22775. res.Body.Close()
  22776. }
  22777. return nil, &googleapi.Error{
  22778. Code: res.StatusCode,
  22779. Header: res.Header,
  22780. }
  22781. }
  22782. if err != nil {
  22783. return nil, err
  22784. }
  22785. defer googleapi.CloseBody(res)
  22786. if err := googleapi.CheckResponse(res); err != nil {
  22787. return nil, err
  22788. }
  22789. ret := &CreativeField{
  22790. ServerResponse: googleapi.ServerResponse{
  22791. Header: res.Header,
  22792. HTTPStatusCode: res.StatusCode,
  22793. },
  22794. }
  22795. target := &ret
  22796. if err := gensupport.DecodeResponse(target, res); err != nil {
  22797. return nil, err
  22798. }
  22799. return ret, nil
  22800. // {
  22801. // "description": "Inserts a new creative field.",
  22802. // "httpMethod": "POST",
  22803. // "id": "dfareporting.creativeFields.insert",
  22804. // "parameterOrder": [
  22805. // "profileId"
  22806. // ],
  22807. // "parameters": {
  22808. // "profileId": {
  22809. // "description": "User profile ID associated with this request.",
  22810. // "format": "int64",
  22811. // "location": "path",
  22812. // "required": true,
  22813. // "type": "string"
  22814. // }
  22815. // },
  22816. // "path": "userprofiles/{profileId}/creativeFields",
  22817. // "request": {
  22818. // "$ref": "CreativeField"
  22819. // },
  22820. // "response": {
  22821. // "$ref": "CreativeField"
  22822. // },
  22823. // "scopes": [
  22824. // "https://www.googleapis.com/auth/dfatrafficking"
  22825. // ]
  22826. // }
  22827. }
  22828. // method id "dfareporting.creativeFields.list":
  22829. type CreativeFieldsListCall struct {
  22830. s *Service
  22831. profileId int64
  22832. urlParams_ gensupport.URLParams
  22833. ifNoneMatch_ string
  22834. ctx_ context.Context
  22835. header_ http.Header
  22836. }
  22837. // List: Retrieves a list of creative fields, possibly filtered. This
  22838. // method supports paging.
  22839. func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall {
  22840. c := &CreativeFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22841. c.profileId = profileId
  22842. return c
  22843. }
  22844. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  22845. // only creative fields that belong to these advertisers.
  22846. func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeFieldsListCall {
  22847. var advertiserIds_ []string
  22848. for _, v := range advertiserIds {
  22849. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  22850. }
  22851. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  22852. return c
  22853. }
  22854. // Ids sets the optional parameter "ids": Select only creative fields
  22855. // with these IDs.
  22856. func (c *CreativeFieldsListCall) Ids(ids ...int64) *CreativeFieldsListCall {
  22857. var ids_ []string
  22858. for _, v := range ids {
  22859. ids_ = append(ids_, fmt.Sprint(v))
  22860. }
  22861. c.urlParams_.SetMulti("ids", ids_)
  22862. return c
  22863. }
  22864. // MaxResults sets the optional parameter "maxResults": Maximum number
  22865. // of results to return.
  22866. func (c *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall {
  22867. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22868. return c
  22869. }
  22870. // PageToken sets the optional parameter "pageToken": Value of the
  22871. // nextPageToken from the previous result page.
  22872. func (c *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall {
  22873. c.urlParams_.Set("pageToken", pageToken)
  22874. return c
  22875. }
  22876. // SearchString sets the optional parameter "searchString": Allows
  22877. // searching for creative fields by name or ID. Wildcards (*) are
  22878. // allowed. For example, "creativefield*2015" will return creative
  22879. // fields with names like "creativefield June 2015", "creativefield
  22880. // April 2015", or simply "creativefield 2015". Most of the searches
  22881. // also add wild-cards implicitly at the start and the end of the search
  22882. // string. For example, a search string of "creativefield" will match
  22883. // creative fields with the name "my creativefield", "creativefield
  22884. // 2015", or simply "creativefield".
  22885. func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall {
  22886. c.urlParams_.Set("searchString", searchString)
  22887. return c
  22888. }
  22889. // SortField sets the optional parameter "sortField": Field by which to
  22890. // sort the list.
  22891. //
  22892. // Possible values:
  22893. // "ID" (default)
  22894. // "NAME"
  22895. func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall {
  22896. c.urlParams_.Set("sortField", sortField)
  22897. return c
  22898. }
  22899. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  22900. // results.
  22901. //
  22902. // Possible values:
  22903. // "ASCENDING" (default)
  22904. // "DESCENDING"
  22905. func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall {
  22906. c.urlParams_.Set("sortOrder", sortOrder)
  22907. return c
  22908. }
  22909. // Fields allows partial responses to be retrieved. See
  22910. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22911. // for more information.
  22912. func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall {
  22913. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22914. return c
  22915. }
  22916. // IfNoneMatch sets the optional parameter which makes the operation
  22917. // fail if the object's ETag matches the given value. This is useful for
  22918. // getting updates only after the object has changed since the last
  22919. // request. Use googleapi.IsNotModified to check whether the response
  22920. // error from Do is the result of In-None-Match.
  22921. func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall {
  22922. c.ifNoneMatch_ = entityTag
  22923. return c
  22924. }
  22925. // Context sets the context to be used in this call's Do method. Any
  22926. // pending HTTP request will be aborted if the provided context is
  22927. // canceled.
  22928. func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall {
  22929. c.ctx_ = ctx
  22930. return c
  22931. }
  22932. // Header returns an http.Header that can be modified by the caller to
  22933. // add HTTP headers to the request.
  22934. func (c *CreativeFieldsListCall) Header() http.Header {
  22935. if c.header_ == nil {
  22936. c.header_ = make(http.Header)
  22937. }
  22938. return c.header_
  22939. }
  22940. func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) {
  22941. reqHeaders := make(http.Header)
  22942. for k, v := range c.header_ {
  22943. reqHeaders[k] = v
  22944. }
  22945. reqHeaders.Set("User-Agent", c.s.userAgent())
  22946. if c.ifNoneMatch_ != "" {
  22947. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22948. }
  22949. var body io.Reader = nil
  22950. c.urlParams_.Set("alt", alt)
  22951. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  22952. urls += "?" + c.urlParams_.Encode()
  22953. req, _ := http.NewRequest("GET", urls, body)
  22954. req.Header = reqHeaders
  22955. googleapi.Expand(req.URL, map[string]string{
  22956. "profileId": strconv.FormatInt(c.profileId, 10),
  22957. })
  22958. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22959. }
  22960. // Do executes the "dfareporting.creativeFields.list" call.
  22961. // Exactly one of *CreativeFieldsListResponse or error will be non-nil.
  22962. // Any non-2xx status code is an error. Response headers are in either
  22963. // *CreativeFieldsListResponse.ServerResponse.Header or (if a response
  22964. // was returned at all) in error.(*googleapi.Error).Header. Use
  22965. // googleapi.IsNotModified to check whether the returned error was
  22966. // because http.StatusNotModified was returned.
  22967. func (c *CreativeFieldsListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldsListResponse, error) {
  22968. gensupport.SetOptions(c.urlParams_, opts...)
  22969. res, err := c.doRequest("json")
  22970. if res != nil && res.StatusCode == http.StatusNotModified {
  22971. if res.Body != nil {
  22972. res.Body.Close()
  22973. }
  22974. return nil, &googleapi.Error{
  22975. Code: res.StatusCode,
  22976. Header: res.Header,
  22977. }
  22978. }
  22979. if err != nil {
  22980. return nil, err
  22981. }
  22982. defer googleapi.CloseBody(res)
  22983. if err := googleapi.CheckResponse(res); err != nil {
  22984. return nil, err
  22985. }
  22986. ret := &CreativeFieldsListResponse{
  22987. ServerResponse: googleapi.ServerResponse{
  22988. Header: res.Header,
  22989. HTTPStatusCode: res.StatusCode,
  22990. },
  22991. }
  22992. target := &ret
  22993. if err := gensupport.DecodeResponse(target, res); err != nil {
  22994. return nil, err
  22995. }
  22996. return ret, nil
  22997. // {
  22998. // "description": "Retrieves a list of creative fields, possibly filtered. This method supports paging.",
  22999. // "httpMethod": "GET",
  23000. // "id": "dfareporting.creativeFields.list",
  23001. // "parameterOrder": [
  23002. // "profileId"
  23003. // ],
  23004. // "parameters": {
  23005. // "advertiserIds": {
  23006. // "description": "Select only creative fields that belong to these advertisers.",
  23007. // "format": "int64",
  23008. // "location": "query",
  23009. // "repeated": true,
  23010. // "type": "string"
  23011. // },
  23012. // "ids": {
  23013. // "description": "Select only creative fields with these IDs.",
  23014. // "format": "int64",
  23015. // "location": "query",
  23016. // "repeated": true,
  23017. // "type": "string"
  23018. // },
  23019. // "maxResults": {
  23020. // "default": "1000",
  23021. // "description": "Maximum number of results to return.",
  23022. // "format": "int32",
  23023. // "location": "query",
  23024. // "maximum": "1000",
  23025. // "minimum": "0",
  23026. // "type": "integer"
  23027. // },
  23028. // "pageToken": {
  23029. // "description": "Value of the nextPageToken from the previous result page.",
  23030. // "location": "query",
  23031. // "type": "string"
  23032. // },
  23033. // "profileId": {
  23034. // "description": "User profile ID associated with this request.",
  23035. // "format": "int64",
  23036. // "location": "path",
  23037. // "required": true,
  23038. // "type": "string"
  23039. // },
  23040. // "searchString": {
  23041. // "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\".",
  23042. // "location": "query",
  23043. // "type": "string"
  23044. // },
  23045. // "sortField": {
  23046. // "default": "ID",
  23047. // "description": "Field by which to sort the list.",
  23048. // "enum": [
  23049. // "ID",
  23050. // "NAME"
  23051. // ],
  23052. // "enumDescriptions": [
  23053. // "",
  23054. // ""
  23055. // ],
  23056. // "location": "query",
  23057. // "type": "string"
  23058. // },
  23059. // "sortOrder": {
  23060. // "default": "ASCENDING",
  23061. // "description": "Order of sorted results.",
  23062. // "enum": [
  23063. // "ASCENDING",
  23064. // "DESCENDING"
  23065. // ],
  23066. // "enumDescriptions": [
  23067. // "",
  23068. // ""
  23069. // ],
  23070. // "location": "query",
  23071. // "type": "string"
  23072. // }
  23073. // },
  23074. // "path": "userprofiles/{profileId}/creativeFields",
  23075. // "response": {
  23076. // "$ref": "CreativeFieldsListResponse"
  23077. // },
  23078. // "scopes": [
  23079. // "https://www.googleapis.com/auth/dfatrafficking"
  23080. // ]
  23081. // }
  23082. }
  23083. // Pages invokes f for each page of results.
  23084. // A non-nil error returned from f will halt the iteration.
  23085. // The provided context supersedes any context provided to the Context method.
  23086. func (c *CreativeFieldsListCall) Pages(ctx context.Context, f func(*CreativeFieldsListResponse) error) error {
  23087. c.ctx_ = ctx
  23088. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23089. for {
  23090. x, err := c.Do()
  23091. if err != nil {
  23092. return err
  23093. }
  23094. if err := f(x); err != nil {
  23095. return err
  23096. }
  23097. if x.NextPageToken == "" {
  23098. return nil
  23099. }
  23100. c.PageToken(x.NextPageToken)
  23101. }
  23102. }
  23103. // method id "dfareporting.creativeFields.patch":
  23104. type CreativeFieldsPatchCall struct {
  23105. s *Service
  23106. profileId int64
  23107. creativefield *CreativeField
  23108. urlParams_ gensupport.URLParams
  23109. ctx_ context.Context
  23110. header_ http.Header
  23111. }
  23112. // Patch: Updates an existing creative field. This method supports patch
  23113. // semantics.
  23114. func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall {
  23115. c := &CreativeFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23116. c.profileId = profileId
  23117. c.urlParams_.Set("id", fmt.Sprint(id))
  23118. c.creativefield = creativefield
  23119. return c
  23120. }
  23121. // Fields allows partial responses to be retrieved. See
  23122. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23123. // for more information.
  23124. func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall {
  23125. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23126. return c
  23127. }
  23128. // Context sets the context to be used in this call's Do method. Any
  23129. // pending HTTP request will be aborted if the provided context is
  23130. // canceled.
  23131. func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall {
  23132. c.ctx_ = ctx
  23133. return c
  23134. }
  23135. // Header returns an http.Header that can be modified by the caller to
  23136. // add HTTP headers to the request.
  23137. func (c *CreativeFieldsPatchCall) Header() http.Header {
  23138. if c.header_ == nil {
  23139. c.header_ = make(http.Header)
  23140. }
  23141. return c.header_
  23142. }
  23143. func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  23144. reqHeaders := make(http.Header)
  23145. for k, v := range c.header_ {
  23146. reqHeaders[k] = v
  23147. }
  23148. reqHeaders.Set("User-Agent", c.s.userAgent())
  23149. var body io.Reader = nil
  23150. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23151. if err != nil {
  23152. return nil, err
  23153. }
  23154. reqHeaders.Set("Content-Type", "application/json")
  23155. c.urlParams_.Set("alt", alt)
  23156. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23157. urls += "?" + c.urlParams_.Encode()
  23158. req, _ := http.NewRequest("PATCH", urls, body)
  23159. req.Header = reqHeaders
  23160. googleapi.Expand(req.URL, map[string]string{
  23161. "profileId": strconv.FormatInt(c.profileId, 10),
  23162. })
  23163. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23164. }
  23165. // Do executes the "dfareporting.creativeFields.patch" call.
  23166. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23167. // status code is an error. Response headers are in either
  23168. // *CreativeField.ServerResponse.Header or (if a response was returned
  23169. // at all) in error.(*googleapi.Error).Header. Use
  23170. // googleapi.IsNotModified to check whether the returned error was
  23171. // because http.StatusNotModified was returned.
  23172. func (c *CreativeFieldsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23173. gensupport.SetOptions(c.urlParams_, opts...)
  23174. res, err := c.doRequest("json")
  23175. if res != nil && res.StatusCode == http.StatusNotModified {
  23176. if res.Body != nil {
  23177. res.Body.Close()
  23178. }
  23179. return nil, &googleapi.Error{
  23180. Code: res.StatusCode,
  23181. Header: res.Header,
  23182. }
  23183. }
  23184. if err != nil {
  23185. return nil, err
  23186. }
  23187. defer googleapi.CloseBody(res)
  23188. if err := googleapi.CheckResponse(res); err != nil {
  23189. return nil, err
  23190. }
  23191. ret := &CreativeField{
  23192. ServerResponse: googleapi.ServerResponse{
  23193. Header: res.Header,
  23194. HTTPStatusCode: res.StatusCode,
  23195. },
  23196. }
  23197. target := &ret
  23198. if err := gensupport.DecodeResponse(target, res); err != nil {
  23199. return nil, err
  23200. }
  23201. return ret, nil
  23202. // {
  23203. // "description": "Updates an existing creative field. This method supports patch semantics.",
  23204. // "httpMethod": "PATCH",
  23205. // "id": "dfareporting.creativeFields.patch",
  23206. // "parameterOrder": [
  23207. // "profileId",
  23208. // "id"
  23209. // ],
  23210. // "parameters": {
  23211. // "id": {
  23212. // "description": "Creative Field ID",
  23213. // "format": "int64",
  23214. // "location": "query",
  23215. // "required": true,
  23216. // "type": "string"
  23217. // },
  23218. // "profileId": {
  23219. // "description": "User profile ID associated with this request.",
  23220. // "format": "int64",
  23221. // "location": "path",
  23222. // "required": true,
  23223. // "type": "string"
  23224. // }
  23225. // },
  23226. // "path": "userprofiles/{profileId}/creativeFields",
  23227. // "request": {
  23228. // "$ref": "CreativeField"
  23229. // },
  23230. // "response": {
  23231. // "$ref": "CreativeField"
  23232. // },
  23233. // "scopes": [
  23234. // "https://www.googleapis.com/auth/dfatrafficking"
  23235. // ]
  23236. // }
  23237. }
  23238. // method id "dfareporting.creativeFields.update":
  23239. type CreativeFieldsUpdateCall struct {
  23240. s *Service
  23241. profileId int64
  23242. creativefield *CreativeField
  23243. urlParams_ gensupport.URLParams
  23244. ctx_ context.Context
  23245. header_ http.Header
  23246. }
  23247. // Update: Updates an existing creative field.
  23248. func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall {
  23249. c := &CreativeFieldsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23250. c.profileId = profileId
  23251. c.creativefield = creativefield
  23252. return c
  23253. }
  23254. // Fields allows partial responses to be retrieved. See
  23255. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23256. // for more information.
  23257. func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall {
  23258. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23259. return c
  23260. }
  23261. // Context sets the context to be used in this call's Do method. Any
  23262. // pending HTTP request will be aborted if the provided context is
  23263. // canceled.
  23264. func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall {
  23265. c.ctx_ = ctx
  23266. return c
  23267. }
  23268. // Header returns an http.Header that can be modified by the caller to
  23269. // add HTTP headers to the request.
  23270. func (c *CreativeFieldsUpdateCall) Header() http.Header {
  23271. if c.header_ == nil {
  23272. c.header_ = make(http.Header)
  23273. }
  23274. return c.header_
  23275. }
  23276. func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) {
  23277. reqHeaders := make(http.Header)
  23278. for k, v := range c.header_ {
  23279. reqHeaders[k] = v
  23280. }
  23281. reqHeaders.Set("User-Agent", c.s.userAgent())
  23282. var body io.Reader = nil
  23283. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  23284. if err != nil {
  23285. return nil, err
  23286. }
  23287. reqHeaders.Set("Content-Type", "application/json")
  23288. c.urlParams_.Set("alt", alt)
  23289. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  23290. urls += "?" + c.urlParams_.Encode()
  23291. req, _ := http.NewRequest("PUT", urls, body)
  23292. req.Header = reqHeaders
  23293. googleapi.Expand(req.URL, map[string]string{
  23294. "profileId": strconv.FormatInt(c.profileId, 10),
  23295. })
  23296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23297. }
  23298. // Do executes the "dfareporting.creativeFields.update" call.
  23299. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  23300. // status code is an error. Response headers are in either
  23301. // *CreativeField.ServerResponse.Header or (if a response was returned
  23302. // at all) in error.(*googleapi.Error).Header. Use
  23303. // googleapi.IsNotModified to check whether the returned error was
  23304. // because http.StatusNotModified was returned.
  23305. func (c *CreativeFieldsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  23306. gensupport.SetOptions(c.urlParams_, opts...)
  23307. res, err := c.doRequest("json")
  23308. if res != nil && res.StatusCode == http.StatusNotModified {
  23309. if res.Body != nil {
  23310. res.Body.Close()
  23311. }
  23312. return nil, &googleapi.Error{
  23313. Code: res.StatusCode,
  23314. Header: res.Header,
  23315. }
  23316. }
  23317. if err != nil {
  23318. return nil, err
  23319. }
  23320. defer googleapi.CloseBody(res)
  23321. if err := googleapi.CheckResponse(res); err != nil {
  23322. return nil, err
  23323. }
  23324. ret := &CreativeField{
  23325. ServerResponse: googleapi.ServerResponse{
  23326. Header: res.Header,
  23327. HTTPStatusCode: res.StatusCode,
  23328. },
  23329. }
  23330. target := &ret
  23331. if err := gensupport.DecodeResponse(target, res); err != nil {
  23332. return nil, err
  23333. }
  23334. return ret, nil
  23335. // {
  23336. // "description": "Updates an existing creative field.",
  23337. // "httpMethod": "PUT",
  23338. // "id": "dfareporting.creativeFields.update",
  23339. // "parameterOrder": [
  23340. // "profileId"
  23341. // ],
  23342. // "parameters": {
  23343. // "profileId": {
  23344. // "description": "User profile ID associated with this request.",
  23345. // "format": "int64",
  23346. // "location": "path",
  23347. // "required": true,
  23348. // "type": "string"
  23349. // }
  23350. // },
  23351. // "path": "userprofiles/{profileId}/creativeFields",
  23352. // "request": {
  23353. // "$ref": "CreativeField"
  23354. // },
  23355. // "response": {
  23356. // "$ref": "CreativeField"
  23357. // },
  23358. // "scopes": [
  23359. // "https://www.googleapis.com/auth/dfatrafficking"
  23360. // ]
  23361. // }
  23362. }
  23363. // method id "dfareporting.creativeGroups.get":
  23364. type CreativeGroupsGetCall struct {
  23365. s *Service
  23366. profileId int64
  23367. id int64
  23368. urlParams_ gensupport.URLParams
  23369. ifNoneMatch_ string
  23370. ctx_ context.Context
  23371. header_ http.Header
  23372. }
  23373. // Get: Gets one creative group by ID.
  23374. func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall {
  23375. c := &CreativeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23376. c.profileId = profileId
  23377. c.id = id
  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 *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall {
  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 *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall {
  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 *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall {
  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 *CreativeGroupsGetCall) Header() http.Header {
  23406. if c.header_ == nil {
  23407. c.header_ = make(http.Header)
  23408. }
  23409. return c.header_
  23410. }
  23411. func (c *CreativeGroupsGetCall) 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. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}")
  23423. urls += "?" + c.urlParams_.Encode()
  23424. req, _ := http.NewRequest("GET", urls, body)
  23425. req.Header = reqHeaders
  23426. googleapi.Expand(req.URL, map[string]string{
  23427. "profileId": strconv.FormatInt(c.profileId, 10),
  23428. "id": strconv.FormatInt(c.id, 10),
  23429. })
  23430. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23431. }
  23432. // Do executes the "dfareporting.creativeGroups.get" call.
  23433. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  23434. // status code is an error. Response headers are in either
  23435. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  23436. // at all) in error.(*googleapi.Error).Header. Use
  23437. // googleapi.IsNotModified to check whether the returned error was
  23438. // because http.StatusNotModified was returned.
  23439. func (c *CreativeGroupsGetCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  23440. gensupport.SetOptions(c.urlParams_, opts...)
  23441. res, err := c.doRequest("json")
  23442. if res != nil && res.StatusCode == http.StatusNotModified {
  23443. if res.Body != nil {
  23444. res.Body.Close()
  23445. }
  23446. return nil, &googleapi.Error{
  23447. Code: res.StatusCode,
  23448. Header: res.Header,
  23449. }
  23450. }
  23451. if err != nil {
  23452. return nil, err
  23453. }
  23454. defer googleapi.CloseBody(res)
  23455. if err := googleapi.CheckResponse(res); err != nil {
  23456. return nil, err
  23457. }
  23458. ret := &CreativeGroup{
  23459. ServerResponse: googleapi.ServerResponse{
  23460. Header: res.Header,
  23461. HTTPStatusCode: res.StatusCode,
  23462. },
  23463. }
  23464. target := &ret
  23465. if err := gensupport.DecodeResponse(target, res); err != nil {
  23466. return nil, err
  23467. }
  23468. return ret, nil
  23469. // {
  23470. // "description": "Gets one creative group by ID.",
  23471. // "httpMethod": "GET",
  23472. // "id": "dfareporting.creativeGroups.get",
  23473. // "parameterOrder": [
  23474. // "profileId",
  23475. // "id"
  23476. // ],
  23477. // "parameters": {
  23478. // "id": {
  23479. // "description": "Creative group ID.",
  23480. // "format": "int64",
  23481. // "location": "path",
  23482. // "required": true,
  23483. // "type": "string"
  23484. // },
  23485. // "profileId": {
  23486. // "description": "User profile ID associated with this request.",
  23487. // "format": "int64",
  23488. // "location": "path",
  23489. // "required": true,
  23490. // "type": "string"
  23491. // }
  23492. // },
  23493. // "path": "userprofiles/{profileId}/creativeGroups/{id}",
  23494. // "response": {
  23495. // "$ref": "CreativeGroup"
  23496. // },
  23497. // "scopes": [
  23498. // "https://www.googleapis.com/auth/dfatrafficking"
  23499. // ]
  23500. // }
  23501. }
  23502. // method id "dfareporting.creativeGroups.insert":
  23503. type CreativeGroupsInsertCall struct {
  23504. s *Service
  23505. profileId int64
  23506. creativegroup *CreativeGroup
  23507. urlParams_ gensupport.URLParams
  23508. ctx_ context.Context
  23509. header_ http.Header
  23510. }
  23511. // Insert: Inserts a new creative group.
  23512. func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall {
  23513. c := &CreativeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23514. c.profileId = profileId
  23515. c.creativegroup = creativegroup
  23516. return c
  23517. }
  23518. // Fields allows partial responses to be retrieved. See
  23519. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23520. // for more information.
  23521. func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall {
  23522. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23523. return c
  23524. }
  23525. // Context sets the context to be used in this call's Do method. Any
  23526. // pending HTTP request will be aborted if the provided context is
  23527. // canceled.
  23528. func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall {
  23529. c.ctx_ = ctx
  23530. return c
  23531. }
  23532. // Header returns an http.Header that can be modified by the caller to
  23533. // add HTTP headers to the request.
  23534. func (c *CreativeGroupsInsertCall) Header() http.Header {
  23535. if c.header_ == nil {
  23536. c.header_ = make(http.Header)
  23537. }
  23538. return c.header_
  23539. }
  23540. func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  23541. reqHeaders := make(http.Header)
  23542. for k, v := range c.header_ {
  23543. reqHeaders[k] = v
  23544. }
  23545. reqHeaders.Set("User-Agent", c.s.userAgent())
  23546. var body io.Reader = nil
  23547. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  23548. if err != nil {
  23549. return nil, err
  23550. }
  23551. reqHeaders.Set("Content-Type", "application/json")
  23552. c.urlParams_.Set("alt", alt)
  23553. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  23554. urls += "?" + c.urlParams_.Encode()
  23555. req, _ := http.NewRequest("POST", urls, body)
  23556. req.Header = reqHeaders
  23557. googleapi.Expand(req.URL, map[string]string{
  23558. "profileId": strconv.FormatInt(c.profileId, 10),
  23559. })
  23560. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23561. }
  23562. // Do executes the "dfareporting.creativeGroups.insert" call.
  23563. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  23564. // status code is an error. Response headers are in either
  23565. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  23566. // at all) in error.(*googleapi.Error).Header. Use
  23567. // googleapi.IsNotModified to check whether the returned error was
  23568. // because http.StatusNotModified was returned.
  23569. func (c *CreativeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  23570. gensupport.SetOptions(c.urlParams_, opts...)
  23571. res, err := c.doRequest("json")
  23572. if res != nil && res.StatusCode == http.StatusNotModified {
  23573. if res.Body != nil {
  23574. res.Body.Close()
  23575. }
  23576. return nil, &googleapi.Error{
  23577. Code: res.StatusCode,
  23578. Header: res.Header,
  23579. }
  23580. }
  23581. if err != nil {
  23582. return nil, err
  23583. }
  23584. defer googleapi.CloseBody(res)
  23585. if err := googleapi.CheckResponse(res); err != nil {
  23586. return nil, err
  23587. }
  23588. ret := &CreativeGroup{
  23589. ServerResponse: googleapi.ServerResponse{
  23590. Header: res.Header,
  23591. HTTPStatusCode: res.StatusCode,
  23592. },
  23593. }
  23594. target := &ret
  23595. if err := gensupport.DecodeResponse(target, res); err != nil {
  23596. return nil, err
  23597. }
  23598. return ret, nil
  23599. // {
  23600. // "description": "Inserts a new creative group.",
  23601. // "httpMethod": "POST",
  23602. // "id": "dfareporting.creativeGroups.insert",
  23603. // "parameterOrder": [
  23604. // "profileId"
  23605. // ],
  23606. // "parameters": {
  23607. // "profileId": {
  23608. // "description": "User profile ID associated with this request.",
  23609. // "format": "int64",
  23610. // "location": "path",
  23611. // "required": true,
  23612. // "type": "string"
  23613. // }
  23614. // },
  23615. // "path": "userprofiles/{profileId}/creativeGroups",
  23616. // "request": {
  23617. // "$ref": "CreativeGroup"
  23618. // },
  23619. // "response": {
  23620. // "$ref": "CreativeGroup"
  23621. // },
  23622. // "scopes": [
  23623. // "https://www.googleapis.com/auth/dfatrafficking"
  23624. // ]
  23625. // }
  23626. }
  23627. // method id "dfareporting.creativeGroups.list":
  23628. type CreativeGroupsListCall struct {
  23629. s *Service
  23630. profileId int64
  23631. urlParams_ gensupport.URLParams
  23632. ifNoneMatch_ string
  23633. ctx_ context.Context
  23634. header_ http.Header
  23635. }
  23636. // List: Retrieves a list of creative groups, possibly filtered. This
  23637. // method supports paging.
  23638. func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall {
  23639. c := &CreativeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23640. c.profileId = profileId
  23641. return c
  23642. }
  23643. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  23644. // only creative groups that belong to these advertisers.
  23645. func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeGroupsListCall {
  23646. var advertiserIds_ []string
  23647. for _, v := range advertiserIds {
  23648. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  23649. }
  23650. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  23651. return c
  23652. }
  23653. // GroupNumber sets the optional parameter "groupNumber": Select only
  23654. // creative groups that belong to this subgroup.
  23655. func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall {
  23656. c.urlParams_.Set("groupNumber", fmt.Sprint(groupNumber))
  23657. return c
  23658. }
  23659. // Ids sets the optional parameter "ids": Select only creative groups
  23660. // with these IDs.
  23661. func (c *CreativeGroupsListCall) Ids(ids ...int64) *CreativeGroupsListCall {
  23662. var ids_ []string
  23663. for _, v := range ids {
  23664. ids_ = append(ids_, fmt.Sprint(v))
  23665. }
  23666. c.urlParams_.SetMulti("ids", ids_)
  23667. return c
  23668. }
  23669. // MaxResults sets the optional parameter "maxResults": Maximum number
  23670. // of results to return.
  23671. func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall {
  23672. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23673. return c
  23674. }
  23675. // PageToken sets the optional parameter "pageToken": Value of the
  23676. // nextPageToken from the previous result page.
  23677. func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall {
  23678. c.urlParams_.Set("pageToken", pageToken)
  23679. return c
  23680. }
  23681. // SearchString sets the optional parameter "searchString": Allows
  23682. // searching for creative groups by name or ID. Wildcards (*) are
  23683. // allowed. For example, "creativegroup*2015" will return creative
  23684. // groups with names like "creativegroup June 2015", "creativegroup
  23685. // April 2015", or simply "creativegroup 2015". Most of the searches
  23686. // also add wild-cards implicitly at the start and the end of the search
  23687. // string. For example, a search string of "creativegroup" will match
  23688. // creative groups with the name "my creativegroup", "creativegroup
  23689. // 2015", or simply "creativegroup".
  23690. func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall {
  23691. c.urlParams_.Set("searchString", searchString)
  23692. return c
  23693. }
  23694. // SortField sets the optional parameter "sortField": Field by which to
  23695. // sort the list.
  23696. //
  23697. // Possible values:
  23698. // "ID" (default)
  23699. // "NAME"
  23700. func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall {
  23701. c.urlParams_.Set("sortField", sortField)
  23702. return c
  23703. }
  23704. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  23705. // results.
  23706. //
  23707. // Possible values:
  23708. // "ASCENDING" (default)
  23709. // "DESCENDING"
  23710. func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall {
  23711. c.urlParams_.Set("sortOrder", sortOrder)
  23712. return c
  23713. }
  23714. // Fields allows partial responses to be retrieved. See
  23715. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23716. // for more information.
  23717. func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall {
  23718. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23719. return c
  23720. }
  23721. // IfNoneMatch sets the optional parameter which makes the operation
  23722. // fail if the object's ETag matches the given value. This is useful for
  23723. // getting updates only after the object has changed since the last
  23724. // request. Use googleapi.IsNotModified to check whether the response
  23725. // error from Do is the result of In-None-Match.
  23726. func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall {
  23727. c.ifNoneMatch_ = entityTag
  23728. return c
  23729. }
  23730. // Context sets the context to be used in this call's Do method. Any
  23731. // pending HTTP request will be aborted if the provided context is
  23732. // canceled.
  23733. func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall {
  23734. c.ctx_ = ctx
  23735. return c
  23736. }
  23737. // Header returns an http.Header that can be modified by the caller to
  23738. // add HTTP headers to the request.
  23739. func (c *CreativeGroupsListCall) Header() http.Header {
  23740. if c.header_ == nil {
  23741. c.header_ = make(http.Header)
  23742. }
  23743. return c.header_
  23744. }
  23745. func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  23746. reqHeaders := make(http.Header)
  23747. for k, v := range c.header_ {
  23748. reqHeaders[k] = v
  23749. }
  23750. reqHeaders.Set("User-Agent", c.s.userAgent())
  23751. if c.ifNoneMatch_ != "" {
  23752. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23753. }
  23754. var body io.Reader = nil
  23755. c.urlParams_.Set("alt", alt)
  23756. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  23757. urls += "?" + c.urlParams_.Encode()
  23758. req, _ := http.NewRequest("GET", urls, body)
  23759. req.Header = reqHeaders
  23760. googleapi.Expand(req.URL, map[string]string{
  23761. "profileId": strconv.FormatInt(c.profileId, 10),
  23762. })
  23763. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23764. }
  23765. // Do executes the "dfareporting.creativeGroups.list" call.
  23766. // Exactly one of *CreativeGroupsListResponse or error will be non-nil.
  23767. // Any non-2xx status code is an error. Response headers are in either
  23768. // *CreativeGroupsListResponse.ServerResponse.Header or (if a response
  23769. // was returned at all) in error.(*googleapi.Error).Header. Use
  23770. // googleapi.IsNotModified to check whether the returned error was
  23771. // because http.StatusNotModified was returned.
  23772. func (c *CreativeGroupsListCall) Do(opts ...googleapi.CallOption) (*CreativeGroupsListResponse, error) {
  23773. gensupport.SetOptions(c.urlParams_, opts...)
  23774. res, err := c.doRequest("json")
  23775. if res != nil && res.StatusCode == http.StatusNotModified {
  23776. if res.Body != nil {
  23777. res.Body.Close()
  23778. }
  23779. return nil, &googleapi.Error{
  23780. Code: res.StatusCode,
  23781. Header: res.Header,
  23782. }
  23783. }
  23784. if err != nil {
  23785. return nil, err
  23786. }
  23787. defer googleapi.CloseBody(res)
  23788. if err := googleapi.CheckResponse(res); err != nil {
  23789. return nil, err
  23790. }
  23791. ret := &CreativeGroupsListResponse{
  23792. ServerResponse: googleapi.ServerResponse{
  23793. Header: res.Header,
  23794. HTTPStatusCode: res.StatusCode,
  23795. },
  23796. }
  23797. target := &ret
  23798. if err := gensupport.DecodeResponse(target, res); err != nil {
  23799. return nil, err
  23800. }
  23801. return ret, nil
  23802. // {
  23803. // "description": "Retrieves a list of creative groups, possibly filtered. This method supports paging.",
  23804. // "httpMethod": "GET",
  23805. // "id": "dfareporting.creativeGroups.list",
  23806. // "parameterOrder": [
  23807. // "profileId"
  23808. // ],
  23809. // "parameters": {
  23810. // "advertiserIds": {
  23811. // "description": "Select only creative groups that belong to these advertisers.",
  23812. // "format": "int64",
  23813. // "location": "query",
  23814. // "repeated": true,
  23815. // "type": "string"
  23816. // },
  23817. // "groupNumber": {
  23818. // "description": "Select only creative groups that belong to this subgroup.",
  23819. // "format": "int32",
  23820. // "location": "query",
  23821. // "maximum": "2",
  23822. // "minimum": "1",
  23823. // "type": "integer"
  23824. // },
  23825. // "ids": {
  23826. // "description": "Select only creative groups with these IDs.",
  23827. // "format": "int64",
  23828. // "location": "query",
  23829. // "repeated": true,
  23830. // "type": "string"
  23831. // },
  23832. // "maxResults": {
  23833. // "default": "1000",
  23834. // "description": "Maximum number of results to return.",
  23835. // "format": "int32",
  23836. // "location": "query",
  23837. // "maximum": "1000",
  23838. // "minimum": "0",
  23839. // "type": "integer"
  23840. // },
  23841. // "pageToken": {
  23842. // "description": "Value of the nextPageToken from the previous result page.",
  23843. // "location": "query",
  23844. // "type": "string"
  23845. // },
  23846. // "profileId": {
  23847. // "description": "User profile ID associated with this request.",
  23848. // "format": "int64",
  23849. // "location": "path",
  23850. // "required": true,
  23851. // "type": "string"
  23852. // },
  23853. // "searchString": {
  23854. // "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\".",
  23855. // "location": "query",
  23856. // "type": "string"
  23857. // },
  23858. // "sortField": {
  23859. // "default": "ID",
  23860. // "description": "Field by which to sort the list.",
  23861. // "enum": [
  23862. // "ID",
  23863. // "NAME"
  23864. // ],
  23865. // "enumDescriptions": [
  23866. // "",
  23867. // ""
  23868. // ],
  23869. // "location": "query",
  23870. // "type": "string"
  23871. // },
  23872. // "sortOrder": {
  23873. // "default": "ASCENDING",
  23874. // "description": "Order of sorted results.",
  23875. // "enum": [
  23876. // "ASCENDING",
  23877. // "DESCENDING"
  23878. // ],
  23879. // "enumDescriptions": [
  23880. // "",
  23881. // ""
  23882. // ],
  23883. // "location": "query",
  23884. // "type": "string"
  23885. // }
  23886. // },
  23887. // "path": "userprofiles/{profileId}/creativeGroups",
  23888. // "response": {
  23889. // "$ref": "CreativeGroupsListResponse"
  23890. // },
  23891. // "scopes": [
  23892. // "https://www.googleapis.com/auth/dfatrafficking"
  23893. // ]
  23894. // }
  23895. }
  23896. // Pages invokes f for each page of results.
  23897. // A non-nil error returned from f will halt the iteration.
  23898. // The provided context supersedes any context provided to the Context method.
  23899. func (c *CreativeGroupsListCall) Pages(ctx context.Context, f func(*CreativeGroupsListResponse) error) error {
  23900. c.ctx_ = ctx
  23901. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23902. for {
  23903. x, err := c.Do()
  23904. if err != nil {
  23905. return err
  23906. }
  23907. if err := f(x); err != nil {
  23908. return err
  23909. }
  23910. if x.NextPageToken == "" {
  23911. return nil
  23912. }
  23913. c.PageToken(x.NextPageToken)
  23914. }
  23915. }
  23916. // method id "dfareporting.creativeGroups.patch":
  23917. type CreativeGroupsPatchCall struct {
  23918. s *Service
  23919. profileId int64
  23920. creativegroup *CreativeGroup
  23921. urlParams_ gensupport.URLParams
  23922. ctx_ context.Context
  23923. header_ http.Header
  23924. }
  23925. // Patch: Updates an existing creative group. This method supports patch
  23926. // semantics.
  23927. func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall {
  23928. c := &CreativeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23929. c.profileId = profileId
  23930. c.urlParams_.Set("id", fmt.Sprint(id))
  23931. c.creativegroup = creativegroup
  23932. return c
  23933. }
  23934. // Fields allows partial responses to be retrieved. See
  23935. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23936. // for more information.
  23937. func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall {
  23938. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23939. return c
  23940. }
  23941. // Context sets the context to be used in this call's Do method. Any
  23942. // pending HTTP request will be aborted if the provided context is
  23943. // canceled.
  23944. func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall {
  23945. c.ctx_ = ctx
  23946. return c
  23947. }
  23948. // Header returns an http.Header that can be modified by the caller to
  23949. // add HTTP headers to the request.
  23950. func (c *CreativeGroupsPatchCall) Header() http.Header {
  23951. if c.header_ == nil {
  23952. c.header_ = make(http.Header)
  23953. }
  23954. return c.header_
  23955. }
  23956. func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  23957. reqHeaders := make(http.Header)
  23958. for k, v := range c.header_ {
  23959. reqHeaders[k] = v
  23960. }
  23961. reqHeaders.Set("User-Agent", c.s.userAgent())
  23962. var body io.Reader = nil
  23963. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  23964. if err != nil {
  23965. return nil, err
  23966. }
  23967. reqHeaders.Set("Content-Type", "application/json")
  23968. c.urlParams_.Set("alt", alt)
  23969. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  23970. urls += "?" + c.urlParams_.Encode()
  23971. req, _ := http.NewRequest("PATCH", urls, body)
  23972. req.Header = reqHeaders
  23973. googleapi.Expand(req.URL, map[string]string{
  23974. "profileId": strconv.FormatInt(c.profileId, 10),
  23975. })
  23976. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23977. }
  23978. // Do executes the "dfareporting.creativeGroups.patch" call.
  23979. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  23980. // status code is an error. Response headers are in either
  23981. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  23982. // at all) in error.(*googleapi.Error).Header. Use
  23983. // googleapi.IsNotModified to check whether the returned error was
  23984. // because http.StatusNotModified was returned.
  23985. func (c *CreativeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  23986. gensupport.SetOptions(c.urlParams_, opts...)
  23987. res, err := c.doRequest("json")
  23988. if res != nil && res.StatusCode == http.StatusNotModified {
  23989. if res.Body != nil {
  23990. res.Body.Close()
  23991. }
  23992. return nil, &googleapi.Error{
  23993. Code: res.StatusCode,
  23994. Header: res.Header,
  23995. }
  23996. }
  23997. if err != nil {
  23998. return nil, err
  23999. }
  24000. defer googleapi.CloseBody(res)
  24001. if err := googleapi.CheckResponse(res); err != nil {
  24002. return nil, err
  24003. }
  24004. ret := &CreativeGroup{
  24005. ServerResponse: googleapi.ServerResponse{
  24006. Header: res.Header,
  24007. HTTPStatusCode: res.StatusCode,
  24008. },
  24009. }
  24010. target := &ret
  24011. if err := gensupport.DecodeResponse(target, res); err != nil {
  24012. return nil, err
  24013. }
  24014. return ret, nil
  24015. // {
  24016. // "description": "Updates an existing creative group. This method supports patch semantics.",
  24017. // "httpMethod": "PATCH",
  24018. // "id": "dfareporting.creativeGroups.patch",
  24019. // "parameterOrder": [
  24020. // "profileId",
  24021. // "id"
  24022. // ],
  24023. // "parameters": {
  24024. // "id": {
  24025. // "description": "Creative group ID.",
  24026. // "format": "int64",
  24027. // "location": "query",
  24028. // "required": true,
  24029. // "type": "string"
  24030. // },
  24031. // "profileId": {
  24032. // "description": "User profile ID associated with this request.",
  24033. // "format": "int64",
  24034. // "location": "path",
  24035. // "required": true,
  24036. // "type": "string"
  24037. // }
  24038. // },
  24039. // "path": "userprofiles/{profileId}/creativeGroups",
  24040. // "request": {
  24041. // "$ref": "CreativeGroup"
  24042. // },
  24043. // "response": {
  24044. // "$ref": "CreativeGroup"
  24045. // },
  24046. // "scopes": [
  24047. // "https://www.googleapis.com/auth/dfatrafficking"
  24048. // ]
  24049. // }
  24050. }
  24051. // method id "dfareporting.creativeGroups.update":
  24052. type CreativeGroupsUpdateCall struct {
  24053. s *Service
  24054. profileId int64
  24055. creativegroup *CreativeGroup
  24056. urlParams_ gensupport.URLParams
  24057. ctx_ context.Context
  24058. header_ http.Header
  24059. }
  24060. // Update: Updates an existing creative group.
  24061. func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall {
  24062. c := &CreativeGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24063. c.profileId = profileId
  24064. c.creativegroup = creativegroup
  24065. return c
  24066. }
  24067. // Fields allows partial responses to be retrieved. See
  24068. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24069. // for more information.
  24070. func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall {
  24071. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24072. return c
  24073. }
  24074. // Context sets the context to be used in this call's Do method. Any
  24075. // pending HTTP request will be aborted if the provided context is
  24076. // canceled.
  24077. func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall {
  24078. c.ctx_ = ctx
  24079. return c
  24080. }
  24081. // Header returns an http.Header that can be modified by the caller to
  24082. // add HTTP headers to the request.
  24083. func (c *CreativeGroupsUpdateCall) Header() http.Header {
  24084. if c.header_ == nil {
  24085. c.header_ = make(http.Header)
  24086. }
  24087. return c.header_
  24088. }
  24089. func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  24090. reqHeaders := make(http.Header)
  24091. for k, v := range c.header_ {
  24092. reqHeaders[k] = v
  24093. }
  24094. reqHeaders.Set("User-Agent", c.s.userAgent())
  24095. var body io.Reader = nil
  24096. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  24097. if err != nil {
  24098. return nil, err
  24099. }
  24100. reqHeaders.Set("Content-Type", "application/json")
  24101. c.urlParams_.Set("alt", alt)
  24102. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  24103. urls += "?" + c.urlParams_.Encode()
  24104. req, _ := http.NewRequest("PUT", urls, body)
  24105. req.Header = reqHeaders
  24106. googleapi.Expand(req.URL, map[string]string{
  24107. "profileId": strconv.FormatInt(c.profileId, 10),
  24108. })
  24109. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24110. }
  24111. // Do executes the "dfareporting.creativeGroups.update" call.
  24112. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  24113. // status code is an error. Response headers are in either
  24114. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  24115. // at all) in error.(*googleapi.Error).Header. Use
  24116. // googleapi.IsNotModified to check whether the returned error was
  24117. // because http.StatusNotModified was returned.
  24118. func (c *CreativeGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  24119. gensupport.SetOptions(c.urlParams_, opts...)
  24120. res, err := c.doRequest("json")
  24121. if res != nil && res.StatusCode == http.StatusNotModified {
  24122. if res.Body != nil {
  24123. res.Body.Close()
  24124. }
  24125. return nil, &googleapi.Error{
  24126. Code: res.StatusCode,
  24127. Header: res.Header,
  24128. }
  24129. }
  24130. if err != nil {
  24131. return nil, err
  24132. }
  24133. defer googleapi.CloseBody(res)
  24134. if err := googleapi.CheckResponse(res); err != nil {
  24135. return nil, err
  24136. }
  24137. ret := &CreativeGroup{
  24138. ServerResponse: googleapi.ServerResponse{
  24139. Header: res.Header,
  24140. HTTPStatusCode: res.StatusCode,
  24141. },
  24142. }
  24143. target := &ret
  24144. if err := gensupport.DecodeResponse(target, res); err != nil {
  24145. return nil, err
  24146. }
  24147. return ret, nil
  24148. // {
  24149. // "description": "Updates an existing creative group.",
  24150. // "httpMethod": "PUT",
  24151. // "id": "dfareporting.creativeGroups.update",
  24152. // "parameterOrder": [
  24153. // "profileId"
  24154. // ],
  24155. // "parameters": {
  24156. // "profileId": {
  24157. // "description": "User profile ID associated with this request.",
  24158. // "format": "int64",
  24159. // "location": "path",
  24160. // "required": true,
  24161. // "type": "string"
  24162. // }
  24163. // },
  24164. // "path": "userprofiles/{profileId}/creativeGroups",
  24165. // "request": {
  24166. // "$ref": "CreativeGroup"
  24167. // },
  24168. // "response": {
  24169. // "$ref": "CreativeGroup"
  24170. // },
  24171. // "scopes": [
  24172. // "https://www.googleapis.com/auth/dfatrafficking"
  24173. // ]
  24174. // }
  24175. }
  24176. // method id "dfareporting.creatives.get":
  24177. type CreativesGetCall struct {
  24178. s *Service
  24179. profileId int64
  24180. id int64
  24181. urlParams_ gensupport.URLParams
  24182. ifNoneMatch_ string
  24183. ctx_ context.Context
  24184. header_ http.Header
  24185. }
  24186. // Get: Gets one creative by ID.
  24187. func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall {
  24188. c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24189. c.profileId = profileId
  24190. c.id = id
  24191. return c
  24192. }
  24193. // Fields allows partial responses to be retrieved. See
  24194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24195. // for more information.
  24196. func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
  24197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24198. return c
  24199. }
  24200. // IfNoneMatch sets the optional parameter which makes the operation
  24201. // fail if the object's ETag matches the given value. This is useful for
  24202. // getting updates only after the object has changed since the last
  24203. // request. Use googleapi.IsNotModified to check whether the response
  24204. // error from Do is the result of In-None-Match.
  24205. func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
  24206. c.ifNoneMatch_ = entityTag
  24207. return c
  24208. }
  24209. // Context sets the context to be used in this call's Do method. Any
  24210. // pending HTTP request will be aborted if the provided context is
  24211. // canceled.
  24212. func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
  24213. c.ctx_ = ctx
  24214. return c
  24215. }
  24216. // Header returns an http.Header that can be modified by the caller to
  24217. // add HTTP headers to the request.
  24218. func (c *CreativesGetCall) Header() http.Header {
  24219. if c.header_ == nil {
  24220. c.header_ = make(http.Header)
  24221. }
  24222. return c.header_
  24223. }
  24224. func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
  24225. reqHeaders := make(http.Header)
  24226. for k, v := range c.header_ {
  24227. reqHeaders[k] = v
  24228. }
  24229. reqHeaders.Set("User-Agent", c.s.userAgent())
  24230. if c.ifNoneMatch_ != "" {
  24231. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24232. }
  24233. var body io.Reader = nil
  24234. c.urlParams_.Set("alt", alt)
  24235. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}")
  24236. urls += "?" + c.urlParams_.Encode()
  24237. req, _ := http.NewRequest("GET", urls, body)
  24238. req.Header = reqHeaders
  24239. googleapi.Expand(req.URL, map[string]string{
  24240. "profileId": strconv.FormatInt(c.profileId, 10),
  24241. "id": strconv.FormatInt(c.id, 10),
  24242. })
  24243. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24244. }
  24245. // Do executes the "dfareporting.creatives.get" call.
  24246. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24247. // code is an error. Response headers are in either
  24248. // *Creative.ServerResponse.Header or (if a response was returned at
  24249. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24250. // to check whether the returned error was because
  24251. // http.StatusNotModified was returned.
  24252. func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24253. gensupport.SetOptions(c.urlParams_, opts...)
  24254. res, err := c.doRequest("json")
  24255. if res != nil && res.StatusCode == http.StatusNotModified {
  24256. if res.Body != nil {
  24257. res.Body.Close()
  24258. }
  24259. return nil, &googleapi.Error{
  24260. Code: res.StatusCode,
  24261. Header: res.Header,
  24262. }
  24263. }
  24264. if err != nil {
  24265. return nil, err
  24266. }
  24267. defer googleapi.CloseBody(res)
  24268. if err := googleapi.CheckResponse(res); err != nil {
  24269. return nil, err
  24270. }
  24271. ret := &Creative{
  24272. ServerResponse: googleapi.ServerResponse{
  24273. Header: res.Header,
  24274. HTTPStatusCode: res.StatusCode,
  24275. },
  24276. }
  24277. target := &ret
  24278. if err := gensupport.DecodeResponse(target, res); err != nil {
  24279. return nil, err
  24280. }
  24281. return ret, nil
  24282. // {
  24283. // "description": "Gets one creative by ID.",
  24284. // "httpMethod": "GET",
  24285. // "id": "dfareporting.creatives.get",
  24286. // "parameterOrder": [
  24287. // "profileId",
  24288. // "id"
  24289. // ],
  24290. // "parameters": {
  24291. // "id": {
  24292. // "description": "Creative ID.",
  24293. // "format": "int64",
  24294. // "location": "path",
  24295. // "required": true,
  24296. // "type": "string"
  24297. // },
  24298. // "profileId": {
  24299. // "description": "User profile ID associated with this request.",
  24300. // "format": "int64",
  24301. // "location": "path",
  24302. // "required": true,
  24303. // "type": "string"
  24304. // }
  24305. // },
  24306. // "path": "userprofiles/{profileId}/creatives/{id}",
  24307. // "response": {
  24308. // "$ref": "Creative"
  24309. // },
  24310. // "scopes": [
  24311. // "https://www.googleapis.com/auth/dfatrafficking"
  24312. // ]
  24313. // }
  24314. }
  24315. // method id "dfareporting.creatives.insert":
  24316. type CreativesInsertCall struct {
  24317. s *Service
  24318. profileId int64
  24319. creative *Creative
  24320. urlParams_ gensupport.URLParams
  24321. ctx_ context.Context
  24322. header_ http.Header
  24323. }
  24324. // Insert: Inserts a new creative.
  24325. func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall {
  24326. c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24327. c.profileId = profileId
  24328. c.creative = creative
  24329. return c
  24330. }
  24331. // Fields allows partial responses to be retrieved. See
  24332. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24333. // for more information.
  24334. func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
  24335. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24336. return c
  24337. }
  24338. // Context sets the context to be used in this call's Do method. Any
  24339. // pending HTTP request will be aborted if the provided context is
  24340. // canceled.
  24341. func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
  24342. c.ctx_ = ctx
  24343. return c
  24344. }
  24345. // Header returns an http.Header that can be modified by the caller to
  24346. // add HTTP headers to the request.
  24347. func (c *CreativesInsertCall) Header() http.Header {
  24348. if c.header_ == nil {
  24349. c.header_ = make(http.Header)
  24350. }
  24351. return c.header_
  24352. }
  24353. func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
  24354. reqHeaders := make(http.Header)
  24355. for k, v := range c.header_ {
  24356. reqHeaders[k] = v
  24357. }
  24358. reqHeaders.Set("User-Agent", c.s.userAgent())
  24359. var body io.Reader = nil
  24360. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  24361. if err != nil {
  24362. return nil, err
  24363. }
  24364. reqHeaders.Set("Content-Type", "application/json")
  24365. c.urlParams_.Set("alt", alt)
  24366. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  24367. urls += "?" + c.urlParams_.Encode()
  24368. req, _ := http.NewRequest("POST", urls, body)
  24369. req.Header = reqHeaders
  24370. googleapi.Expand(req.URL, map[string]string{
  24371. "profileId": strconv.FormatInt(c.profileId, 10),
  24372. })
  24373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24374. }
  24375. // Do executes the "dfareporting.creatives.insert" call.
  24376. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24377. // code is an error. Response headers are in either
  24378. // *Creative.ServerResponse.Header or (if a response was returned at
  24379. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24380. // to check whether the returned error was because
  24381. // http.StatusNotModified was returned.
  24382. func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24383. gensupport.SetOptions(c.urlParams_, opts...)
  24384. res, err := c.doRequest("json")
  24385. if res != nil && res.StatusCode == http.StatusNotModified {
  24386. if res.Body != nil {
  24387. res.Body.Close()
  24388. }
  24389. return nil, &googleapi.Error{
  24390. Code: res.StatusCode,
  24391. Header: res.Header,
  24392. }
  24393. }
  24394. if err != nil {
  24395. return nil, err
  24396. }
  24397. defer googleapi.CloseBody(res)
  24398. if err := googleapi.CheckResponse(res); err != nil {
  24399. return nil, err
  24400. }
  24401. ret := &Creative{
  24402. ServerResponse: googleapi.ServerResponse{
  24403. Header: res.Header,
  24404. HTTPStatusCode: res.StatusCode,
  24405. },
  24406. }
  24407. target := &ret
  24408. if err := gensupport.DecodeResponse(target, res); err != nil {
  24409. return nil, err
  24410. }
  24411. return ret, nil
  24412. // {
  24413. // "description": "Inserts a new creative.",
  24414. // "httpMethod": "POST",
  24415. // "id": "dfareporting.creatives.insert",
  24416. // "parameterOrder": [
  24417. // "profileId"
  24418. // ],
  24419. // "parameters": {
  24420. // "profileId": {
  24421. // "description": "User profile ID associated with this request.",
  24422. // "format": "int64",
  24423. // "location": "path",
  24424. // "required": true,
  24425. // "type": "string"
  24426. // }
  24427. // },
  24428. // "path": "userprofiles/{profileId}/creatives",
  24429. // "request": {
  24430. // "$ref": "Creative"
  24431. // },
  24432. // "response": {
  24433. // "$ref": "Creative"
  24434. // },
  24435. // "scopes": [
  24436. // "https://www.googleapis.com/auth/dfatrafficking"
  24437. // ]
  24438. // }
  24439. }
  24440. // method id "dfareporting.creatives.list":
  24441. type CreativesListCall struct {
  24442. s *Service
  24443. profileId int64
  24444. urlParams_ gensupport.URLParams
  24445. ifNoneMatch_ string
  24446. ctx_ context.Context
  24447. header_ http.Header
  24448. }
  24449. // List: Retrieves a list of creatives, possibly filtered. This method
  24450. // supports paging.
  24451. func (r *CreativesService) List(profileId int64) *CreativesListCall {
  24452. c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24453. c.profileId = profileId
  24454. return c
  24455. }
  24456. // Active sets the optional parameter "active": Select only active
  24457. // creatives. Leave blank to select active and inactive creatives.
  24458. func (c *CreativesListCall) Active(active bool) *CreativesListCall {
  24459. c.urlParams_.Set("active", fmt.Sprint(active))
  24460. return c
  24461. }
  24462. // AdvertiserId sets the optional parameter "advertiserId": Select only
  24463. // creatives with this advertiser ID.
  24464. func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall {
  24465. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  24466. return c
  24467. }
  24468. // Archived sets the optional parameter "archived": Select only archived
  24469. // creatives. Leave blank to select archived and unarchived creatives.
  24470. func (c *CreativesListCall) Archived(archived bool) *CreativesListCall {
  24471. c.urlParams_.Set("archived", fmt.Sprint(archived))
  24472. return c
  24473. }
  24474. // CampaignId sets the optional parameter "campaignId": Select only
  24475. // creatives with this campaign ID.
  24476. func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall {
  24477. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  24478. return c
  24479. }
  24480. // CompanionCreativeIds sets the optional parameter
  24481. // "companionCreativeIds": Select only in-stream video creatives with
  24482. // these companion IDs.
  24483. func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds ...int64) *CreativesListCall {
  24484. var companionCreativeIds_ []string
  24485. for _, v := range companionCreativeIds {
  24486. companionCreativeIds_ = append(companionCreativeIds_, fmt.Sprint(v))
  24487. }
  24488. c.urlParams_.SetMulti("companionCreativeIds", companionCreativeIds_)
  24489. return c
  24490. }
  24491. // CreativeFieldIds sets the optional parameter "creativeFieldIds":
  24492. // Select only creatives with these creative field IDs.
  24493. func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds ...int64) *CreativesListCall {
  24494. var creativeFieldIds_ []string
  24495. for _, v := range creativeFieldIds {
  24496. creativeFieldIds_ = append(creativeFieldIds_, fmt.Sprint(v))
  24497. }
  24498. c.urlParams_.SetMulti("creativeFieldIds", creativeFieldIds_)
  24499. return c
  24500. }
  24501. // Ids sets the optional parameter "ids": Select only creatives with
  24502. // these IDs.
  24503. func (c *CreativesListCall) Ids(ids ...int64) *CreativesListCall {
  24504. var ids_ []string
  24505. for _, v := range ids {
  24506. ids_ = append(ids_, fmt.Sprint(v))
  24507. }
  24508. c.urlParams_.SetMulti("ids", ids_)
  24509. return c
  24510. }
  24511. // MaxResults sets the optional parameter "maxResults": Maximum number
  24512. // of results to return.
  24513. func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
  24514. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24515. return c
  24516. }
  24517. // PageToken sets the optional parameter "pageToken": Value of the
  24518. // nextPageToken from the previous result page.
  24519. func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
  24520. c.urlParams_.Set("pageToken", pageToken)
  24521. return c
  24522. }
  24523. // RenderingIds sets the optional parameter "renderingIds": Select only
  24524. // creatives with these rendering IDs.
  24525. func (c *CreativesListCall) RenderingIds(renderingIds ...int64) *CreativesListCall {
  24526. var renderingIds_ []string
  24527. for _, v := range renderingIds {
  24528. renderingIds_ = append(renderingIds_, fmt.Sprint(v))
  24529. }
  24530. c.urlParams_.SetMulti("renderingIds", renderingIds_)
  24531. return c
  24532. }
  24533. // SearchString sets the optional parameter "searchString": Allows
  24534. // searching for objects by name or ID. Wildcards (*) are allowed. For
  24535. // example, "creative*2015" will return objects with names like
  24536. // "creative June 2015", "creative April 2015", or simply "creative
  24537. // 2015". Most of the searches also add wildcards implicitly at the
  24538. // start and the end of the search string. For example, a search string
  24539. // of "creative" will match objects with name "my creative", "creative
  24540. // 2015", or simply "creative".
  24541. func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall {
  24542. c.urlParams_.Set("searchString", searchString)
  24543. return c
  24544. }
  24545. // SizeIds sets the optional parameter "sizeIds": Select only creatives
  24546. // with these size IDs.
  24547. func (c *CreativesListCall) SizeIds(sizeIds ...int64) *CreativesListCall {
  24548. var sizeIds_ []string
  24549. for _, v := range sizeIds {
  24550. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  24551. }
  24552. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  24553. return c
  24554. }
  24555. // SortField sets the optional parameter "sortField": Field by which to
  24556. // sort the list.
  24557. //
  24558. // Possible values:
  24559. // "ID" (default)
  24560. // "NAME"
  24561. func (c *CreativesListCall) SortField(sortField string) *CreativesListCall {
  24562. c.urlParams_.Set("sortField", sortField)
  24563. return c
  24564. }
  24565. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24566. // results.
  24567. //
  24568. // Possible values:
  24569. // "ASCENDING" (default)
  24570. // "DESCENDING"
  24571. func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall {
  24572. c.urlParams_.Set("sortOrder", sortOrder)
  24573. return c
  24574. }
  24575. // StudioCreativeId sets the optional parameter "studioCreativeId":
  24576. // Select only creatives corresponding to this Studio creative ID.
  24577. func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall {
  24578. c.urlParams_.Set("studioCreativeId", fmt.Sprint(studioCreativeId))
  24579. return c
  24580. }
  24581. // Types sets the optional parameter "types": Select only creatives with
  24582. // these creative types.
  24583. //
  24584. // Possible values:
  24585. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  24586. // "CUSTOM_DISPLAY"
  24587. // "CUSTOM_DISPLAY_INTERSTITIAL"
  24588. // "DISPLAY"
  24589. // "DISPLAY_IMAGE_GALLERY"
  24590. // "DISPLAY_REDIRECT"
  24591. // "FLASH_INPAGE"
  24592. // "HTML5_BANNER"
  24593. // "IMAGE"
  24594. // "INSTREAM_AUDIO"
  24595. // "INSTREAM_VIDEO"
  24596. // "INSTREAM_VIDEO_REDIRECT"
  24597. // "INTERNAL_REDIRECT"
  24598. // "INTERSTITIAL_INTERNAL_REDIRECT"
  24599. // "RICH_MEDIA_DISPLAY_BANNER"
  24600. // "RICH_MEDIA_DISPLAY_EXPANDING"
  24601. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  24602. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  24603. // "RICH_MEDIA_IM_EXPAND"
  24604. // "RICH_MEDIA_INPAGE_FLOATING"
  24605. // "RICH_MEDIA_MOBILE_IN_APP"
  24606. // "RICH_MEDIA_PEEL_DOWN"
  24607. // "TRACKING_TEXT"
  24608. // "VPAID_LINEAR_VIDEO"
  24609. // "VPAID_NON_LINEAR_VIDEO"
  24610. func (c *CreativesListCall) Types(types ...string) *CreativesListCall {
  24611. c.urlParams_.SetMulti("types", append([]string{}, types...))
  24612. return c
  24613. }
  24614. // Fields allows partial responses to be retrieved. See
  24615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24616. // for more information.
  24617. func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
  24618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24619. return c
  24620. }
  24621. // IfNoneMatch sets the optional parameter which makes the operation
  24622. // fail if the object's ETag matches the given value. This is useful for
  24623. // getting updates only after the object has changed since the last
  24624. // request. Use googleapi.IsNotModified to check whether the response
  24625. // error from Do is the result of In-None-Match.
  24626. func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
  24627. c.ifNoneMatch_ = entityTag
  24628. return c
  24629. }
  24630. // Context sets the context to be used in this call's Do method. Any
  24631. // pending HTTP request will be aborted if the provided context is
  24632. // canceled.
  24633. func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
  24634. c.ctx_ = ctx
  24635. return c
  24636. }
  24637. // Header returns an http.Header that can be modified by the caller to
  24638. // add HTTP headers to the request.
  24639. func (c *CreativesListCall) Header() http.Header {
  24640. if c.header_ == nil {
  24641. c.header_ = make(http.Header)
  24642. }
  24643. return c.header_
  24644. }
  24645. func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
  24646. reqHeaders := make(http.Header)
  24647. for k, v := range c.header_ {
  24648. reqHeaders[k] = v
  24649. }
  24650. reqHeaders.Set("User-Agent", c.s.userAgent())
  24651. if c.ifNoneMatch_ != "" {
  24652. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24653. }
  24654. var body io.Reader = nil
  24655. c.urlParams_.Set("alt", alt)
  24656. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  24657. urls += "?" + c.urlParams_.Encode()
  24658. req, _ := http.NewRequest("GET", urls, body)
  24659. req.Header = reqHeaders
  24660. googleapi.Expand(req.URL, map[string]string{
  24661. "profileId": strconv.FormatInt(c.profileId, 10),
  24662. })
  24663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24664. }
  24665. // Do executes the "dfareporting.creatives.list" call.
  24666. // Exactly one of *CreativesListResponse or error will be non-nil. Any
  24667. // non-2xx status code is an error. Response headers are in either
  24668. // *CreativesListResponse.ServerResponse.Header or (if a response was
  24669. // returned at all) in error.(*googleapi.Error).Header. Use
  24670. // googleapi.IsNotModified to check whether the returned error was
  24671. // because http.StatusNotModified was returned.
  24672. func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesListResponse, error) {
  24673. gensupport.SetOptions(c.urlParams_, opts...)
  24674. res, err := c.doRequest("json")
  24675. if res != nil && res.StatusCode == http.StatusNotModified {
  24676. if res.Body != nil {
  24677. res.Body.Close()
  24678. }
  24679. return nil, &googleapi.Error{
  24680. Code: res.StatusCode,
  24681. Header: res.Header,
  24682. }
  24683. }
  24684. if err != nil {
  24685. return nil, err
  24686. }
  24687. defer googleapi.CloseBody(res)
  24688. if err := googleapi.CheckResponse(res); err != nil {
  24689. return nil, err
  24690. }
  24691. ret := &CreativesListResponse{
  24692. ServerResponse: googleapi.ServerResponse{
  24693. Header: res.Header,
  24694. HTTPStatusCode: res.StatusCode,
  24695. },
  24696. }
  24697. target := &ret
  24698. if err := gensupport.DecodeResponse(target, res); err != nil {
  24699. return nil, err
  24700. }
  24701. return ret, nil
  24702. // {
  24703. // "description": "Retrieves a list of creatives, possibly filtered. This method supports paging.",
  24704. // "httpMethod": "GET",
  24705. // "id": "dfareporting.creatives.list",
  24706. // "parameterOrder": [
  24707. // "profileId"
  24708. // ],
  24709. // "parameters": {
  24710. // "active": {
  24711. // "description": "Select only active creatives. Leave blank to select active and inactive creatives.",
  24712. // "location": "query",
  24713. // "type": "boolean"
  24714. // },
  24715. // "advertiserId": {
  24716. // "description": "Select only creatives with this advertiser ID.",
  24717. // "format": "int64",
  24718. // "location": "query",
  24719. // "type": "string"
  24720. // },
  24721. // "archived": {
  24722. // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.",
  24723. // "location": "query",
  24724. // "type": "boolean"
  24725. // },
  24726. // "campaignId": {
  24727. // "description": "Select only creatives with this campaign ID.",
  24728. // "format": "int64",
  24729. // "location": "query",
  24730. // "type": "string"
  24731. // },
  24732. // "companionCreativeIds": {
  24733. // "description": "Select only in-stream video creatives with these companion IDs.",
  24734. // "format": "int64",
  24735. // "location": "query",
  24736. // "repeated": true,
  24737. // "type": "string"
  24738. // },
  24739. // "creativeFieldIds": {
  24740. // "description": "Select only creatives with these creative field IDs.",
  24741. // "format": "int64",
  24742. // "location": "query",
  24743. // "repeated": true,
  24744. // "type": "string"
  24745. // },
  24746. // "ids": {
  24747. // "description": "Select only creatives with these IDs.",
  24748. // "format": "int64",
  24749. // "location": "query",
  24750. // "repeated": true,
  24751. // "type": "string"
  24752. // },
  24753. // "maxResults": {
  24754. // "default": "1000",
  24755. // "description": "Maximum number of results to return.",
  24756. // "format": "int32",
  24757. // "location": "query",
  24758. // "maximum": "1000",
  24759. // "minimum": "0",
  24760. // "type": "integer"
  24761. // },
  24762. // "pageToken": {
  24763. // "description": "Value of the nextPageToken from the previous result page.",
  24764. // "location": "query",
  24765. // "type": "string"
  24766. // },
  24767. // "profileId": {
  24768. // "description": "User profile ID associated with this request.",
  24769. // "format": "int64",
  24770. // "location": "path",
  24771. // "required": true,
  24772. // "type": "string"
  24773. // },
  24774. // "renderingIds": {
  24775. // "description": "Select only creatives with these rendering IDs.",
  24776. // "format": "int64",
  24777. // "location": "query",
  24778. // "repeated": true,
  24779. // "type": "string"
  24780. // },
  24781. // "searchString": {
  24782. // "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\".",
  24783. // "location": "query",
  24784. // "type": "string"
  24785. // },
  24786. // "sizeIds": {
  24787. // "description": "Select only creatives with these size IDs.",
  24788. // "format": "int64",
  24789. // "location": "query",
  24790. // "repeated": true,
  24791. // "type": "string"
  24792. // },
  24793. // "sortField": {
  24794. // "default": "ID",
  24795. // "description": "Field by which to sort the list.",
  24796. // "enum": [
  24797. // "ID",
  24798. // "NAME"
  24799. // ],
  24800. // "enumDescriptions": [
  24801. // "",
  24802. // ""
  24803. // ],
  24804. // "location": "query",
  24805. // "type": "string"
  24806. // },
  24807. // "sortOrder": {
  24808. // "default": "ASCENDING",
  24809. // "description": "Order of sorted results.",
  24810. // "enum": [
  24811. // "ASCENDING",
  24812. // "DESCENDING"
  24813. // ],
  24814. // "enumDescriptions": [
  24815. // "",
  24816. // ""
  24817. // ],
  24818. // "location": "query",
  24819. // "type": "string"
  24820. // },
  24821. // "studioCreativeId": {
  24822. // "description": "Select only creatives corresponding to this Studio creative ID.",
  24823. // "format": "int64",
  24824. // "location": "query",
  24825. // "type": "string"
  24826. // },
  24827. // "types": {
  24828. // "description": "Select only creatives with these creative types.",
  24829. // "enum": [
  24830. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO",
  24831. // "CUSTOM_DISPLAY",
  24832. // "CUSTOM_DISPLAY_INTERSTITIAL",
  24833. // "DISPLAY",
  24834. // "DISPLAY_IMAGE_GALLERY",
  24835. // "DISPLAY_REDIRECT",
  24836. // "FLASH_INPAGE",
  24837. // "HTML5_BANNER",
  24838. // "IMAGE",
  24839. // "INSTREAM_AUDIO",
  24840. // "INSTREAM_VIDEO",
  24841. // "INSTREAM_VIDEO_REDIRECT",
  24842. // "INTERNAL_REDIRECT",
  24843. // "INTERSTITIAL_INTERNAL_REDIRECT",
  24844. // "RICH_MEDIA_DISPLAY_BANNER",
  24845. // "RICH_MEDIA_DISPLAY_EXPANDING",
  24846. // "RICH_MEDIA_DISPLAY_INTERSTITIAL",
  24847. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL",
  24848. // "RICH_MEDIA_IM_EXPAND",
  24849. // "RICH_MEDIA_INPAGE_FLOATING",
  24850. // "RICH_MEDIA_MOBILE_IN_APP",
  24851. // "RICH_MEDIA_PEEL_DOWN",
  24852. // "TRACKING_TEXT",
  24853. // "VPAID_LINEAR_VIDEO",
  24854. // "VPAID_NON_LINEAR_VIDEO"
  24855. // ],
  24856. // "enumDescriptions": [
  24857. // "",
  24858. // "",
  24859. // "",
  24860. // "",
  24861. // "",
  24862. // "",
  24863. // "",
  24864. // "",
  24865. // "",
  24866. // "",
  24867. // "",
  24868. // "",
  24869. // "",
  24870. // "",
  24871. // "",
  24872. // "",
  24873. // "",
  24874. // "",
  24875. // "",
  24876. // "",
  24877. // "",
  24878. // "",
  24879. // "",
  24880. // "",
  24881. // ""
  24882. // ],
  24883. // "location": "query",
  24884. // "repeated": true,
  24885. // "type": "string"
  24886. // }
  24887. // },
  24888. // "path": "userprofiles/{profileId}/creatives",
  24889. // "response": {
  24890. // "$ref": "CreativesListResponse"
  24891. // },
  24892. // "scopes": [
  24893. // "https://www.googleapis.com/auth/dfatrafficking"
  24894. // ]
  24895. // }
  24896. }
  24897. // Pages invokes f for each page of results.
  24898. // A non-nil error returned from f will halt the iteration.
  24899. // The provided context supersedes any context provided to the Context method.
  24900. func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesListResponse) error) error {
  24901. c.ctx_ = ctx
  24902. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24903. for {
  24904. x, err := c.Do()
  24905. if err != nil {
  24906. return err
  24907. }
  24908. if err := f(x); err != nil {
  24909. return err
  24910. }
  24911. if x.NextPageToken == "" {
  24912. return nil
  24913. }
  24914. c.PageToken(x.NextPageToken)
  24915. }
  24916. }
  24917. // method id "dfareporting.creatives.patch":
  24918. type CreativesPatchCall struct {
  24919. s *Service
  24920. profileId int64
  24921. creative *Creative
  24922. urlParams_ gensupport.URLParams
  24923. ctx_ context.Context
  24924. header_ http.Header
  24925. }
  24926. // Patch: Updates an existing creative. This method supports patch
  24927. // semantics.
  24928. func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall {
  24929. c := &CreativesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24930. c.profileId = profileId
  24931. c.urlParams_.Set("id", fmt.Sprint(id))
  24932. c.creative = creative
  24933. return c
  24934. }
  24935. // Fields allows partial responses to be retrieved. See
  24936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24937. // for more information.
  24938. func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall {
  24939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24940. return c
  24941. }
  24942. // Context sets the context to be used in this call's Do method. Any
  24943. // pending HTTP request will be aborted if the provided context is
  24944. // canceled.
  24945. func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall {
  24946. c.ctx_ = ctx
  24947. return c
  24948. }
  24949. // Header returns an http.Header that can be modified by the caller to
  24950. // add HTTP headers to the request.
  24951. func (c *CreativesPatchCall) Header() http.Header {
  24952. if c.header_ == nil {
  24953. c.header_ = make(http.Header)
  24954. }
  24955. return c.header_
  24956. }
  24957. func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, error) {
  24958. reqHeaders := make(http.Header)
  24959. for k, v := range c.header_ {
  24960. reqHeaders[k] = v
  24961. }
  24962. reqHeaders.Set("User-Agent", c.s.userAgent())
  24963. var body io.Reader = nil
  24964. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  24965. if err != nil {
  24966. return nil, err
  24967. }
  24968. reqHeaders.Set("Content-Type", "application/json")
  24969. c.urlParams_.Set("alt", alt)
  24970. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  24971. urls += "?" + c.urlParams_.Encode()
  24972. req, _ := http.NewRequest("PATCH", urls, body)
  24973. req.Header = reqHeaders
  24974. googleapi.Expand(req.URL, map[string]string{
  24975. "profileId": strconv.FormatInt(c.profileId, 10),
  24976. })
  24977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24978. }
  24979. // Do executes the "dfareporting.creatives.patch" call.
  24980. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  24981. // code is an error. Response headers are in either
  24982. // *Creative.ServerResponse.Header or (if a response was returned at
  24983. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  24984. // to check whether the returned error was because
  24985. // http.StatusNotModified was returned.
  24986. func (c *CreativesPatchCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  24987. gensupport.SetOptions(c.urlParams_, opts...)
  24988. res, err := c.doRequest("json")
  24989. if res != nil && res.StatusCode == http.StatusNotModified {
  24990. if res.Body != nil {
  24991. res.Body.Close()
  24992. }
  24993. return nil, &googleapi.Error{
  24994. Code: res.StatusCode,
  24995. Header: res.Header,
  24996. }
  24997. }
  24998. if err != nil {
  24999. return nil, err
  25000. }
  25001. defer googleapi.CloseBody(res)
  25002. if err := googleapi.CheckResponse(res); err != nil {
  25003. return nil, err
  25004. }
  25005. ret := &Creative{
  25006. ServerResponse: googleapi.ServerResponse{
  25007. Header: res.Header,
  25008. HTTPStatusCode: res.StatusCode,
  25009. },
  25010. }
  25011. target := &ret
  25012. if err := gensupport.DecodeResponse(target, res); err != nil {
  25013. return nil, err
  25014. }
  25015. return ret, nil
  25016. // {
  25017. // "description": "Updates an existing creative. This method supports patch semantics.",
  25018. // "httpMethod": "PATCH",
  25019. // "id": "dfareporting.creatives.patch",
  25020. // "parameterOrder": [
  25021. // "profileId",
  25022. // "id"
  25023. // ],
  25024. // "parameters": {
  25025. // "id": {
  25026. // "description": "Creative ID.",
  25027. // "format": "int64",
  25028. // "location": "query",
  25029. // "required": true,
  25030. // "type": "string"
  25031. // },
  25032. // "profileId": {
  25033. // "description": "User profile ID associated with this request.",
  25034. // "format": "int64",
  25035. // "location": "path",
  25036. // "required": true,
  25037. // "type": "string"
  25038. // }
  25039. // },
  25040. // "path": "userprofiles/{profileId}/creatives",
  25041. // "request": {
  25042. // "$ref": "Creative"
  25043. // },
  25044. // "response": {
  25045. // "$ref": "Creative"
  25046. // },
  25047. // "scopes": [
  25048. // "https://www.googleapis.com/auth/dfatrafficking"
  25049. // ]
  25050. // }
  25051. }
  25052. // method id "dfareporting.creatives.update":
  25053. type CreativesUpdateCall struct {
  25054. s *Service
  25055. profileId int64
  25056. creative *Creative
  25057. urlParams_ gensupport.URLParams
  25058. ctx_ context.Context
  25059. header_ http.Header
  25060. }
  25061. // Update: Updates an existing creative.
  25062. func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall {
  25063. c := &CreativesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25064. c.profileId = profileId
  25065. c.creative = creative
  25066. return c
  25067. }
  25068. // Fields allows partial responses to be retrieved. See
  25069. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25070. // for more information.
  25071. func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall {
  25072. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25073. return c
  25074. }
  25075. // Context sets the context to be used in this call's Do method. Any
  25076. // pending HTTP request will be aborted if the provided context is
  25077. // canceled.
  25078. func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall {
  25079. c.ctx_ = ctx
  25080. return c
  25081. }
  25082. // Header returns an http.Header that can be modified by the caller to
  25083. // add HTTP headers to the request.
  25084. func (c *CreativesUpdateCall) Header() http.Header {
  25085. if c.header_ == nil {
  25086. c.header_ = make(http.Header)
  25087. }
  25088. return c.header_
  25089. }
  25090. func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, error) {
  25091. reqHeaders := make(http.Header)
  25092. for k, v := range c.header_ {
  25093. reqHeaders[k] = v
  25094. }
  25095. reqHeaders.Set("User-Agent", c.s.userAgent())
  25096. var body io.Reader = nil
  25097. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  25098. if err != nil {
  25099. return nil, err
  25100. }
  25101. reqHeaders.Set("Content-Type", "application/json")
  25102. c.urlParams_.Set("alt", alt)
  25103. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  25104. urls += "?" + c.urlParams_.Encode()
  25105. req, _ := http.NewRequest("PUT", urls, body)
  25106. req.Header = reqHeaders
  25107. googleapi.Expand(req.URL, map[string]string{
  25108. "profileId": strconv.FormatInt(c.profileId, 10),
  25109. })
  25110. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25111. }
  25112. // Do executes the "dfareporting.creatives.update" call.
  25113. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  25114. // code is an error. Response headers are in either
  25115. // *Creative.ServerResponse.Header or (if a response was returned at
  25116. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25117. // to check whether the returned error was because
  25118. // http.StatusNotModified was returned.
  25119. func (c *CreativesUpdateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  25120. gensupport.SetOptions(c.urlParams_, opts...)
  25121. res, err := c.doRequest("json")
  25122. if res != nil && res.StatusCode == http.StatusNotModified {
  25123. if res.Body != nil {
  25124. res.Body.Close()
  25125. }
  25126. return nil, &googleapi.Error{
  25127. Code: res.StatusCode,
  25128. Header: res.Header,
  25129. }
  25130. }
  25131. if err != nil {
  25132. return nil, err
  25133. }
  25134. defer googleapi.CloseBody(res)
  25135. if err := googleapi.CheckResponse(res); err != nil {
  25136. return nil, err
  25137. }
  25138. ret := &Creative{
  25139. ServerResponse: googleapi.ServerResponse{
  25140. Header: res.Header,
  25141. HTTPStatusCode: res.StatusCode,
  25142. },
  25143. }
  25144. target := &ret
  25145. if err := gensupport.DecodeResponse(target, res); err != nil {
  25146. return nil, err
  25147. }
  25148. return ret, nil
  25149. // {
  25150. // "description": "Updates an existing creative.",
  25151. // "httpMethod": "PUT",
  25152. // "id": "dfareporting.creatives.update",
  25153. // "parameterOrder": [
  25154. // "profileId"
  25155. // ],
  25156. // "parameters": {
  25157. // "profileId": {
  25158. // "description": "User profile ID associated with this request.",
  25159. // "format": "int64",
  25160. // "location": "path",
  25161. // "required": true,
  25162. // "type": "string"
  25163. // }
  25164. // },
  25165. // "path": "userprofiles/{profileId}/creatives",
  25166. // "request": {
  25167. // "$ref": "Creative"
  25168. // },
  25169. // "response": {
  25170. // "$ref": "Creative"
  25171. // },
  25172. // "scopes": [
  25173. // "https://www.googleapis.com/auth/dfatrafficking"
  25174. // ]
  25175. // }
  25176. }
  25177. // method id "dfareporting.dimensionValues.query":
  25178. type DimensionValuesQueryCall struct {
  25179. s *Service
  25180. profileId int64
  25181. dimensionvaluerequest *DimensionValueRequest
  25182. urlParams_ gensupport.URLParams
  25183. ctx_ context.Context
  25184. header_ http.Header
  25185. }
  25186. // Query: Retrieves list of report dimension values for a list of
  25187. // filters.
  25188. func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall {
  25189. c := &DimensionValuesQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25190. c.profileId = profileId
  25191. c.dimensionvaluerequest = dimensionvaluerequest
  25192. return c
  25193. }
  25194. // MaxResults sets the optional parameter "maxResults": Maximum number
  25195. // of results to return.
  25196. func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall {
  25197. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25198. return c
  25199. }
  25200. // PageToken sets the optional parameter "pageToken": The value of the
  25201. // nextToken from the previous result page.
  25202. func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall {
  25203. c.urlParams_.Set("pageToken", pageToken)
  25204. return c
  25205. }
  25206. // Fields allows partial responses to be retrieved. See
  25207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25208. // for more information.
  25209. func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall {
  25210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25211. return c
  25212. }
  25213. // Context sets the context to be used in this call's Do method. Any
  25214. // pending HTTP request will be aborted if the provided context is
  25215. // canceled.
  25216. func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall {
  25217. c.ctx_ = ctx
  25218. return c
  25219. }
  25220. // Header returns an http.Header that can be modified by the caller to
  25221. // add HTTP headers to the request.
  25222. func (c *DimensionValuesQueryCall) Header() http.Header {
  25223. if c.header_ == nil {
  25224. c.header_ = make(http.Header)
  25225. }
  25226. return c.header_
  25227. }
  25228. func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, error) {
  25229. reqHeaders := make(http.Header)
  25230. for k, v := range c.header_ {
  25231. reqHeaders[k] = v
  25232. }
  25233. reqHeaders.Set("User-Agent", c.s.userAgent())
  25234. var body io.Reader = nil
  25235. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest)
  25236. if err != nil {
  25237. return nil, err
  25238. }
  25239. reqHeaders.Set("Content-Type", "application/json")
  25240. c.urlParams_.Set("alt", alt)
  25241. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query")
  25242. urls += "?" + c.urlParams_.Encode()
  25243. req, _ := http.NewRequest("POST", urls, body)
  25244. req.Header = reqHeaders
  25245. googleapi.Expand(req.URL, map[string]string{
  25246. "profileId": strconv.FormatInt(c.profileId, 10),
  25247. })
  25248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25249. }
  25250. // Do executes the "dfareporting.dimensionValues.query" call.
  25251. // Exactly one of *DimensionValueList or error will be non-nil. Any
  25252. // non-2xx status code is an error. Response headers are in either
  25253. // *DimensionValueList.ServerResponse.Header or (if a response was
  25254. // returned at all) in error.(*googleapi.Error).Header. Use
  25255. // googleapi.IsNotModified to check whether the returned error was
  25256. // because http.StatusNotModified was returned.
  25257. func (c *DimensionValuesQueryCall) Do(opts ...googleapi.CallOption) (*DimensionValueList, error) {
  25258. gensupport.SetOptions(c.urlParams_, opts...)
  25259. res, err := c.doRequest("json")
  25260. if res != nil && res.StatusCode == http.StatusNotModified {
  25261. if res.Body != nil {
  25262. res.Body.Close()
  25263. }
  25264. return nil, &googleapi.Error{
  25265. Code: res.StatusCode,
  25266. Header: res.Header,
  25267. }
  25268. }
  25269. if err != nil {
  25270. return nil, err
  25271. }
  25272. defer googleapi.CloseBody(res)
  25273. if err := googleapi.CheckResponse(res); err != nil {
  25274. return nil, err
  25275. }
  25276. ret := &DimensionValueList{
  25277. ServerResponse: googleapi.ServerResponse{
  25278. Header: res.Header,
  25279. HTTPStatusCode: res.StatusCode,
  25280. },
  25281. }
  25282. target := &ret
  25283. if err := gensupport.DecodeResponse(target, res); err != nil {
  25284. return nil, err
  25285. }
  25286. return ret, nil
  25287. // {
  25288. // "description": "Retrieves list of report dimension values for a list of filters.",
  25289. // "httpMethod": "POST",
  25290. // "id": "dfareporting.dimensionValues.query",
  25291. // "parameterOrder": [
  25292. // "profileId"
  25293. // ],
  25294. // "parameters": {
  25295. // "maxResults": {
  25296. // "default": "100",
  25297. // "description": "Maximum number of results to return.",
  25298. // "format": "int32",
  25299. // "location": "query",
  25300. // "maximum": "100",
  25301. // "minimum": "0",
  25302. // "type": "integer"
  25303. // },
  25304. // "pageToken": {
  25305. // "description": "The value of the nextToken from the previous result page.",
  25306. // "location": "query",
  25307. // "type": "string"
  25308. // },
  25309. // "profileId": {
  25310. // "description": "The DFA user profile ID.",
  25311. // "format": "int64",
  25312. // "location": "path",
  25313. // "required": true,
  25314. // "type": "string"
  25315. // }
  25316. // },
  25317. // "path": "userprofiles/{profileId}/dimensionvalues/query",
  25318. // "request": {
  25319. // "$ref": "DimensionValueRequest"
  25320. // },
  25321. // "response": {
  25322. // "$ref": "DimensionValueList"
  25323. // },
  25324. // "scopes": [
  25325. // "https://www.googleapis.com/auth/dfareporting"
  25326. // ]
  25327. // }
  25328. }
  25329. // Pages invokes f for each page of results.
  25330. // A non-nil error returned from f will halt the iteration.
  25331. // The provided context supersedes any context provided to the Context method.
  25332. func (c *DimensionValuesQueryCall) Pages(ctx context.Context, f func(*DimensionValueList) error) error {
  25333. c.ctx_ = ctx
  25334. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25335. for {
  25336. x, err := c.Do()
  25337. if err != nil {
  25338. return err
  25339. }
  25340. if err := f(x); err != nil {
  25341. return err
  25342. }
  25343. if x.NextPageToken == "" {
  25344. return nil
  25345. }
  25346. c.PageToken(x.NextPageToken)
  25347. }
  25348. }
  25349. // method id "dfareporting.directorySiteContacts.get":
  25350. type DirectorySiteContactsGetCall struct {
  25351. s *Service
  25352. profileId int64
  25353. id int64
  25354. urlParams_ gensupport.URLParams
  25355. ifNoneMatch_ string
  25356. ctx_ context.Context
  25357. header_ http.Header
  25358. }
  25359. // Get: Gets one directory site contact by ID.
  25360. func (r *DirectorySiteContactsService) Get(profileId int64, id int64) *DirectorySiteContactsGetCall {
  25361. c := &DirectorySiteContactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25362. c.profileId = profileId
  25363. c.id = id
  25364. return c
  25365. }
  25366. // Fields allows partial responses to be retrieved. See
  25367. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25368. // for more information.
  25369. func (c *DirectorySiteContactsGetCall) Fields(s ...googleapi.Field) *DirectorySiteContactsGetCall {
  25370. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25371. return c
  25372. }
  25373. // IfNoneMatch sets the optional parameter which makes the operation
  25374. // fail if the object's ETag matches the given value. This is useful for
  25375. // getting updates only after the object has changed since the last
  25376. // request. Use googleapi.IsNotModified to check whether the response
  25377. // error from Do is the result of In-None-Match.
  25378. func (c *DirectorySiteContactsGetCall) IfNoneMatch(entityTag string) *DirectorySiteContactsGetCall {
  25379. c.ifNoneMatch_ = entityTag
  25380. return c
  25381. }
  25382. // Context sets the context to be used in this call's Do method. Any
  25383. // pending HTTP request will be aborted if the provided context is
  25384. // canceled.
  25385. func (c *DirectorySiteContactsGetCall) Context(ctx context.Context) *DirectorySiteContactsGetCall {
  25386. c.ctx_ = ctx
  25387. return c
  25388. }
  25389. // Header returns an http.Header that can be modified by the caller to
  25390. // add HTTP headers to the request.
  25391. func (c *DirectorySiteContactsGetCall) Header() http.Header {
  25392. if c.header_ == nil {
  25393. c.header_ = make(http.Header)
  25394. }
  25395. return c.header_
  25396. }
  25397. func (c *DirectorySiteContactsGetCall) doRequest(alt string) (*http.Response, error) {
  25398. reqHeaders := make(http.Header)
  25399. for k, v := range c.header_ {
  25400. reqHeaders[k] = v
  25401. }
  25402. reqHeaders.Set("User-Agent", c.s.userAgent())
  25403. if c.ifNoneMatch_ != "" {
  25404. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25405. }
  25406. var body io.Reader = nil
  25407. c.urlParams_.Set("alt", alt)
  25408. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts/{id}")
  25409. urls += "?" + c.urlParams_.Encode()
  25410. req, _ := http.NewRequest("GET", urls, body)
  25411. req.Header = reqHeaders
  25412. googleapi.Expand(req.URL, map[string]string{
  25413. "profileId": strconv.FormatInt(c.profileId, 10),
  25414. "id": strconv.FormatInt(c.id, 10),
  25415. })
  25416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25417. }
  25418. // Do executes the "dfareporting.directorySiteContacts.get" call.
  25419. // Exactly one of *DirectorySiteContact or error will be non-nil. Any
  25420. // non-2xx status code is an error. Response headers are in either
  25421. // *DirectorySiteContact.ServerResponse.Header or (if a response was
  25422. // returned at all) in error.(*googleapi.Error).Header. Use
  25423. // googleapi.IsNotModified to check whether the returned error was
  25424. // because http.StatusNotModified was returned.
  25425. func (c *DirectorySiteContactsGetCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContact, error) {
  25426. gensupport.SetOptions(c.urlParams_, opts...)
  25427. res, err := c.doRequest("json")
  25428. if res != nil && res.StatusCode == http.StatusNotModified {
  25429. if res.Body != nil {
  25430. res.Body.Close()
  25431. }
  25432. return nil, &googleapi.Error{
  25433. Code: res.StatusCode,
  25434. Header: res.Header,
  25435. }
  25436. }
  25437. if err != nil {
  25438. return nil, err
  25439. }
  25440. defer googleapi.CloseBody(res)
  25441. if err := googleapi.CheckResponse(res); err != nil {
  25442. return nil, err
  25443. }
  25444. ret := &DirectorySiteContact{
  25445. ServerResponse: googleapi.ServerResponse{
  25446. Header: res.Header,
  25447. HTTPStatusCode: res.StatusCode,
  25448. },
  25449. }
  25450. target := &ret
  25451. if err := gensupport.DecodeResponse(target, res); err != nil {
  25452. return nil, err
  25453. }
  25454. return ret, nil
  25455. // {
  25456. // "description": "Gets one directory site contact by ID.",
  25457. // "httpMethod": "GET",
  25458. // "id": "dfareporting.directorySiteContacts.get",
  25459. // "parameterOrder": [
  25460. // "profileId",
  25461. // "id"
  25462. // ],
  25463. // "parameters": {
  25464. // "id": {
  25465. // "description": "Directory site contact ID.",
  25466. // "format": "int64",
  25467. // "location": "path",
  25468. // "required": true,
  25469. // "type": "string"
  25470. // },
  25471. // "profileId": {
  25472. // "description": "User profile ID associated with this request.",
  25473. // "format": "int64",
  25474. // "location": "path",
  25475. // "required": true,
  25476. // "type": "string"
  25477. // }
  25478. // },
  25479. // "path": "userprofiles/{profileId}/directorySiteContacts/{id}",
  25480. // "response": {
  25481. // "$ref": "DirectorySiteContact"
  25482. // },
  25483. // "scopes": [
  25484. // "https://www.googleapis.com/auth/dfatrafficking"
  25485. // ]
  25486. // }
  25487. }
  25488. // method id "dfareporting.directorySiteContacts.list":
  25489. type DirectorySiteContactsListCall struct {
  25490. s *Service
  25491. profileId int64
  25492. urlParams_ gensupport.URLParams
  25493. ifNoneMatch_ string
  25494. ctx_ context.Context
  25495. header_ http.Header
  25496. }
  25497. // List: Retrieves a list of directory site contacts, possibly filtered.
  25498. // This method supports paging.
  25499. func (r *DirectorySiteContactsService) List(profileId int64) *DirectorySiteContactsListCall {
  25500. c := &DirectorySiteContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25501. c.profileId = profileId
  25502. return c
  25503. }
  25504. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  25505. // Select only directory site contacts with these directory site IDs.
  25506. // This is a required field.
  25507. func (c *DirectorySiteContactsListCall) DirectorySiteIds(directorySiteIds ...int64) *DirectorySiteContactsListCall {
  25508. var directorySiteIds_ []string
  25509. for _, v := range directorySiteIds {
  25510. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  25511. }
  25512. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  25513. return c
  25514. }
  25515. // Ids sets the optional parameter "ids": Select only directory site
  25516. // contacts with these IDs.
  25517. func (c *DirectorySiteContactsListCall) Ids(ids ...int64) *DirectorySiteContactsListCall {
  25518. var ids_ []string
  25519. for _, v := range ids {
  25520. ids_ = append(ids_, fmt.Sprint(v))
  25521. }
  25522. c.urlParams_.SetMulti("ids", ids_)
  25523. return c
  25524. }
  25525. // MaxResults sets the optional parameter "maxResults": Maximum number
  25526. // of results to return.
  25527. func (c *DirectorySiteContactsListCall) MaxResults(maxResults int64) *DirectorySiteContactsListCall {
  25528. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  25529. return c
  25530. }
  25531. // PageToken sets the optional parameter "pageToken": Value of the
  25532. // nextPageToken from the previous result page.
  25533. func (c *DirectorySiteContactsListCall) PageToken(pageToken string) *DirectorySiteContactsListCall {
  25534. c.urlParams_.Set("pageToken", pageToken)
  25535. return c
  25536. }
  25537. // SearchString sets the optional parameter "searchString": Allows
  25538. // searching for objects by name, ID or email. Wildcards (*) are
  25539. // allowed. For example, "directory site contact*2015" will return
  25540. // objects with names like "directory site contact June 2015",
  25541. // "directory site contact April 2015", or simply "directory site
  25542. // contact 2015". Most of the searches also add wildcards implicitly at
  25543. // the start and the end of the search string. For example, a search
  25544. // string of "directory site contact" will match objects with name "my
  25545. // directory site contact", "directory site contact 2015", or simply
  25546. // "directory site contact".
  25547. func (c *DirectorySiteContactsListCall) SearchString(searchString string) *DirectorySiteContactsListCall {
  25548. c.urlParams_.Set("searchString", searchString)
  25549. return c
  25550. }
  25551. // SortField sets the optional parameter "sortField": Field by which to
  25552. // sort the list.
  25553. //
  25554. // Possible values:
  25555. // "ID" (default)
  25556. // "NAME"
  25557. func (c *DirectorySiteContactsListCall) SortField(sortField string) *DirectorySiteContactsListCall {
  25558. c.urlParams_.Set("sortField", sortField)
  25559. return c
  25560. }
  25561. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  25562. // results.
  25563. //
  25564. // Possible values:
  25565. // "ASCENDING" (default)
  25566. // "DESCENDING"
  25567. func (c *DirectorySiteContactsListCall) SortOrder(sortOrder string) *DirectorySiteContactsListCall {
  25568. c.urlParams_.Set("sortOrder", sortOrder)
  25569. return c
  25570. }
  25571. // Fields allows partial responses to be retrieved. See
  25572. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25573. // for more information.
  25574. func (c *DirectorySiteContactsListCall) Fields(s ...googleapi.Field) *DirectorySiteContactsListCall {
  25575. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25576. return c
  25577. }
  25578. // IfNoneMatch sets the optional parameter which makes the operation
  25579. // fail if the object's ETag matches the given value. This is useful for
  25580. // getting updates only after the object has changed since the last
  25581. // request. Use googleapi.IsNotModified to check whether the response
  25582. // error from Do is the result of In-None-Match.
  25583. func (c *DirectorySiteContactsListCall) IfNoneMatch(entityTag string) *DirectorySiteContactsListCall {
  25584. c.ifNoneMatch_ = entityTag
  25585. return c
  25586. }
  25587. // Context sets the context to be used in this call's Do method. Any
  25588. // pending HTTP request will be aborted if the provided context is
  25589. // canceled.
  25590. func (c *DirectorySiteContactsListCall) Context(ctx context.Context) *DirectorySiteContactsListCall {
  25591. c.ctx_ = ctx
  25592. return c
  25593. }
  25594. // Header returns an http.Header that can be modified by the caller to
  25595. // add HTTP headers to the request.
  25596. func (c *DirectorySiteContactsListCall) Header() http.Header {
  25597. if c.header_ == nil {
  25598. c.header_ = make(http.Header)
  25599. }
  25600. return c.header_
  25601. }
  25602. func (c *DirectorySiteContactsListCall) doRequest(alt string) (*http.Response, error) {
  25603. reqHeaders := make(http.Header)
  25604. for k, v := range c.header_ {
  25605. reqHeaders[k] = v
  25606. }
  25607. reqHeaders.Set("User-Agent", c.s.userAgent())
  25608. if c.ifNoneMatch_ != "" {
  25609. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25610. }
  25611. var body io.Reader = nil
  25612. c.urlParams_.Set("alt", alt)
  25613. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts")
  25614. urls += "?" + c.urlParams_.Encode()
  25615. req, _ := http.NewRequest("GET", urls, body)
  25616. req.Header = reqHeaders
  25617. googleapi.Expand(req.URL, map[string]string{
  25618. "profileId": strconv.FormatInt(c.profileId, 10),
  25619. })
  25620. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25621. }
  25622. // Do executes the "dfareporting.directorySiteContacts.list" call.
  25623. // Exactly one of *DirectorySiteContactsListResponse or error will be
  25624. // non-nil. Any non-2xx status code is an error. Response headers are in
  25625. // either *DirectorySiteContactsListResponse.ServerResponse.Header or
  25626. // (if a response was returned at all) in
  25627. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  25628. // whether the returned error was because http.StatusNotModified was
  25629. // returned.
  25630. func (c *DirectorySiteContactsListCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContactsListResponse, error) {
  25631. gensupport.SetOptions(c.urlParams_, opts...)
  25632. res, err := c.doRequest("json")
  25633. if res != nil && res.StatusCode == http.StatusNotModified {
  25634. if res.Body != nil {
  25635. res.Body.Close()
  25636. }
  25637. return nil, &googleapi.Error{
  25638. Code: res.StatusCode,
  25639. Header: res.Header,
  25640. }
  25641. }
  25642. if err != nil {
  25643. return nil, err
  25644. }
  25645. defer googleapi.CloseBody(res)
  25646. if err := googleapi.CheckResponse(res); err != nil {
  25647. return nil, err
  25648. }
  25649. ret := &DirectorySiteContactsListResponse{
  25650. ServerResponse: googleapi.ServerResponse{
  25651. Header: res.Header,
  25652. HTTPStatusCode: res.StatusCode,
  25653. },
  25654. }
  25655. target := &ret
  25656. if err := gensupport.DecodeResponse(target, res); err != nil {
  25657. return nil, err
  25658. }
  25659. return ret, nil
  25660. // {
  25661. // "description": "Retrieves a list of directory site contacts, possibly filtered. This method supports paging.",
  25662. // "httpMethod": "GET",
  25663. // "id": "dfareporting.directorySiteContacts.list",
  25664. // "parameterOrder": [
  25665. // "profileId"
  25666. // ],
  25667. // "parameters": {
  25668. // "directorySiteIds": {
  25669. // "description": "Select only directory site contacts with these directory site IDs. This is a required field.",
  25670. // "format": "int64",
  25671. // "location": "query",
  25672. // "repeated": true,
  25673. // "type": "string"
  25674. // },
  25675. // "ids": {
  25676. // "description": "Select only directory site contacts with these IDs.",
  25677. // "format": "int64",
  25678. // "location": "query",
  25679. // "repeated": true,
  25680. // "type": "string"
  25681. // },
  25682. // "maxResults": {
  25683. // "default": "1000",
  25684. // "description": "Maximum number of results to return.",
  25685. // "format": "int32",
  25686. // "location": "query",
  25687. // "maximum": "1000",
  25688. // "minimum": "0",
  25689. // "type": "integer"
  25690. // },
  25691. // "pageToken": {
  25692. // "description": "Value of the nextPageToken from the previous result page.",
  25693. // "location": "query",
  25694. // "type": "string"
  25695. // },
  25696. // "profileId": {
  25697. // "description": "User profile ID associated with this request.",
  25698. // "format": "int64",
  25699. // "location": "path",
  25700. // "required": true,
  25701. // "type": "string"
  25702. // },
  25703. // "searchString": {
  25704. // "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\".",
  25705. // "location": "query",
  25706. // "type": "string"
  25707. // },
  25708. // "sortField": {
  25709. // "default": "ID",
  25710. // "description": "Field by which to sort the list.",
  25711. // "enum": [
  25712. // "ID",
  25713. // "NAME"
  25714. // ],
  25715. // "enumDescriptions": [
  25716. // "",
  25717. // ""
  25718. // ],
  25719. // "location": "query",
  25720. // "type": "string"
  25721. // },
  25722. // "sortOrder": {
  25723. // "default": "ASCENDING",
  25724. // "description": "Order of sorted results.",
  25725. // "enum": [
  25726. // "ASCENDING",
  25727. // "DESCENDING"
  25728. // ],
  25729. // "enumDescriptions": [
  25730. // "",
  25731. // ""
  25732. // ],
  25733. // "location": "query",
  25734. // "type": "string"
  25735. // }
  25736. // },
  25737. // "path": "userprofiles/{profileId}/directorySiteContacts",
  25738. // "response": {
  25739. // "$ref": "DirectorySiteContactsListResponse"
  25740. // },
  25741. // "scopes": [
  25742. // "https://www.googleapis.com/auth/dfatrafficking"
  25743. // ]
  25744. // }
  25745. }
  25746. // Pages invokes f for each page of results.
  25747. // A non-nil error returned from f will halt the iteration.
  25748. // The provided context supersedes any context provided to the Context method.
  25749. func (c *DirectorySiteContactsListCall) Pages(ctx context.Context, f func(*DirectorySiteContactsListResponse) error) error {
  25750. c.ctx_ = ctx
  25751. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25752. for {
  25753. x, err := c.Do()
  25754. if err != nil {
  25755. return err
  25756. }
  25757. if err := f(x); err != nil {
  25758. return err
  25759. }
  25760. if x.NextPageToken == "" {
  25761. return nil
  25762. }
  25763. c.PageToken(x.NextPageToken)
  25764. }
  25765. }
  25766. // method id "dfareporting.directorySites.get":
  25767. type DirectorySitesGetCall struct {
  25768. s *Service
  25769. profileId int64
  25770. id int64
  25771. urlParams_ gensupport.URLParams
  25772. ifNoneMatch_ string
  25773. ctx_ context.Context
  25774. header_ http.Header
  25775. }
  25776. // Get: Gets one directory site by ID.
  25777. func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall {
  25778. c := &DirectorySitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25779. c.profileId = profileId
  25780. c.id = id
  25781. return c
  25782. }
  25783. // Fields allows partial responses to be retrieved. See
  25784. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25785. // for more information.
  25786. func (c *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall {
  25787. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25788. return c
  25789. }
  25790. // IfNoneMatch sets the optional parameter which makes the operation
  25791. // fail if the object's ETag matches the given value. This is useful for
  25792. // getting updates only after the object has changed since the last
  25793. // request. Use googleapi.IsNotModified to check whether the response
  25794. // error from Do is the result of In-None-Match.
  25795. func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall {
  25796. c.ifNoneMatch_ = entityTag
  25797. return c
  25798. }
  25799. // Context sets the context to be used in this call's Do method. Any
  25800. // pending HTTP request will be aborted if the provided context is
  25801. // canceled.
  25802. func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall {
  25803. c.ctx_ = ctx
  25804. return c
  25805. }
  25806. // Header returns an http.Header that can be modified by the caller to
  25807. // add HTTP headers to the request.
  25808. func (c *DirectorySitesGetCall) Header() http.Header {
  25809. if c.header_ == nil {
  25810. c.header_ = make(http.Header)
  25811. }
  25812. return c.header_
  25813. }
  25814. func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) {
  25815. reqHeaders := make(http.Header)
  25816. for k, v := range c.header_ {
  25817. reqHeaders[k] = v
  25818. }
  25819. reqHeaders.Set("User-Agent", c.s.userAgent())
  25820. if c.ifNoneMatch_ != "" {
  25821. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25822. }
  25823. var body io.Reader = nil
  25824. c.urlParams_.Set("alt", alt)
  25825. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}")
  25826. urls += "?" + c.urlParams_.Encode()
  25827. req, _ := http.NewRequest("GET", urls, body)
  25828. req.Header = reqHeaders
  25829. googleapi.Expand(req.URL, map[string]string{
  25830. "profileId": strconv.FormatInt(c.profileId, 10),
  25831. "id": strconv.FormatInt(c.id, 10),
  25832. })
  25833. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25834. }
  25835. // Do executes the "dfareporting.directorySites.get" call.
  25836. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  25837. // status code is an error. Response headers are in either
  25838. // *DirectorySite.ServerResponse.Header or (if a response was returned
  25839. // at all) in error.(*googleapi.Error).Header. Use
  25840. // googleapi.IsNotModified to check whether the returned error was
  25841. // because http.StatusNotModified was returned.
  25842. func (c *DirectorySitesGetCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  25843. gensupport.SetOptions(c.urlParams_, opts...)
  25844. res, err := c.doRequest("json")
  25845. if res != nil && res.StatusCode == http.StatusNotModified {
  25846. if res.Body != nil {
  25847. res.Body.Close()
  25848. }
  25849. return nil, &googleapi.Error{
  25850. Code: res.StatusCode,
  25851. Header: res.Header,
  25852. }
  25853. }
  25854. if err != nil {
  25855. return nil, err
  25856. }
  25857. defer googleapi.CloseBody(res)
  25858. if err := googleapi.CheckResponse(res); err != nil {
  25859. return nil, err
  25860. }
  25861. ret := &DirectorySite{
  25862. ServerResponse: googleapi.ServerResponse{
  25863. Header: res.Header,
  25864. HTTPStatusCode: res.StatusCode,
  25865. },
  25866. }
  25867. target := &ret
  25868. if err := gensupport.DecodeResponse(target, res); err != nil {
  25869. return nil, err
  25870. }
  25871. return ret, nil
  25872. // {
  25873. // "description": "Gets one directory site by ID.",
  25874. // "httpMethod": "GET",
  25875. // "id": "dfareporting.directorySites.get",
  25876. // "parameterOrder": [
  25877. // "profileId",
  25878. // "id"
  25879. // ],
  25880. // "parameters": {
  25881. // "id": {
  25882. // "description": "Directory site ID.",
  25883. // "format": "int64",
  25884. // "location": "path",
  25885. // "required": true,
  25886. // "type": "string"
  25887. // },
  25888. // "profileId": {
  25889. // "description": "User profile ID associated with this request.",
  25890. // "format": "int64",
  25891. // "location": "path",
  25892. // "required": true,
  25893. // "type": "string"
  25894. // }
  25895. // },
  25896. // "path": "userprofiles/{profileId}/directorySites/{id}",
  25897. // "response": {
  25898. // "$ref": "DirectorySite"
  25899. // },
  25900. // "scopes": [
  25901. // "https://www.googleapis.com/auth/dfatrafficking"
  25902. // ]
  25903. // }
  25904. }
  25905. // method id "dfareporting.directorySites.insert":
  25906. type DirectorySitesInsertCall struct {
  25907. s *Service
  25908. profileId int64
  25909. directorysite *DirectorySite
  25910. urlParams_ gensupport.URLParams
  25911. ctx_ context.Context
  25912. header_ http.Header
  25913. }
  25914. // Insert: Inserts a new directory site.
  25915. func (r *DirectorySitesService) Insert(profileId int64, directorysite *DirectorySite) *DirectorySitesInsertCall {
  25916. c := &DirectorySitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25917. c.profileId = profileId
  25918. c.directorysite = directorysite
  25919. return c
  25920. }
  25921. // Fields allows partial responses to be retrieved. See
  25922. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25923. // for more information.
  25924. func (c *DirectorySitesInsertCall) Fields(s ...googleapi.Field) *DirectorySitesInsertCall {
  25925. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25926. return c
  25927. }
  25928. // Context sets the context to be used in this call's Do method. Any
  25929. // pending HTTP request will be aborted if the provided context is
  25930. // canceled.
  25931. func (c *DirectorySitesInsertCall) Context(ctx context.Context) *DirectorySitesInsertCall {
  25932. c.ctx_ = ctx
  25933. return c
  25934. }
  25935. // Header returns an http.Header that can be modified by the caller to
  25936. // add HTTP headers to the request.
  25937. func (c *DirectorySitesInsertCall) Header() http.Header {
  25938. if c.header_ == nil {
  25939. c.header_ = make(http.Header)
  25940. }
  25941. return c.header_
  25942. }
  25943. func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) {
  25944. reqHeaders := make(http.Header)
  25945. for k, v := range c.header_ {
  25946. reqHeaders[k] = v
  25947. }
  25948. reqHeaders.Set("User-Agent", c.s.userAgent())
  25949. var body io.Reader = nil
  25950. body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite)
  25951. if err != nil {
  25952. return nil, err
  25953. }
  25954. reqHeaders.Set("Content-Type", "application/json")
  25955. c.urlParams_.Set("alt", alt)
  25956. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  25957. urls += "?" + c.urlParams_.Encode()
  25958. req, _ := http.NewRequest("POST", urls, body)
  25959. req.Header = reqHeaders
  25960. googleapi.Expand(req.URL, map[string]string{
  25961. "profileId": strconv.FormatInt(c.profileId, 10),
  25962. })
  25963. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25964. }
  25965. // Do executes the "dfareporting.directorySites.insert" call.
  25966. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  25967. // status code is an error. Response headers are in either
  25968. // *DirectorySite.ServerResponse.Header or (if a response was returned
  25969. // at all) in error.(*googleapi.Error).Header. Use
  25970. // googleapi.IsNotModified to check whether the returned error was
  25971. // because http.StatusNotModified was returned.
  25972. func (c *DirectorySitesInsertCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  25973. gensupport.SetOptions(c.urlParams_, opts...)
  25974. res, err := c.doRequest("json")
  25975. if res != nil && res.StatusCode == http.StatusNotModified {
  25976. if res.Body != nil {
  25977. res.Body.Close()
  25978. }
  25979. return nil, &googleapi.Error{
  25980. Code: res.StatusCode,
  25981. Header: res.Header,
  25982. }
  25983. }
  25984. if err != nil {
  25985. return nil, err
  25986. }
  25987. defer googleapi.CloseBody(res)
  25988. if err := googleapi.CheckResponse(res); err != nil {
  25989. return nil, err
  25990. }
  25991. ret := &DirectorySite{
  25992. ServerResponse: googleapi.ServerResponse{
  25993. Header: res.Header,
  25994. HTTPStatusCode: res.StatusCode,
  25995. },
  25996. }
  25997. target := &ret
  25998. if err := gensupport.DecodeResponse(target, res); err != nil {
  25999. return nil, err
  26000. }
  26001. return ret, nil
  26002. // {
  26003. // "description": "Inserts a new directory site.",
  26004. // "httpMethod": "POST",
  26005. // "id": "dfareporting.directorySites.insert",
  26006. // "parameterOrder": [
  26007. // "profileId"
  26008. // ],
  26009. // "parameters": {
  26010. // "profileId": {
  26011. // "description": "User profile ID associated with this request.",
  26012. // "format": "int64",
  26013. // "location": "path",
  26014. // "required": true,
  26015. // "type": "string"
  26016. // }
  26017. // },
  26018. // "path": "userprofiles/{profileId}/directorySites",
  26019. // "request": {
  26020. // "$ref": "DirectorySite"
  26021. // },
  26022. // "response": {
  26023. // "$ref": "DirectorySite"
  26024. // },
  26025. // "scopes": [
  26026. // "https://www.googleapis.com/auth/dfatrafficking"
  26027. // ]
  26028. // }
  26029. }
  26030. // method id "dfareporting.directorySites.list":
  26031. type DirectorySitesListCall struct {
  26032. s *Service
  26033. profileId int64
  26034. urlParams_ gensupport.URLParams
  26035. ifNoneMatch_ string
  26036. ctx_ context.Context
  26037. header_ http.Header
  26038. }
  26039. // List: Retrieves a list of directory sites, possibly filtered. This
  26040. // method supports paging.
  26041. func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall {
  26042. c := &DirectorySitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26043. c.profileId = profileId
  26044. return c
  26045. }
  26046. // AcceptsInStreamVideoPlacements sets the optional parameter
  26047. // "acceptsInStreamVideoPlacements": This search filter is no longer
  26048. // supported and will have no effect on the results returned.
  26049. func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall {
  26050. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  26051. return c
  26052. }
  26053. // AcceptsInterstitialPlacements sets the optional parameter
  26054. // "acceptsInterstitialPlacements": This search filter is no longer
  26055. // supported and will have no effect on the results returned.
  26056. func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall {
  26057. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  26058. return c
  26059. }
  26060. // AcceptsPublisherPaidPlacements sets the optional parameter
  26061. // "acceptsPublisherPaidPlacements": Select only directory sites that
  26062. // accept publisher paid placements. This field can be left blank.
  26063. func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall {
  26064. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  26065. return c
  26066. }
  26067. // Active sets the optional parameter "active": Select only active
  26068. // directory sites. Leave blank to retrieve both active and inactive
  26069. // directory sites.
  26070. func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall {
  26071. c.urlParams_.Set("active", fmt.Sprint(active))
  26072. return c
  26073. }
  26074. // CountryId sets the optional parameter "countryId": Select only
  26075. // directory sites with this country ID.
  26076. func (c *DirectorySitesListCall) CountryId(countryId int64) *DirectorySitesListCall {
  26077. c.urlParams_.Set("countryId", fmt.Sprint(countryId))
  26078. return c
  26079. }
  26080. // DfpNetworkCode sets the optional parameter "dfpNetworkCode": Select
  26081. // only directory sites with this DFP network code.
  26082. func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall {
  26083. c.urlParams_.Set("dfpNetworkCode", dfpNetworkCode)
  26084. return c
  26085. }
  26086. // Ids sets the optional parameter "ids": Select only directory sites
  26087. // with these IDs.
  26088. func (c *DirectorySitesListCall) Ids(ids ...int64) *DirectorySitesListCall {
  26089. var ids_ []string
  26090. for _, v := range ids {
  26091. ids_ = append(ids_, fmt.Sprint(v))
  26092. }
  26093. c.urlParams_.SetMulti("ids", ids_)
  26094. return c
  26095. }
  26096. // MaxResults sets the optional parameter "maxResults": Maximum number
  26097. // of results to return.
  26098. func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall {
  26099. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26100. return c
  26101. }
  26102. // PageToken sets the optional parameter "pageToken": Value of the
  26103. // nextPageToken from the previous result page.
  26104. func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall {
  26105. c.urlParams_.Set("pageToken", pageToken)
  26106. return c
  26107. }
  26108. // ParentId sets the optional parameter "parentId": Select only
  26109. // directory sites with this parent ID.
  26110. func (c *DirectorySitesListCall) ParentId(parentId int64) *DirectorySitesListCall {
  26111. c.urlParams_.Set("parentId", fmt.Sprint(parentId))
  26112. return c
  26113. }
  26114. // SearchString sets the optional parameter "searchString": Allows
  26115. // searching for objects by name, ID or URL. Wildcards (*) are allowed.
  26116. // For example, "directory site*2015" will return objects with names
  26117. // like "directory site June 2015", "directory site April 2015", or
  26118. // simply "directory site 2015". Most of the searches also add wildcards
  26119. // implicitly at the start and the end of the search string. For
  26120. // example, a search string of "directory site" will match objects with
  26121. // name "my directory site", "directory site 2015" or simply, "directory
  26122. // site".
  26123. func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall {
  26124. c.urlParams_.Set("searchString", searchString)
  26125. return c
  26126. }
  26127. // SortField sets the optional parameter "sortField": Field by which to
  26128. // sort the list.
  26129. //
  26130. // Possible values:
  26131. // "ID" (default)
  26132. // "NAME"
  26133. func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall {
  26134. c.urlParams_.Set("sortField", sortField)
  26135. return c
  26136. }
  26137. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26138. // results.
  26139. //
  26140. // Possible values:
  26141. // "ASCENDING" (default)
  26142. // "DESCENDING"
  26143. func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall {
  26144. c.urlParams_.Set("sortOrder", sortOrder)
  26145. return c
  26146. }
  26147. // Fields allows partial responses to be retrieved. See
  26148. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26149. // for more information.
  26150. func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall {
  26151. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26152. return c
  26153. }
  26154. // IfNoneMatch sets the optional parameter which makes the operation
  26155. // fail if the object's ETag matches the given value. This is useful for
  26156. // getting updates only after the object has changed since the last
  26157. // request. Use googleapi.IsNotModified to check whether the response
  26158. // error from Do is the result of In-None-Match.
  26159. func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall {
  26160. c.ifNoneMatch_ = entityTag
  26161. return c
  26162. }
  26163. // Context sets the context to be used in this call's Do method. Any
  26164. // pending HTTP request will be aborted if the provided context is
  26165. // canceled.
  26166. func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall {
  26167. c.ctx_ = ctx
  26168. return c
  26169. }
  26170. // Header returns an http.Header that can be modified by the caller to
  26171. // add HTTP headers to the request.
  26172. func (c *DirectorySitesListCall) Header() http.Header {
  26173. if c.header_ == nil {
  26174. c.header_ = make(http.Header)
  26175. }
  26176. return c.header_
  26177. }
  26178. func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) {
  26179. reqHeaders := make(http.Header)
  26180. for k, v := range c.header_ {
  26181. reqHeaders[k] = v
  26182. }
  26183. reqHeaders.Set("User-Agent", c.s.userAgent())
  26184. if c.ifNoneMatch_ != "" {
  26185. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26186. }
  26187. var body io.Reader = nil
  26188. c.urlParams_.Set("alt", alt)
  26189. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  26190. urls += "?" + c.urlParams_.Encode()
  26191. req, _ := http.NewRequest("GET", urls, body)
  26192. req.Header = reqHeaders
  26193. googleapi.Expand(req.URL, map[string]string{
  26194. "profileId": strconv.FormatInt(c.profileId, 10),
  26195. })
  26196. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26197. }
  26198. // Do executes the "dfareporting.directorySites.list" call.
  26199. // Exactly one of *DirectorySitesListResponse or error will be non-nil.
  26200. // Any non-2xx status code is an error. Response headers are in either
  26201. // *DirectorySitesListResponse.ServerResponse.Header or (if a response
  26202. // was returned at all) in error.(*googleapi.Error).Header. Use
  26203. // googleapi.IsNotModified to check whether the returned error was
  26204. // because http.StatusNotModified was returned.
  26205. func (c *DirectorySitesListCall) Do(opts ...googleapi.CallOption) (*DirectorySitesListResponse, error) {
  26206. gensupport.SetOptions(c.urlParams_, opts...)
  26207. res, err := c.doRequest("json")
  26208. if res != nil && res.StatusCode == http.StatusNotModified {
  26209. if res.Body != nil {
  26210. res.Body.Close()
  26211. }
  26212. return nil, &googleapi.Error{
  26213. Code: res.StatusCode,
  26214. Header: res.Header,
  26215. }
  26216. }
  26217. if err != nil {
  26218. return nil, err
  26219. }
  26220. defer googleapi.CloseBody(res)
  26221. if err := googleapi.CheckResponse(res); err != nil {
  26222. return nil, err
  26223. }
  26224. ret := &DirectorySitesListResponse{
  26225. ServerResponse: googleapi.ServerResponse{
  26226. Header: res.Header,
  26227. HTTPStatusCode: res.StatusCode,
  26228. },
  26229. }
  26230. target := &ret
  26231. if err := gensupport.DecodeResponse(target, res); err != nil {
  26232. return nil, err
  26233. }
  26234. return ret, nil
  26235. // {
  26236. // "description": "Retrieves a list of directory sites, possibly filtered. This method supports paging.",
  26237. // "httpMethod": "GET",
  26238. // "id": "dfareporting.directorySites.list",
  26239. // "parameterOrder": [
  26240. // "profileId"
  26241. // ],
  26242. // "parameters": {
  26243. // "acceptsInStreamVideoPlacements": {
  26244. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26245. // "location": "query",
  26246. // "type": "boolean"
  26247. // },
  26248. // "acceptsInterstitialPlacements": {
  26249. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  26250. // "location": "query",
  26251. // "type": "boolean"
  26252. // },
  26253. // "acceptsPublisherPaidPlacements": {
  26254. // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.",
  26255. // "location": "query",
  26256. // "type": "boolean"
  26257. // },
  26258. // "active": {
  26259. // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.",
  26260. // "location": "query",
  26261. // "type": "boolean"
  26262. // },
  26263. // "countryId": {
  26264. // "description": "Select only directory sites with this country ID.",
  26265. // "format": "int64",
  26266. // "location": "query",
  26267. // "type": "string"
  26268. // },
  26269. // "dfpNetworkCode": {
  26270. // "description": "Select only directory sites with this DFP network code.",
  26271. // "location": "query",
  26272. // "type": "string"
  26273. // },
  26274. // "ids": {
  26275. // "description": "Select only directory sites with these IDs.",
  26276. // "format": "int64",
  26277. // "location": "query",
  26278. // "repeated": true,
  26279. // "type": "string"
  26280. // },
  26281. // "maxResults": {
  26282. // "default": "1000",
  26283. // "description": "Maximum number of results to return.",
  26284. // "format": "int32",
  26285. // "location": "query",
  26286. // "maximum": "1000",
  26287. // "minimum": "0",
  26288. // "type": "integer"
  26289. // },
  26290. // "pageToken": {
  26291. // "description": "Value of the nextPageToken from the previous result page.",
  26292. // "location": "query",
  26293. // "type": "string"
  26294. // },
  26295. // "parentId": {
  26296. // "description": "Select only directory sites with this parent ID.",
  26297. // "format": "int64",
  26298. // "location": "query",
  26299. // "type": "string"
  26300. // },
  26301. // "profileId": {
  26302. // "description": "User profile ID associated with this request.",
  26303. // "format": "int64",
  26304. // "location": "path",
  26305. // "required": true,
  26306. // "type": "string"
  26307. // },
  26308. // "searchString": {
  26309. // "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\".",
  26310. // "location": "query",
  26311. // "type": "string"
  26312. // },
  26313. // "sortField": {
  26314. // "default": "ID",
  26315. // "description": "Field by which to sort the list.",
  26316. // "enum": [
  26317. // "ID",
  26318. // "NAME"
  26319. // ],
  26320. // "enumDescriptions": [
  26321. // "",
  26322. // ""
  26323. // ],
  26324. // "location": "query",
  26325. // "type": "string"
  26326. // },
  26327. // "sortOrder": {
  26328. // "default": "ASCENDING",
  26329. // "description": "Order of sorted results.",
  26330. // "enum": [
  26331. // "ASCENDING",
  26332. // "DESCENDING"
  26333. // ],
  26334. // "enumDescriptions": [
  26335. // "",
  26336. // ""
  26337. // ],
  26338. // "location": "query",
  26339. // "type": "string"
  26340. // }
  26341. // },
  26342. // "path": "userprofiles/{profileId}/directorySites",
  26343. // "response": {
  26344. // "$ref": "DirectorySitesListResponse"
  26345. // },
  26346. // "scopes": [
  26347. // "https://www.googleapis.com/auth/dfatrafficking"
  26348. // ]
  26349. // }
  26350. }
  26351. // Pages invokes f for each page of results.
  26352. // A non-nil error returned from f will halt the iteration.
  26353. // The provided context supersedes any context provided to the Context method.
  26354. func (c *DirectorySitesListCall) Pages(ctx context.Context, f func(*DirectorySitesListResponse) error) error {
  26355. c.ctx_ = ctx
  26356. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26357. for {
  26358. x, err := c.Do()
  26359. if err != nil {
  26360. return err
  26361. }
  26362. if err := f(x); err != nil {
  26363. return err
  26364. }
  26365. if x.NextPageToken == "" {
  26366. return nil
  26367. }
  26368. c.PageToken(x.NextPageToken)
  26369. }
  26370. }
  26371. // method id "dfareporting.dynamicTargetingKeys.delete":
  26372. type DynamicTargetingKeysDeleteCall struct {
  26373. s *Service
  26374. profileId int64
  26375. objectId int64
  26376. urlParams_ gensupport.URLParams
  26377. ctx_ context.Context
  26378. header_ http.Header
  26379. }
  26380. // Delete: Deletes an existing dynamic targeting key.
  26381. func (r *DynamicTargetingKeysService) Delete(profileId int64, objectId int64, name string, objectType string) *DynamicTargetingKeysDeleteCall {
  26382. c := &DynamicTargetingKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26383. c.profileId = profileId
  26384. c.objectId = objectId
  26385. c.urlParams_.Set("name", name)
  26386. c.urlParams_.Set("objectType", objectType)
  26387. return c
  26388. }
  26389. // Fields allows partial responses to be retrieved. See
  26390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26391. // for more information.
  26392. func (c *DynamicTargetingKeysDeleteCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysDeleteCall {
  26393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26394. return c
  26395. }
  26396. // Context sets the context to be used in this call's Do method. Any
  26397. // pending HTTP request will be aborted if the provided context is
  26398. // canceled.
  26399. func (c *DynamicTargetingKeysDeleteCall) Context(ctx context.Context) *DynamicTargetingKeysDeleteCall {
  26400. c.ctx_ = ctx
  26401. return c
  26402. }
  26403. // Header returns an http.Header that can be modified by the caller to
  26404. // add HTTP headers to the request.
  26405. func (c *DynamicTargetingKeysDeleteCall) Header() http.Header {
  26406. if c.header_ == nil {
  26407. c.header_ = make(http.Header)
  26408. }
  26409. return c.header_
  26410. }
  26411. func (c *DynamicTargetingKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  26412. reqHeaders := make(http.Header)
  26413. for k, v := range c.header_ {
  26414. reqHeaders[k] = v
  26415. }
  26416. reqHeaders.Set("User-Agent", c.s.userAgent())
  26417. var body io.Reader = nil
  26418. c.urlParams_.Set("alt", alt)
  26419. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}")
  26420. urls += "?" + c.urlParams_.Encode()
  26421. req, _ := http.NewRequest("DELETE", urls, body)
  26422. req.Header = reqHeaders
  26423. googleapi.Expand(req.URL, map[string]string{
  26424. "profileId": strconv.FormatInt(c.profileId, 10),
  26425. "objectId": strconv.FormatInt(c.objectId, 10),
  26426. })
  26427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26428. }
  26429. // Do executes the "dfareporting.dynamicTargetingKeys.delete" call.
  26430. func (c *DynamicTargetingKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
  26431. gensupport.SetOptions(c.urlParams_, opts...)
  26432. res, err := c.doRequest("json")
  26433. if err != nil {
  26434. return err
  26435. }
  26436. defer googleapi.CloseBody(res)
  26437. if err := googleapi.CheckResponse(res); err != nil {
  26438. return err
  26439. }
  26440. return nil
  26441. // {
  26442. // "description": "Deletes an existing dynamic targeting key.",
  26443. // "httpMethod": "DELETE",
  26444. // "id": "dfareporting.dynamicTargetingKeys.delete",
  26445. // "parameterOrder": [
  26446. // "profileId",
  26447. // "objectId",
  26448. // "name",
  26449. // "objectType"
  26450. // ],
  26451. // "parameters": {
  26452. // "name": {
  26453. // "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.",
  26454. // "location": "query",
  26455. // "required": true,
  26456. // "type": "string"
  26457. // },
  26458. // "objectId": {
  26459. // "description": "ID of the object of this dynamic targeting key. This is a required field.",
  26460. // "format": "int64",
  26461. // "location": "path",
  26462. // "required": true,
  26463. // "type": "string"
  26464. // },
  26465. // "objectType": {
  26466. // "description": "Type of the object of this dynamic targeting key. This is a required field.",
  26467. // "enum": [
  26468. // "OBJECT_AD",
  26469. // "OBJECT_ADVERTISER",
  26470. // "OBJECT_CREATIVE",
  26471. // "OBJECT_PLACEMENT"
  26472. // ],
  26473. // "enumDescriptions": [
  26474. // "",
  26475. // "",
  26476. // "",
  26477. // ""
  26478. // ],
  26479. // "location": "query",
  26480. // "required": true,
  26481. // "type": "string"
  26482. // },
  26483. // "profileId": {
  26484. // "description": "User profile ID associated with this request.",
  26485. // "format": "int64",
  26486. // "location": "path",
  26487. // "required": true,
  26488. // "type": "string"
  26489. // }
  26490. // },
  26491. // "path": "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}",
  26492. // "scopes": [
  26493. // "https://www.googleapis.com/auth/dfatrafficking"
  26494. // ]
  26495. // }
  26496. }
  26497. // method id "dfareporting.dynamicTargetingKeys.insert":
  26498. type DynamicTargetingKeysInsertCall struct {
  26499. s *Service
  26500. profileId int64
  26501. dynamictargetingkey *DynamicTargetingKey
  26502. urlParams_ gensupport.URLParams
  26503. ctx_ context.Context
  26504. header_ http.Header
  26505. }
  26506. // Insert: Inserts a new dynamic targeting key. Keys must be created at
  26507. // the advertiser level before being assigned to the advertiser's ads,
  26508. // creatives, or placements. There is a maximum of 1000 keys per
  26509. // advertiser, out of which a maximum of 20 keys can be assigned per ad,
  26510. // creative, or placement.
  26511. func (r *DynamicTargetingKeysService) Insert(profileId int64, dynamictargetingkey *DynamicTargetingKey) *DynamicTargetingKeysInsertCall {
  26512. c := &DynamicTargetingKeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26513. c.profileId = profileId
  26514. c.dynamictargetingkey = dynamictargetingkey
  26515. return c
  26516. }
  26517. // Fields allows partial responses to be retrieved. See
  26518. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26519. // for more information.
  26520. func (c *DynamicTargetingKeysInsertCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysInsertCall {
  26521. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26522. return c
  26523. }
  26524. // Context sets the context to be used in this call's Do method. Any
  26525. // pending HTTP request will be aborted if the provided context is
  26526. // canceled.
  26527. func (c *DynamicTargetingKeysInsertCall) Context(ctx context.Context) *DynamicTargetingKeysInsertCall {
  26528. c.ctx_ = ctx
  26529. return c
  26530. }
  26531. // Header returns an http.Header that can be modified by the caller to
  26532. // add HTTP headers to the request.
  26533. func (c *DynamicTargetingKeysInsertCall) Header() http.Header {
  26534. if c.header_ == nil {
  26535. c.header_ = make(http.Header)
  26536. }
  26537. return c.header_
  26538. }
  26539. func (c *DynamicTargetingKeysInsertCall) doRequest(alt string) (*http.Response, error) {
  26540. reqHeaders := make(http.Header)
  26541. for k, v := range c.header_ {
  26542. reqHeaders[k] = v
  26543. }
  26544. reqHeaders.Set("User-Agent", c.s.userAgent())
  26545. var body io.Reader = nil
  26546. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dynamictargetingkey)
  26547. if err != nil {
  26548. return nil, err
  26549. }
  26550. reqHeaders.Set("Content-Type", "application/json")
  26551. c.urlParams_.Set("alt", alt)
  26552. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  26553. urls += "?" + c.urlParams_.Encode()
  26554. req, _ := http.NewRequest("POST", urls, body)
  26555. req.Header = reqHeaders
  26556. googleapi.Expand(req.URL, map[string]string{
  26557. "profileId": strconv.FormatInt(c.profileId, 10),
  26558. })
  26559. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26560. }
  26561. // Do executes the "dfareporting.dynamicTargetingKeys.insert" call.
  26562. // Exactly one of *DynamicTargetingKey or error will be non-nil. Any
  26563. // non-2xx status code is an error. Response headers are in either
  26564. // *DynamicTargetingKey.ServerResponse.Header or (if a response was
  26565. // returned at all) in error.(*googleapi.Error).Header. Use
  26566. // googleapi.IsNotModified to check whether the returned error was
  26567. // because http.StatusNotModified was returned.
  26568. func (c *DynamicTargetingKeysInsertCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKey, error) {
  26569. gensupport.SetOptions(c.urlParams_, opts...)
  26570. res, err := c.doRequest("json")
  26571. if res != nil && res.StatusCode == http.StatusNotModified {
  26572. if res.Body != nil {
  26573. res.Body.Close()
  26574. }
  26575. return nil, &googleapi.Error{
  26576. Code: res.StatusCode,
  26577. Header: res.Header,
  26578. }
  26579. }
  26580. if err != nil {
  26581. return nil, err
  26582. }
  26583. defer googleapi.CloseBody(res)
  26584. if err := googleapi.CheckResponse(res); err != nil {
  26585. return nil, err
  26586. }
  26587. ret := &DynamicTargetingKey{
  26588. ServerResponse: googleapi.ServerResponse{
  26589. Header: res.Header,
  26590. HTTPStatusCode: res.StatusCode,
  26591. },
  26592. }
  26593. target := &ret
  26594. if err := gensupport.DecodeResponse(target, res); err != nil {
  26595. return nil, err
  26596. }
  26597. return ret, nil
  26598. // {
  26599. // "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.",
  26600. // "httpMethod": "POST",
  26601. // "id": "dfareporting.dynamicTargetingKeys.insert",
  26602. // "parameterOrder": [
  26603. // "profileId"
  26604. // ],
  26605. // "parameters": {
  26606. // "profileId": {
  26607. // "description": "User profile ID associated with this request.",
  26608. // "format": "int64",
  26609. // "location": "path",
  26610. // "required": true,
  26611. // "type": "string"
  26612. // }
  26613. // },
  26614. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  26615. // "request": {
  26616. // "$ref": "DynamicTargetingKey"
  26617. // },
  26618. // "response": {
  26619. // "$ref": "DynamicTargetingKey"
  26620. // },
  26621. // "scopes": [
  26622. // "https://www.googleapis.com/auth/dfatrafficking"
  26623. // ]
  26624. // }
  26625. }
  26626. // method id "dfareporting.dynamicTargetingKeys.list":
  26627. type DynamicTargetingKeysListCall struct {
  26628. s *Service
  26629. profileId int64
  26630. urlParams_ gensupport.URLParams
  26631. ifNoneMatch_ string
  26632. ctx_ context.Context
  26633. header_ http.Header
  26634. }
  26635. // List: Retrieves a list of dynamic targeting keys.
  26636. func (r *DynamicTargetingKeysService) List(profileId int64) *DynamicTargetingKeysListCall {
  26637. c := &DynamicTargetingKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26638. c.profileId = profileId
  26639. return c
  26640. }
  26641. // AdvertiserId sets the optional parameter "advertiserId": Select only
  26642. // dynamic targeting keys whose object has this advertiser ID.
  26643. func (c *DynamicTargetingKeysListCall) AdvertiserId(advertiserId int64) *DynamicTargetingKeysListCall {
  26644. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  26645. return c
  26646. }
  26647. // Names sets the optional parameter "names": Select only dynamic
  26648. // targeting keys exactly matching these names.
  26649. func (c *DynamicTargetingKeysListCall) Names(names ...string) *DynamicTargetingKeysListCall {
  26650. c.urlParams_.SetMulti("names", append([]string{}, names...))
  26651. return c
  26652. }
  26653. // ObjectId sets the optional parameter "objectId": Select only dynamic
  26654. // targeting keys with this object ID.
  26655. func (c *DynamicTargetingKeysListCall) ObjectId(objectId int64) *DynamicTargetingKeysListCall {
  26656. c.urlParams_.Set("objectId", fmt.Sprint(objectId))
  26657. return c
  26658. }
  26659. // ObjectType sets the optional parameter "objectType": Select only
  26660. // dynamic targeting keys with this object type.
  26661. //
  26662. // Possible values:
  26663. // "OBJECT_AD"
  26664. // "OBJECT_ADVERTISER"
  26665. // "OBJECT_CREATIVE"
  26666. // "OBJECT_PLACEMENT"
  26667. func (c *DynamicTargetingKeysListCall) ObjectType(objectType string) *DynamicTargetingKeysListCall {
  26668. c.urlParams_.Set("objectType", objectType)
  26669. return c
  26670. }
  26671. // Fields allows partial responses to be retrieved. See
  26672. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26673. // for more information.
  26674. func (c *DynamicTargetingKeysListCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysListCall {
  26675. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26676. return c
  26677. }
  26678. // IfNoneMatch sets the optional parameter which makes the operation
  26679. // fail if the object's ETag matches the given value. This is useful for
  26680. // getting updates only after the object has changed since the last
  26681. // request. Use googleapi.IsNotModified to check whether the response
  26682. // error from Do is the result of In-None-Match.
  26683. func (c *DynamicTargetingKeysListCall) IfNoneMatch(entityTag string) *DynamicTargetingKeysListCall {
  26684. c.ifNoneMatch_ = entityTag
  26685. return c
  26686. }
  26687. // Context sets the context to be used in this call's Do method. Any
  26688. // pending HTTP request will be aborted if the provided context is
  26689. // canceled.
  26690. func (c *DynamicTargetingKeysListCall) Context(ctx context.Context) *DynamicTargetingKeysListCall {
  26691. c.ctx_ = ctx
  26692. return c
  26693. }
  26694. // Header returns an http.Header that can be modified by the caller to
  26695. // add HTTP headers to the request.
  26696. func (c *DynamicTargetingKeysListCall) Header() http.Header {
  26697. if c.header_ == nil {
  26698. c.header_ = make(http.Header)
  26699. }
  26700. return c.header_
  26701. }
  26702. func (c *DynamicTargetingKeysListCall) doRequest(alt string) (*http.Response, error) {
  26703. reqHeaders := make(http.Header)
  26704. for k, v := range c.header_ {
  26705. reqHeaders[k] = v
  26706. }
  26707. reqHeaders.Set("User-Agent", c.s.userAgent())
  26708. if c.ifNoneMatch_ != "" {
  26709. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26710. }
  26711. var body io.Reader = nil
  26712. c.urlParams_.Set("alt", alt)
  26713. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  26714. urls += "?" + c.urlParams_.Encode()
  26715. req, _ := http.NewRequest("GET", urls, body)
  26716. req.Header = reqHeaders
  26717. googleapi.Expand(req.URL, map[string]string{
  26718. "profileId": strconv.FormatInt(c.profileId, 10),
  26719. })
  26720. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26721. }
  26722. // Do executes the "dfareporting.dynamicTargetingKeys.list" call.
  26723. // Exactly one of *DynamicTargetingKeysListResponse or error will be
  26724. // non-nil. Any non-2xx status code is an error. Response headers are in
  26725. // either *DynamicTargetingKeysListResponse.ServerResponse.Header or (if
  26726. // a response was returned at all) in error.(*googleapi.Error).Header.
  26727. // Use googleapi.IsNotModified to check whether the returned error was
  26728. // because http.StatusNotModified was returned.
  26729. func (c *DynamicTargetingKeysListCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKeysListResponse, error) {
  26730. gensupport.SetOptions(c.urlParams_, opts...)
  26731. res, err := c.doRequest("json")
  26732. if res != nil && res.StatusCode == http.StatusNotModified {
  26733. if res.Body != nil {
  26734. res.Body.Close()
  26735. }
  26736. return nil, &googleapi.Error{
  26737. Code: res.StatusCode,
  26738. Header: res.Header,
  26739. }
  26740. }
  26741. if err != nil {
  26742. return nil, err
  26743. }
  26744. defer googleapi.CloseBody(res)
  26745. if err := googleapi.CheckResponse(res); err != nil {
  26746. return nil, err
  26747. }
  26748. ret := &DynamicTargetingKeysListResponse{
  26749. ServerResponse: googleapi.ServerResponse{
  26750. Header: res.Header,
  26751. HTTPStatusCode: res.StatusCode,
  26752. },
  26753. }
  26754. target := &ret
  26755. if err := gensupport.DecodeResponse(target, res); err != nil {
  26756. return nil, err
  26757. }
  26758. return ret, nil
  26759. // {
  26760. // "description": "Retrieves a list of dynamic targeting keys.",
  26761. // "httpMethod": "GET",
  26762. // "id": "dfareporting.dynamicTargetingKeys.list",
  26763. // "parameterOrder": [
  26764. // "profileId"
  26765. // ],
  26766. // "parameters": {
  26767. // "advertiserId": {
  26768. // "description": "Select only dynamic targeting keys whose object has this advertiser ID.",
  26769. // "format": "int64",
  26770. // "location": "query",
  26771. // "type": "string"
  26772. // },
  26773. // "names": {
  26774. // "description": "Select only dynamic targeting keys exactly matching these names.",
  26775. // "location": "query",
  26776. // "repeated": true,
  26777. // "type": "string"
  26778. // },
  26779. // "objectId": {
  26780. // "description": "Select only dynamic targeting keys with this object ID.",
  26781. // "format": "int64",
  26782. // "location": "query",
  26783. // "type": "string"
  26784. // },
  26785. // "objectType": {
  26786. // "description": "Select only dynamic targeting keys with this object type.",
  26787. // "enum": [
  26788. // "OBJECT_AD",
  26789. // "OBJECT_ADVERTISER",
  26790. // "OBJECT_CREATIVE",
  26791. // "OBJECT_PLACEMENT"
  26792. // ],
  26793. // "enumDescriptions": [
  26794. // "",
  26795. // "",
  26796. // "",
  26797. // ""
  26798. // ],
  26799. // "location": "query",
  26800. // "type": "string"
  26801. // },
  26802. // "profileId": {
  26803. // "description": "User profile ID associated with this request.",
  26804. // "format": "int64",
  26805. // "location": "path",
  26806. // "required": true,
  26807. // "type": "string"
  26808. // }
  26809. // },
  26810. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  26811. // "response": {
  26812. // "$ref": "DynamicTargetingKeysListResponse"
  26813. // },
  26814. // "scopes": [
  26815. // "https://www.googleapis.com/auth/dfatrafficking"
  26816. // ]
  26817. // }
  26818. }
  26819. // method id "dfareporting.eventTags.delete":
  26820. type EventTagsDeleteCall struct {
  26821. s *Service
  26822. profileId int64
  26823. id int64
  26824. urlParams_ gensupport.URLParams
  26825. ctx_ context.Context
  26826. header_ http.Header
  26827. }
  26828. // Delete: Deletes an existing event tag.
  26829. func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall {
  26830. c := &EventTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26831. c.profileId = profileId
  26832. c.id = id
  26833. return c
  26834. }
  26835. // Fields allows partial responses to be retrieved. See
  26836. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26837. // for more information.
  26838. func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall {
  26839. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26840. return c
  26841. }
  26842. // Context sets the context to be used in this call's Do method. Any
  26843. // pending HTTP request will be aborted if the provided context is
  26844. // canceled.
  26845. func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall {
  26846. c.ctx_ = ctx
  26847. return c
  26848. }
  26849. // Header returns an http.Header that can be modified by the caller to
  26850. // add HTTP headers to the request.
  26851. func (c *EventTagsDeleteCall) Header() http.Header {
  26852. if c.header_ == nil {
  26853. c.header_ = make(http.Header)
  26854. }
  26855. return c.header_
  26856. }
  26857. func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  26858. reqHeaders := make(http.Header)
  26859. for k, v := range c.header_ {
  26860. reqHeaders[k] = v
  26861. }
  26862. reqHeaders.Set("User-Agent", c.s.userAgent())
  26863. var body io.Reader = nil
  26864. c.urlParams_.Set("alt", alt)
  26865. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  26866. urls += "?" + c.urlParams_.Encode()
  26867. req, _ := http.NewRequest("DELETE", urls, body)
  26868. req.Header = reqHeaders
  26869. googleapi.Expand(req.URL, map[string]string{
  26870. "profileId": strconv.FormatInt(c.profileId, 10),
  26871. "id": strconv.FormatInt(c.id, 10),
  26872. })
  26873. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26874. }
  26875. // Do executes the "dfareporting.eventTags.delete" call.
  26876. func (c *EventTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  26877. gensupport.SetOptions(c.urlParams_, opts...)
  26878. res, err := c.doRequest("json")
  26879. if err != nil {
  26880. return err
  26881. }
  26882. defer googleapi.CloseBody(res)
  26883. if err := googleapi.CheckResponse(res); err != nil {
  26884. return err
  26885. }
  26886. return nil
  26887. // {
  26888. // "description": "Deletes an existing event tag.",
  26889. // "httpMethod": "DELETE",
  26890. // "id": "dfareporting.eventTags.delete",
  26891. // "parameterOrder": [
  26892. // "profileId",
  26893. // "id"
  26894. // ],
  26895. // "parameters": {
  26896. // "id": {
  26897. // "description": "Event tag ID.",
  26898. // "format": "int64",
  26899. // "location": "path",
  26900. // "required": true,
  26901. // "type": "string"
  26902. // },
  26903. // "profileId": {
  26904. // "description": "User profile ID associated with this request.",
  26905. // "format": "int64",
  26906. // "location": "path",
  26907. // "required": true,
  26908. // "type": "string"
  26909. // }
  26910. // },
  26911. // "path": "userprofiles/{profileId}/eventTags/{id}",
  26912. // "scopes": [
  26913. // "https://www.googleapis.com/auth/dfatrafficking"
  26914. // ]
  26915. // }
  26916. }
  26917. // method id "dfareporting.eventTags.get":
  26918. type EventTagsGetCall struct {
  26919. s *Service
  26920. profileId int64
  26921. id int64
  26922. urlParams_ gensupport.URLParams
  26923. ifNoneMatch_ string
  26924. ctx_ context.Context
  26925. header_ http.Header
  26926. }
  26927. // Get: Gets one event tag by ID.
  26928. func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall {
  26929. c := &EventTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26930. c.profileId = profileId
  26931. c.id = id
  26932. return c
  26933. }
  26934. // Fields allows partial responses to be retrieved. See
  26935. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26936. // for more information.
  26937. func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall {
  26938. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26939. return c
  26940. }
  26941. // IfNoneMatch sets the optional parameter which makes the operation
  26942. // fail if the object's ETag matches the given value. This is useful for
  26943. // getting updates only after the object has changed since the last
  26944. // request. Use googleapi.IsNotModified to check whether the response
  26945. // error from Do is the result of In-None-Match.
  26946. func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall {
  26947. c.ifNoneMatch_ = entityTag
  26948. return c
  26949. }
  26950. // Context sets the context to be used in this call's Do method. Any
  26951. // pending HTTP request will be aborted if the provided context is
  26952. // canceled.
  26953. func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall {
  26954. c.ctx_ = ctx
  26955. return c
  26956. }
  26957. // Header returns an http.Header that can be modified by the caller to
  26958. // add HTTP headers to the request.
  26959. func (c *EventTagsGetCall) Header() http.Header {
  26960. if c.header_ == nil {
  26961. c.header_ = make(http.Header)
  26962. }
  26963. return c.header_
  26964. }
  26965. func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) {
  26966. reqHeaders := make(http.Header)
  26967. for k, v := range c.header_ {
  26968. reqHeaders[k] = v
  26969. }
  26970. reqHeaders.Set("User-Agent", c.s.userAgent())
  26971. if c.ifNoneMatch_ != "" {
  26972. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26973. }
  26974. var body io.Reader = nil
  26975. c.urlParams_.Set("alt", alt)
  26976. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  26977. urls += "?" + c.urlParams_.Encode()
  26978. req, _ := http.NewRequest("GET", urls, body)
  26979. req.Header = reqHeaders
  26980. googleapi.Expand(req.URL, map[string]string{
  26981. "profileId": strconv.FormatInt(c.profileId, 10),
  26982. "id": strconv.FormatInt(c.id, 10),
  26983. })
  26984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26985. }
  26986. // Do executes the "dfareporting.eventTags.get" call.
  26987. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  26988. // code is an error. Response headers are in either
  26989. // *EventTag.ServerResponse.Header or (if a response was returned at
  26990. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26991. // to check whether the returned error was because
  26992. // http.StatusNotModified was returned.
  26993. func (c *EventTagsGetCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  26994. gensupport.SetOptions(c.urlParams_, opts...)
  26995. res, err := c.doRequest("json")
  26996. if res != nil && res.StatusCode == http.StatusNotModified {
  26997. if res.Body != nil {
  26998. res.Body.Close()
  26999. }
  27000. return nil, &googleapi.Error{
  27001. Code: res.StatusCode,
  27002. Header: res.Header,
  27003. }
  27004. }
  27005. if err != nil {
  27006. return nil, err
  27007. }
  27008. defer googleapi.CloseBody(res)
  27009. if err := googleapi.CheckResponse(res); err != nil {
  27010. return nil, err
  27011. }
  27012. ret := &EventTag{
  27013. ServerResponse: googleapi.ServerResponse{
  27014. Header: res.Header,
  27015. HTTPStatusCode: res.StatusCode,
  27016. },
  27017. }
  27018. target := &ret
  27019. if err := gensupport.DecodeResponse(target, res); err != nil {
  27020. return nil, err
  27021. }
  27022. return ret, nil
  27023. // {
  27024. // "description": "Gets one event tag by ID.",
  27025. // "httpMethod": "GET",
  27026. // "id": "dfareporting.eventTags.get",
  27027. // "parameterOrder": [
  27028. // "profileId",
  27029. // "id"
  27030. // ],
  27031. // "parameters": {
  27032. // "id": {
  27033. // "description": "Event tag ID.",
  27034. // "format": "int64",
  27035. // "location": "path",
  27036. // "required": true,
  27037. // "type": "string"
  27038. // },
  27039. // "profileId": {
  27040. // "description": "User profile ID associated with this request.",
  27041. // "format": "int64",
  27042. // "location": "path",
  27043. // "required": true,
  27044. // "type": "string"
  27045. // }
  27046. // },
  27047. // "path": "userprofiles/{profileId}/eventTags/{id}",
  27048. // "response": {
  27049. // "$ref": "EventTag"
  27050. // },
  27051. // "scopes": [
  27052. // "https://www.googleapis.com/auth/dfatrafficking"
  27053. // ]
  27054. // }
  27055. }
  27056. // method id "dfareporting.eventTags.insert":
  27057. type EventTagsInsertCall struct {
  27058. s *Service
  27059. profileId int64
  27060. eventtag *EventTag
  27061. urlParams_ gensupport.URLParams
  27062. ctx_ context.Context
  27063. header_ http.Header
  27064. }
  27065. // Insert: Inserts a new event tag.
  27066. func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall {
  27067. c := &EventTagsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27068. c.profileId = profileId
  27069. c.eventtag = eventtag
  27070. return c
  27071. }
  27072. // Fields allows partial responses to be retrieved. See
  27073. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27074. // for more information.
  27075. func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall {
  27076. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27077. return c
  27078. }
  27079. // Context sets the context to be used in this call's Do method. Any
  27080. // pending HTTP request will be aborted if the provided context is
  27081. // canceled.
  27082. func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall {
  27083. c.ctx_ = ctx
  27084. return c
  27085. }
  27086. // Header returns an http.Header that can be modified by the caller to
  27087. // add HTTP headers to the request.
  27088. func (c *EventTagsInsertCall) Header() http.Header {
  27089. if c.header_ == nil {
  27090. c.header_ = make(http.Header)
  27091. }
  27092. return c.header_
  27093. }
  27094. func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) {
  27095. reqHeaders := make(http.Header)
  27096. for k, v := range c.header_ {
  27097. reqHeaders[k] = v
  27098. }
  27099. reqHeaders.Set("User-Agent", c.s.userAgent())
  27100. var body io.Reader = nil
  27101. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27102. if err != nil {
  27103. return nil, err
  27104. }
  27105. reqHeaders.Set("Content-Type", "application/json")
  27106. c.urlParams_.Set("alt", alt)
  27107. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27108. urls += "?" + c.urlParams_.Encode()
  27109. req, _ := http.NewRequest("POST", urls, body)
  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.eventTags.insert" call.
  27117. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27118. // code is an error. Response headers are in either
  27119. // *EventTag.ServerResponse.Header or (if a response was returned at
  27120. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27121. // to check whether the returned error was because
  27122. // http.StatusNotModified was returned.
  27123. func (c *EventTagsInsertCall) Do(opts ...googleapi.CallOption) (*EventTag, 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 := &EventTag{
  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 event tag.",
  27155. // "httpMethod": "POST",
  27156. // "id": "dfareporting.eventTags.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}/eventTags",
  27170. // "request": {
  27171. // "$ref": "EventTag"
  27172. // },
  27173. // "response": {
  27174. // "$ref": "EventTag"
  27175. // },
  27176. // "scopes": [
  27177. // "https://www.googleapis.com/auth/dfatrafficking"
  27178. // ]
  27179. // }
  27180. }
  27181. // method id "dfareporting.eventTags.list":
  27182. type EventTagsListCall 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 event tags, possibly filtered.
  27191. func (r *EventTagsService) List(profileId int64) *EventTagsListCall {
  27192. c := &EventTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27193. c.profileId = profileId
  27194. return c
  27195. }
  27196. // AdId sets the optional parameter "adId": Select only event tags that
  27197. // belong to this ad.
  27198. func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall {
  27199. c.urlParams_.Set("adId", fmt.Sprint(adId))
  27200. return c
  27201. }
  27202. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27203. // event tags that belong to this advertiser.
  27204. func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall {
  27205. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27206. return c
  27207. }
  27208. // CampaignId sets the optional parameter "campaignId": Select only
  27209. // event tags that belong to this campaign.
  27210. func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall {
  27211. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  27212. return c
  27213. }
  27214. // DefinitionsOnly sets the optional parameter "definitionsOnly":
  27215. // Examine only the specified campaign or advertiser's event tags for
  27216. // matching selector criteria. When set to false, the parent advertiser
  27217. // and parent campaign of the specified ad or campaign is examined as
  27218. // well. In addition, when set to false, the status field is examined as
  27219. // well, along with the enabledByDefault field. This parameter can not
  27220. // be set to true when adId is specified as ads do not define their own
  27221. // even tags.
  27222. func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall {
  27223. c.urlParams_.Set("definitionsOnly", fmt.Sprint(definitionsOnly))
  27224. return c
  27225. }
  27226. // Enabled sets the optional parameter "enabled": Select only enabled
  27227. // event tags. What is considered enabled or disabled depends on the
  27228. // definitionsOnly parameter. When definitionsOnly is set to true, only
  27229. // the specified advertiser or campaign's event tags' enabledByDefault
  27230. // field is examined. When definitionsOnly is set to false, the
  27231. // specified ad or specified campaign's parent advertiser's or parent
  27232. // campaign's event tags' enabledByDefault and status fields are
  27233. // examined as well.
  27234. func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall {
  27235. c.urlParams_.Set("enabled", fmt.Sprint(enabled))
  27236. return c
  27237. }
  27238. // EventTagTypes sets the optional parameter "eventTagTypes": Select
  27239. // only event tags with the specified event tag types. Event tag types
  27240. // can be used to specify whether to use a third-party pixel, a
  27241. // third-party JavaScript URL, or a third-party click-through URL for
  27242. // either impression or click tracking.
  27243. //
  27244. // Possible values:
  27245. // "CLICK_THROUGH_EVENT_TAG"
  27246. // "IMPRESSION_IMAGE_EVENT_TAG"
  27247. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27248. func (c *EventTagsListCall) EventTagTypes(eventTagTypes ...string) *EventTagsListCall {
  27249. c.urlParams_.SetMulti("eventTagTypes", append([]string{}, eventTagTypes...))
  27250. return c
  27251. }
  27252. // Ids sets the optional parameter "ids": Select only event tags with
  27253. // these IDs.
  27254. func (c *EventTagsListCall) Ids(ids ...int64) *EventTagsListCall {
  27255. var ids_ []string
  27256. for _, v := range ids {
  27257. ids_ = append(ids_, fmt.Sprint(v))
  27258. }
  27259. c.urlParams_.SetMulti("ids", ids_)
  27260. return c
  27261. }
  27262. // SearchString sets the optional parameter "searchString": Allows
  27263. // searching for objects by name or ID. Wildcards (*) are allowed. For
  27264. // example, "eventtag*2015" will return objects with names like
  27265. // "eventtag June 2015", "eventtag April 2015", or simply "eventtag
  27266. // 2015". Most of the searches also add wildcards implicitly at the
  27267. // start and the end of the search string. For example, a search string
  27268. // of "eventtag" will match objects with name "my eventtag", "eventtag
  27269. // 2015", or simply "eventtag".
  27270. func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall {
  27271. c.urlParams_.Set("searchString", searchString)
  27272. return c
  27273. }
  27274. // SortField sets the optional parameter "sortField": Field by which to
  27275. // sort the list.
  27276. //
  27277. // Possible values:
  27278. // "ID" (default)
  27279. // "NAME"
  27280. func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall {
  27281. c.urlParams_.Set("sortField", sortField)
  27282. return c
  27283. }
  27284. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  27285. // results.
  27286. //
  27287. // Possible values:
  27288. // "ASCENDING" (default)
  27289. // "DESCENDING"
  27290. func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall {
  27291. c.urlParams_.Set("sortOrder", sortOrder)
  27292. return c
  27293. }
  27294. // Fields allows partial responses to be retrieved. See
  27295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27296. // for more information.
  27297. func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall {
  27298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27299. return c
  27300. }
  27301. // IfNoneMatch sets the optional parameter which makes the operation
  27302. // fail if the object's ETag matches the given value. This is useful for
  27303. // getting updates only after the object has changed since the last
  27304. // request. Use googleapi.IsNotModified to check whether the response
  27305. // error from Do is the result of In-None-Match.
  27306. func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall {
  27307. c.ifNoneMatch_ = entityTag
  27308. return c
  27309. }
  27310. // Context sets the context to be used in this call's Do method. Any
  27311. // pending HTTP request will be aborted if the provided context is
  27312. // canceled.
  27313. func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall {
  27314. c.ctx_ = ctx
  27315. return c
  27316. }
  27317. // Header returns an http.Header that can be modified by the caller to
  27318. // add HTTP headers to the request.
  27319. func (c *EventTagsListCall) Header() http.Header {
  27320. if c.header_ == nil {
  27321. c.header_ = make(http.Header)
  27322. }
  27323. return c.header_
  27324. }
  27325. func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) {
  27326. reqHeaders := make(http.Header)
  27327. for k, v := range c.header_ {
  27328. reqHeaders[k] = v
  27329. }
  27330. reqHeaders.Set("User-Agent", c.s.userAgent())
  27331. if c.ifNoneMatch_ != "" {
  27332. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27333. }
  27334. var body io.Reader = nil
  27335. c.urlParams_.Set("alt", alt)
  27336. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27337. urls += "?" + c.urlParams_.Encode()
  27338. req, _ := http.NewRequest("GET", urls, body)
  27339. req.Header = reqHeaders
  27340. googleapi.Expand(req.URL, map[string]string{
  27341. "profileId": strconv.FormatInt(c.profileId, 10),
  27342. })
  27343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27344. }
  27345. // Do executes the "dfareporting.eventTags.list" call.
  27346. // Exactly one of *EventTagsListResponse or error will be non-nil. Any
  27347. // non-2xx status code is an error. Response headers are in either
  27348. // *EventTagsListResponse.ServerResponse.Header or (if a response was
  27349. // returned at all) in error.(*googleapi.Error).Header. Use
  27350. // googleapi.IsNotModified to check whether the returned error was
  27351. // because http.StatusNotModified was returned.
  27352. func (c *EventTagsListCall) Do(opts ...googleapi.CallOption) (*EventTagsListResponse, error) {
  27353. gensupport.SetOptions(c.urlParams_, opts...)
  27354. res, err := c.doRequest("json")
  27355. if res != nil && res.StatusCode == http.StatusNotModified {
  27356. if res.Body != nil {
  27357. res.Body.Close()
  27358. }
  27359. return nil, &googleapi.Error{
  27360. Code: res.StatusCode,
  27361. Header: res.Header,
  27362. }
  27363. }
  27364. if err != nil {
  27365. return nil, err
  27366. }
  27367. defer googleapi.CloseBody(res)
  27368. if err := googleapi.CheckResponse(res); err != nil {
  27369. return nil, err
  27370. }
  27371. ret := &EventTagsListResponse{
  27372. ServerResponse: googleapi.ServerResponse{
  27373. Header: res.Header,
  27374. HTTPStatusCode: res.StatusCode,
  27375. },
  27376. }
  27377. target := &ret
  27378. if err := gensupport.DecodeResponse(target, res); err != nil {
  27379. return nil, err
  27380. }
  27381. return ret, nil
  27382. // {
  27383. // "description": "Retrieves a list of event tags, possibly filtered.",
  27384. // "httpMethod": "GET",
  27385. // "id": "dfareporting.eventTags.list",
  27386. // "parameterOrder": [
  27387. // "profileId"
  27388. // ],
  27389. // "parameters": {
  27390. // "adId": {
  27391. // "description": "Select only event tags that belong to this ad.",
  27392. // "format": "int64",
  27393. // "location": "query",
  27394. // "type": "string"
  27395. // },
  27396. // "advertiserId": {
  27397. // "description": "Select only event tags that belong to this advertiser.",
  27398. // "format": "int64",
  27399. // "location": "query",
  27400. // "type": "string"
  27401. // },
  27402. // "campaignId": {
  27403. // "description": "Select only event tags that belong to this campaign.",
  27404. // "format": "int64",
  27405. // "location": "query",
  27406. // "type": "string"
  27407. // },
  27408. // "definitionsOnly": {
  27409. // "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.",
  27410. // "location": "query",
  27411. // "type": "boolean"
  27412. // },
  27413. // "enabled": {
  27414. // "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.",
  27415. // "location": "query",
  27416. // "type": "boolean"
  27417. // },
  27418. // "eventTagTypes": {
  27419. // "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.",
  27420. // "enum": [
  27421. // "CLICK_THROUGH_EVENT_TAG",
  27422. // "IMPRESSION_IMAGE_EVENT_TAG",
  27423. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  27424. // ],
  27425. // "enumDescriptions": [
  27426. // "",
  27427. // "",
  27428. // ""
  27429. // ],
  27430. // "location": "query",
  27431. // "repeated": true,
  27432. // "type": "string"
  27433. // },
  27434. // "ids": {
  27435. // "description": "Select only event tags with these IDs.",
  27436. // "format": "int64",
  27437. // "location": "query",
  27438. // "repeated": true,
  27439. // "type": "string"
  27440. // },
  27441. // "profileId": {
  27442. // "description": "User profile ID associated with this request.",
  27443. // "format": "int64",
  27444. // "location": "path",
  27445. // "required": true,
  27446. // "type": "string"
  27447. // },
  27448. // "searchString": {
  27449. // "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\".",
  27450. // "location": "query",
  27451. // "type": "string"
  27452. // },
  27453. // "sortField": {
  27454. // "default": "ID",
  27455. // "description": "Field by which to sort the list.",
  27456. // "enum": [
  27457. // "ID",
  27458. // "NAME"
  27459. // ],
  27460. // "enumDescriptions": [
  27461. // "",
  27462. // ""
  27463. // ],
  27464. // "location": "query",
  27465. // "type": "string"
  27466. // },
  27467. // "sortOrder": {
  27468. // "default": "ASCENDING",
  27469. // "description": "Order of sorted results.",
  27470. // "enum": [
  27471. // "ASCENDING",
  27472. // "DESCENDING"
  27473. // ],
  27474. // "enumDescriptions": [
  27475. // "",
  27476. // ""
  27477. // ],
  27478. // "location": "query",
  27479. // "type": "string"
  27480. // }
  27481. // },
  27482. // "path": "userprofiles/{profileId}/eventTags",
  27483. // "response": {
  27484. // "$ref": "EventTagsListResponse"
  27485. // },
  27486. // "scopes": [
  27487. // "https://www.googleapis.com/auth/dfatrafficking"
  27488. // ]
  27489. // }
  27490. }
  27491. // method id "dfareporting.eventTags.patch":
  27492. type EventTagsPatchCall struct {
  27493. s *Service
  27494. profileId int64
  27495. eventtag *EventTag
  27496. urlParams_ gensupport.URLParams
  27497. ctx_ context.Context
  27498. header_ http.Header
  27499. }
  27500. // Patch: Updates an existing event tag. This method supports patch
  27501. // semantics.
  27502. func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall {
  27503. c := &EventTagsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27504. c.profileId = profileId
  27505. c.urlParams_.Set("id", fmt.Sprint(id))
  27506. c.eventtag = eventtag
  27507. return c
  27508. }
  27509. // Fields allows partial responses to be retrieved. See
  27510. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27511. // for more information.
  27512. func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall {
  27513. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27514. return c
  27515. }
  27516. // Context sets the context to be used in this call's Do method. Any
  27517. // pending HTTP request will be aborted if the provided context is
  27518. // canceled.
  27519. func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall {
  27520. c.ctx_ = ctx
  27521. return c
  27522. }
  27523. // Header returns an http.Header that can be modified by the caller to
  27524. // add HTTP headers to the request.
  27525. func (c *EventTagsPatchCall) Header() http.Header {
  27526. if c.header_ == nil {
  27527. c.header_ = make(http.Header)
  27528. }
  27529. return c.header_
  27530. }
  27531. func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) {
  27532. reqHeaders := make(http.Header)
  27533. for k, v := range c.header_ {
  27534. reqHeaders[k] = v
  27535. }
  27536. reqHeaders.Set("User-Agent", c.s.userAgent())
  27537. var body io.Reader = nil
  27538. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27539. if err != nil {
  27540. return nil, err
  27541. }
  27542. reqHeaders.Set("Content-Type", "application/json")
  27543. c.urlParams_.Set("alt", alt)
  27544. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27545. urls += "?" + c.urlParams_.Encode()
  27546. req, _ := http.NewRequest("PATCH", urls, body)
  27547. req.Header = reqHeaders
  27548. googleapi.Expand(req.URL, map[string]string{
  27549. "profileId": strconv.FormatInt(c.profileId, 10),
  27550. })
  27551. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27552. }
  27553. // Do executes the "dfareporting.eventTags.patch" 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 *EventTagsPatchCall) 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": "Updates an existing event tag. This method supports patch semantics.",
  27592. // "httpMethod": "PATCH",
  27593. // "id": "dfareporting.eventTags.patch",
  27594. // "parameterOrder": [
  27595. // "profileId",
  27596. // "id"
  27597. // ],
  27598. // "parameters": {
  27599. // "id": {
  27600. // "description": "Event tag ID.",
  27601. // "format": "int64",
  27602. // "location": "query",
  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",
  27615. // "request": {
  27616. // "$ref": "EventTag"
  27617. // },
  27618. // "response": {
  27619. // "$ref": "EventTag"
  27620. // },
  27621. // "scopes": [
  27622. // "https://www.googleapis.com/auth/dfatrafficking"
  27623. // ]
  27624. // }
  27625. }
  27626. // method id "dfareporting.eventTags.update":
  27627. type EventTagsUpdateCall struct {
  27628. s *Service
  27629. profileId int64
  27630. eventtag *EventTag
  27631. urlParams_ gensupport.URLParams
  27632. ctx_ context.Context
  27633. header_ http.Header
  27634. }
  27635. // Update: Updates an existing event tag.
  27636. func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall {
  27637. c := &EventTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27638. c.profileId = profileId
  27639. c.eventtag = eventtag
  27640. return c
  27641. }
  27642. // Fields allows partial responses to be retrieved. See
  27643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27644. // for more information.
  27645. func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall {
  27646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27647. return c
  27648. }
  27649. // Context sets the context to be used in this call's Do method. Any
  27650. // pending HTTP request will be aborted if the provided context is
  27651. // canceled.
  27652. func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall {
  27653. c.ctx_ = ctx
  27654. return c
  27655. }
  27656. // Header returns an http.Header that can be modified by the caller to
  27657. // add HTTP headers to the request.
  27658. func (c *EventTagsUpdateCall) Header() http.Header {
  27659. if c.header_ == nil {
  27660. c.header_ = make(http.Header)
  27661. }
  27662. return c.header_
  27663. }
  27664. func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  27665. reqHeaders := make(http.Header)
  27666. for k, v := range c.header_ {
  27667. reqHeaders[k] = v
  27668. }
  27669. reqHeaders.Set("User-Agent", c.s.userAgent())
  27670. var body io.Reader = nil
  27671. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  27672. if err != nil {
  27673. return nil, err
  27674. }
  27675. reqHeaders.Set("Content-Type", "application/json")
  27676. c.urlParams_.Set("alt", alt)
  27677. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  27678. urls += "?" + c.urlParams_.Encode()
  27679. req, _ := http.NewRequest("PUT", urls, body)
  27680. req.Header = reqHeaders
  27681. googleapi.Expand(req.URL, map[string]string{
  27682. "profileId": strconv.FormatInt(c.profileId, 10),
  27683. })
  27684. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27685. }
  27686. // Do executes the "dfareporting.eventTags.update" call.
  27687. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  27688. // code is an error. Response headers are in either
  27689. // *EventTag.ServerResponse.Header or (if a response was returned at
  27690. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  27691. // to check whether the returned error was because
  27692. // http.StatusNotModified was returned.
  27693. func (c *EventTagsUpdateCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  27694. gensupport.SetOptions(c.urlParams_, opts...)
  27695. res, err := c.doRequest("json")
  27696. if res != nil && res.StatusCode == http.StatusNotModified {
  27697. if res.Body != nil {
  27698. res.Body.Close()
  27699. }
  27700. return nil, &googleapi.Error{
  27701. Code: res.StatusCode,
  27702. Header: res.Header,
  27703. }
  27704. }
  27705. if err != nil {
  27706. return nil, err
  27707. }
  27708. defer googleapi.CloseBody(res)
  27709. if err := googleapi.CheckResponse(res); err != nil {
  27710. return nil, err
  27711. }
  27712. ret := &EventTag{
  27713. ServerResponse: googleapi.ServerResponse{
  27714. Header: res.Header,
  27715. HTTPStatusCode: res.StatusCode,
  27716. },
  27717. }
  27718. target := &ret
  27719. if err := gensupport.DecodeResponse(target, res); err != nil {
  27720. return nil, err
  27721. }
  27722. return ret, nil
  27723. // {
  27724. // "description": "Updates an existing event tag.",
  27725. // "httpMethod": "PUT",
  27726. // "id": "dfareporting.eventTags.update",
  27727. // "parameterOrder": [
  27728. // "profileId"
  27729. // ],
  27730. // "parameters": {
  27731. // "profileId": {
  27732. // "description": "User profile ID associated with this request.",
  27733. // "format": "int64",
  27734. // "location": "path",
  27735. // "required": true,
  27736. // "type": "string"
  27737. // }
  27738. // },
  27739. // "path": "userprofiles/{profileId}/eventTags",
  27740. // "request": {
  27741. // "$ref": "EventTag"
  27742. // },
  27743. // "response": {
  27744. // "$ref": "EventTag"
  27745. // },
  27746. // "scopes": [
  27747. // "https://www.googleapis.com/auth/dfatrafficking"
  27748. // ]
  27749. // }
  27750. }
  27751. // method id "dfareporting.files.get":
  27752. type FilesGetCall struct {
  27753. s *Service
  27754. reportId int64
  27755. fileId int64
  27756. urlParams_ gensupport.URLParams
  27757. ifNoneMatch_ string
  27758. ctx_ context.Context
  27759. header_ http.Header
  27760. }
  27761. // Get: Retrieves a report file by its report ID and file ID. This
  27762. // method supports media download.
  27763. func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall {
  27764. c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27765. c.reportId = reportId
  27766. c.fileId = fileId
  27767. return c
  27768. }
  27769. // Fields allows partial responses to be retrieved. See
  27770. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27771. // for more information.
  27772. func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
  27773. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27774. return c
  27775. }
  27776. // IfNoneMatch sets the optional parameter which makes the operation
  27777. // fail if the object's ETag matches the given value. This is useful for
  27778. // getting updates only after the object has changed since the last
  27779. // request. Use googleapi.IsNotModified to check whether the response
  27780. // error from Do is the result of In-None-Match.
  27781. func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
  27782. c.ifNoneMatch_ = entityTag
  27783. return c
  27784. }
  27785. // Context sets the context to be used in this call's Do and Download
  27786. // methods. Any pending HTTP request will be aborted if the provided
  27787. // context is canceled.
  27788. func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
  27789. c.ctx_ = ctx
  27790. return c
  27791. }
  27792. // Header returns an http.Header that can be modified by the caller to
  27793. // add HTTP headers to the request.
  27794. func (c *FilesGetCall) Header() http.Header {
  27795. if c.header_ == nil {
  27796. c.header_ = make(http.Header)
  27797. }
  27798. return c.header_
  27799. }
  27800. func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
  27801. reqHeaders := make(http.Header)
  27802. for k, v := range c.header_ {
  27803. reqHeaders[k] = v
  27804. }
  27805. reqHeaders.Set("User-Agent", c.s.userAgent())
  27806. if c.ifNoneMatch_ != "" {
  27807. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27808. }
  27809. var body io.Reader = nil
  27810. c.urlParams_.Set("alt", alt)
  27811. urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}")
  27812. urls += "?" + c.urlParams_.Encode()
  27813. req, _ := http.NewRequest("GET", urls, body)
  27814. req.Header = reqHeaders
  27815. googleapi.Expand(req.URL, map[string]string{
  27816. "reportId": strconv.FormatInt(c.reportId, 10),
  27817. "fileId": strconv.FormatInt(c.fileId, 10),
  27818. })
  27819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27820. }
  27821. // Download fetches the API endpoint's "media" value, instead of the normal
  27822. // API response value. If the returned error is nil, the Response is guaranteed to
  27823. // have a 2xx status code. Callers must close the Response.Body as usual.
  27824. func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  27825. gensupport.SetOptions(c.urlParams_, opts...)
  27826. res, err := c.doRequest("media")
  27827. if err != nil {
  27828. return nil, err
  27829. }
  27830. if err := googleapi.CheckMediaResponse(res); err != nil {
  27831. res.Body.Close()
  27832. return nil, err
  27833. }
  27834. return res, nil
  27835. }
  27836. // Do executes the "dfareporting.files.get" call.
  27837. // Exactly one of *File or error will be non-nil. Any non-2xx status
  27838. // code is an error. Response headers are in either
  27839. // *File.ServerResponse.Header or (if a response was returned at all) in
  27840. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  27841. // whether the returned error was because http.StatusNotModified was
  27842. // returned.
  27843. func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  27844. gensupport.SetOptions(c.urlParams_, opts...)
  27845. res, err := c.doRequest("json")
  27846. if res != nil && res.StatusCode == http.StatusNotModified {
  27847. if res.Body != nil {
  27848. res.Body.Close()
  27849. }
  27850. return nil, &googleapi.Error{
  27851. Code: res.StatusCode,
  27852. Header: res.Header,
  27853. }
  27854. }
  27855. if err != nil {
  27856. return nil, err
  27857. }
  27858. defer googleapi.CloseBody(res)
  27859. if err := googleapi.CheckResponse(res); err != nil {
  27860. return nil, err
  27861. }
  27862. ret := &File{
  27863. ServerResponse: googleapi.ServerResponse{
  27864. Header: res.Header,
  27865. HTTPStatusCode: res.StatusCode,
  27866. },
  27867. }
  27868. target := &ret
  27869. if err := gensupport.DecodeResponse(target, res); err != nil {
  27870. return nil, err
  27871. }
  27872. return ret, nil
  27873. // {
  27874. // "description": "Retrieves a report file by its report ID and file ID. This method supports media download.",
  27875. // "httpMethod": "GET",
  27876. // "id": "dfareporting.files.get",
  27877. // "parameterOrder": [
  27878. // "reportId",
  27879. // "fileId"
  27880. // ],
  27881. // "parameters": {
  27882. // "fileId": {
  27883. // "description": "The ID of the report file.",
  27884. // "format": "int64",
  27885. // "location": "path",
  27886. // "required": true,
  27887. // "type": "string"
  27888. // },
  27889. // "reportId": {
  27890. // "description": "The ID of the report.",
  27891. // "format": "int64",
  27892. // "location": "path",
  27893. // "required": true,
  27894. // "type": "string"
  27895. // }
  27896. // },
  27897. // "path": "reports/{reportId}/files/{fileId}",
  27898. // "response": {
  27899. // "$ref": "File"
  27900. // },
  27901. // "scopes": [
  27902. // "https://www.googleapis.com/auth/dfareporting"
  27903. // ],
  27904. // "supportsMediaDownload": true
  27905. // }
  27906. }
  27907. // method id "dfareporting.files.list":
  27908. type FilesListCall struct {
  27909. s *Service
  27910. profileId int64
  27911. urlParams_ gensupport.URLParams
  27912. ifNoneMatch_ string
  27913. ctx_ context.Context
  27914. header_ http.Header
  27915. }
  27916. // List: Lists files for a user profile.
  27917. func (r *FilesService) List(profileId int64) *FilesListCall {
  27918. c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27919. c.profileId = profileId
  27920. return c
  27921. }
  27922. // MaxResults sets the optional parameter "maxResults": Maximum number
  27923. // of results to return.
  27924. func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall {
  27925. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27926. return c
  27927. }
  27928. // PageToken sets the optional parameter "pageToken": The value of the
  27929. // nextToken from the previous result page.
  27930. func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
  27931. c.urlParams_.Set("pageToken", pageToken)
  27932. return c
  27933. }
  27934. // Scope sets the optional parameter "scope": The scope that defines
  27935. // which results are returned.
  27936. //
  27937. // Possible values:
  27938. // "ALL" - All files in account.
  27939. // "MINE" (default) - My files.
  27940. // "SHARED_WITH_ME" - Files shared with me.
  27941. func (c *FilesListCall) Scope(scope string) *FilesListCall {
  27942. c.urlParams_.Set("scope", scope)
  27943. return c
  27944. }
  27945. // SortField sets the optional parameter "sortField": The field by which
  27946. // to sort the list.
  27947. //
  27948. // Possible values:
  27949. // "ID" - Sort by file ID.
  27950. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  27951. func (c *FilesListCall) SortField(sortField string) *FilesListCall {
  27952. c.urlParams_.Set("sortField", sortField)
  27953. return c
  27954. }
  27955. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  27956. // results.
  27957. //
  27958. // Possible values:
  27959. // "ASCENDING" - Ascending order.
  27960. // "DESCENDING" (default) - Descending order.
  27961. func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall {
  27962. c.urlParams_.Set("sortOrder", sortOrder)
  27963. return c
  27964. }
  27965. // Fields allows partial responses to be retrieved. See
  27966. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27967. // for more information.
  27968. func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
  27969. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27970. return c
  27971. }
  27972. // IfNoneMatch sets the optional parameter which makes the operation
  27973. // fail if the object's ETag matches the given value. This is useful for
  27974. // getting updates only after the object has changed since the last
  27975. // request. Use googleapi.IsNotModified to check whether the response
  27976. // error from Do is the result of In-None-Match.
  27977. func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
  27978. c.ifNoneMatch_ = entityTag
  27979. return c
  27980. }
  27981. // Context sets the context to be used in this call's Do method. Any
  27982. // pending HTTP request will be aborted if the provided context is
  27983. // canceled.
  27984. func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
  27985. c.ctx_ = ctx
  27986. return c
  27987. }
  27988. // Header returns an http.Header that can be modified by the caller to
  27989. // add HTTP headers to the request.
  27990. func (c *FilesListCall) Header() http.Header {
  27991. if c.header_ == nil {
  27992. c.header_ = make(http.Header)
  27993. }
  27994. return c.header_
  27995. }
  27996. func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
  27997. reqHeaders := make(http.Header)
  27998. for k, v := range c.header_ {
  27999. reqHeaders[k] = v
  28000. }
  28001. reqHeaders.Set("User-Agent", c.s.userAgent())
  28002. if c.ifNoneMatch_ != "" {
  28003. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28004. }
  28005. var body io.Reader = nil
  28006. c.urlParams_.Set("alt", alt)
  28007. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files")
  28008. urls += "?" + c.urlParams_.Encode()
  28009. req, _ := http.NewRequest("GET", urls, body)
  28010. req.Header = reqHeaders
  28011. googleapi.Expand(req.URL, map[string]string{
  28012. "profileId": strconv.FormatInt(c.profileId, 10),
  28013. })
  28014. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28015. }
  28016. // Do executes the "dfareporting.files.list" call.
  28017. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  28018. // code is an error. Response headers are in either
  28019. // *FileList.ServerResponse.Header or (if a response was returned at
  28020. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  28021. // to check whether the returned error was because
  28022. // http.StatusNotModified was returned.
  28023. func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  28024. gensupport.SetOptions(c.urlParams_, opts...)
  28025. res, err := c.doRequest("json")
  28026. if res != nil && res.StatusCode == http.StatusNotModified {
  28027. if res.Body != nil {
  28028. res.Body.Close()
  28029. }
  28030. return nil, &googleapi.Error{
  28031. Code: res.StatusCode,
  28032. Header: res.Header,
  28033. }
  28034. }
  28035. if err != nil {
  28036. return nil, err
  28037. }
  28038. defer googleapi.CloseBody(res)
  28039. if err := googleapi.CheckResponse(res); err != nil {
  28040. return nil, err
  28041. }
  28042. ret := &FileList{
  28043. ServerResponse: googleapi.ServerResponse{
  28044. Header: res.Header,
  28045. HTTPStatusCode: res.StatusCode,
  28046. },
  28047. }
  28048. target := &ret
  28049. if err := gensupport.DecodeResponse(target, res); err != nil {
  28050. return nil, err
  28051. }
  28052. return ret, nil
  28053. // {
  28054. // "description": "Lists files for a user profile.",
  28055. // "httpMethod": "GET",
  28056. // "id": "dfareporting.files.list",
  28057. // "parameterOrder": [
  28058. // "profileId"
  28059. // ],
  28060. // "parameters": {
  28061. // "maxResults": {
  28062. // "default": "10",
  28063. // "description": "Maximum number of results to return.",
  28064. // "format": "int32",
  28065. // "location": "query",
  28066. // "maximum": "10",
  28067. // "minimum": "0",
  28068. // "type": "integer"
  28069. // },
  28070. // "pageToken": {
  28071. // "description": "The value of the nextToken from the previous result page.",
  28072. // "location": "query",
  28073. // "type": "string"
  28074. // },
  28075. // "profileId": {
  28076. // "description": "The DFA profile ID.",
  28077. // "format": "int64",
  28078. // "location": "path",
  28079. // "required": true,
  28080. // "type": "string"
  28081. // },
  28082. // "scope": {
  28083. // "default": "MINE",
  28084. // "description": "The scope that defines which results are returned.",
  28085. // "enum": [
  28086. // "ALL",
  28087. // "MINE",
  28088. // "SHARED_WITH_ME"
  28089. // ],
  28090. // "enumDescriptions": [
  28091. // "All files in account.",
  28092. // "My files.",
  28093. // "Files shared with me."
  28094. // ],
  28095. // "location": "query",
  28096. // "type": "string"
  28097. // },
  28098. // "sortField": {
  28099. // "default": "LAST_MODIFIED_TIME",
  28100. // "description": "The field by which to sort the list.",
  28101. // "enum": [
  28102. // "ID",
  28103. // "LAST_MODIFIED_TIME"
  28104. // ],
  28105. // "enumDescriptions": [
  28106. // "Sort by file ID.",
  28107. // "Sort by 'lastmodifiedAt' field."
  28108. // ],
  28109. // "location": "query",
  28110. // "type": "string"
  28111. // },
  28112. // "sortOrder": {
  28113. // "default": "DESCENDING",
  28114. // "description": "Order of sorted results.",
  28115. // "enum": [
  28116. // "ASCENDING",
  28117. // "DESCENDING"
  28118. // ],
  28119. // "enumDescriptions": [
  28120. // "Ascending order.",
  28121. // "Descending order."
  28122. // ],
  28123. // "location": "query",
  28124. // "type": "string"
  28125. // }
  28126. // },
  28127. // "path": "userprofiles/{profileId}/files",
  28128. // "response": {
  28129. // "$ref": "FileList"
  28130. // },
  28131. // "scopes": [
  28132. // "https://www.googleapis.com/auth/dfareporting"
  28133. // ]
  28134. // }
  28135. }
  28136. // Pages invokes f for each page of results.
  28137. // A non-nil error returned from f will halt the iteration.
  28138. // The provided context supersedes any context provided to the Context method.
  28139. func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  28140. c.ctx_ = ctx
  28141. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28142. for {
  28143. x, err := c.Do()
  28144. if err != nil {
  28145. return err
  28146. }
  28147. if err := f(x); err != nil {
  28148. return err
  28149. }
  28150. if x.NextPageToken == "" {
  28151. return nil
  28152. }
  28153. c.PageToken(x.NextPageToken)
  28154. }
  28155. }
  28156. // method id "dfareporting.floodlightActivities.delete":
  28157. type FloodlightActivitiesDeleteCall struct {
  28158. s *Service
  28159. profileId int64
  28160. id int64
  28161. urlParams_ gensupport.URLParams
  28162. ctx_ context.Context
  28163. header_ http.Header
  28164. }
  28165. // Delete: Deletes an existing floodlight activity.
  28166. func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall {
  28167. c := &FloodlightActivitiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28168. c.profileId = profileId
  28169. c.id = id
  28170. return c
  28171. }
  28172. // Fields allows partial responses to be retrieved. See
  28173. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28174. // for more information.
  28175. func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall {
  28176. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28177. return c
  28178. }
  28179. // Context sets the context to be used in this call's Do method. Any
  28180. // pending HTTP request will be aborted if the provided context is
  28181. // canceled.
  28182. func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall {
  28183. c.ctx_ = ctx
  28184. return c
  28185. }
  28186. // Header returns an http.Header that can be modified by the caller to
  28187. // add HTTP headers to the request.
  28188. func (c *FloodlightActivitiesDeleteCall) Header() http.Header {
  28189. if c.header_ == nil {
  28190. c.header_ = make(http.Header)
  28191. }
  28192. return c.header_
  28193. }
  28194. func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  28195. reqHeaders := make(http.Header)
  28196. for k, v := range c.header_ {
  28197. reqHeaders[k] = v
  28198. }
  28199. reqHeaders.Set("User-Agent", c.s.userAgent())
  28200. var body io.Reader = nil
  28201. c.urlParams_.Set("alt", alt)
  28202. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  28203. urls += "?" + c.urlParams_.Encode()
  28204. req, _ := http.NewRequest("DELETE", urls, body)
  28205. req.Header = reqHeaders
  28206. googleapi.Expand(req.URL, map[string]string{
  28207. "profileId": strconv.FormatInt(c.profileId, 10),
  28208. "id": strconv.FormatInt(c.id, 10),
  28209. })
  28210. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28211. }
  28212. // Do executes the "dfareporting.floodlightActivities.delete" call.
  28213. func (c *FloodlightActivitiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  28214. gensupport.SetOptions(c.urlParams_, opts...)
  28215. res, err := c.doRequest("json")
  28216. if err != nil {
  28217. return err
  28218. }
  28219. defer googleapi.CloseBody(res)
  28220. if err := googleapi.CheckResponse(res); err != nil {
  28221. return err
  28222. }
  28223. return nil
  28224. // {
  28225. // "description": "Deletes an existing floodlight activity.",
  28226. // "httpMethod": "DELETE",
  28227. // "id": "dfareporting.floodlightActivities.delete",
  28228. // "parameterOrder": [
  28229. // "profileId",
  28230. // "id"
  28231. // ],
  28232. // "parameters": {
  28233. // "id": {
  28234. // "description": "Floodlight activity ID.",
  28235. // "format": "int64",
  28236. // "location": "path",
  28237. // "required": true,
  28238. // "type": "string"
  28239. // },
  28240. // "profileId": {
  28241. // "description": "User profile ID associated with this request.",
  28242. // "format": "int64",
  28243. // "location": "path",
  28244. // "required": true,
  28245. // "type": "string"
  28246. // }
  28247. // },
  28248. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  28249. // "scopes": [
  28250. // "https://www.googleapis.com/auth/dfatrafficking"
  28251. // ]
  28252. // }
  28253. }
  28254. // method id "dfareporting.floodlightActivities.generatetag":
  28255. type FloodlightActivitiesGeneratetagCall struct {
  28256. s *Service
  28257. profileId int64
  28258. urlParams_ gensupport.URLParams
  28259. ctx_ context.Context
  28260. header_ http.Header
  28261. }
  28262. // Generatetag: Generates a tag for a floodlight activity.
  28263. func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall {
  28264. c := &FloodlightActivitiesGeneratetagCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28265. c.profileId = profileId
  28266. return c
  28267. }
  28268. // FloodlightActivityId sets the optional parameter
  28269. // "floodlightActivityId": Floodlight activity ID for which we want to
  28270. // generate a tag.
  28271. func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall {
  28272. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  28273. return c
  28274. }
  28275. // Fields allows partial responses to be retrieved. See
  28276. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28277. // for more information.
  28278. func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall {
  28279. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28280. return c
  28281. }
  28282. // Context sets the context to be used in this call's Do method. Any
  28283. // pending HTTP request will be aborted if the provided context is
  28284. // canceled.
  28285. func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall {
  28286. c.ctx_ = ctx
  28287. return c
  28288. }
  28289. // Header returns an http.Header that can be modified by the caller to
  28290. // add HTTP headers to the request.
  28291. func (c *FloodlightActivitiesGeneratetagCall) Header() http.Header {
  28292. if c.header_ == nil {
  28293. c.header_ = make(http.Header)
  28294. }
  28295. return c.header_
  28296. }
  28297. func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) {
  28298. reqHeaders := make(http.Header)
  28299. for k, v := range c.header_ {
  28300. reqHeaders[k] = v
  28301. }
  28302. reqHeaders.Set("User-Agent", c.s.userAgent())
  28303. var body io.Reader = nil
  28304. c.urlParams_.Set("alt", alt)
  28305. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag")
  28306. urls += "?" + c.urlParams_.Encode()
  28307. req, _ := http.NewRequest("POST", urls, body)
  28308. req.Header = reqHeaders
  28309. googleapi.Expand(req.URL, map[string]string{
  28310. "profileId": strconv.FormatInt(c.profileId, 10),
  28311. })
  28312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28313. }
  28314. // Do executes the "dfareporting.floodlightActivities.generatetag" call.
  28315. // Exactly one of *FloodlightActivitiesGenerateTagResponse or error will
  28316. // be non-nil. Any non-2xx status code is an error. Response headers are
  28317. // in either
  28318. // *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if
  28319. // a response was returned at all) in error.(*googleapi.Error).Header.
  28320. // Use googleapi.IsNotModified to check whether the returned error was
  28321. // because http.StatusNotModified was returned.
  28322. func (c *FloodlightActivitiesGeneratetagCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesGenerateTagResponse, error) {
  28323. gensupport.SetOptions(c.urlParams_, opts...)
  28324. res, err := c.doRequest("json")
  28325. if res != nil && res.StatusCode == http.StatusNotModified {
  28326. if res.Body != nil {
  28327. res.Body.Close()
  28328. }
  28329. return nil, &googleapi.Error{
  28330. Code: res.StatusCode,
  28331. Header: res.Header,
  28332. }
  28333. }
  28334. if err != nil {
  28335. return nil, err
  28336. }
  28337. defer googleapi.CloseBody(res)
  28338. if err := googleapi.CheckResponse(res); err != nil {
  28339. return nil, err
  28340. }
  28341. ret := &FloodlightActivitiesGenerateTagResponse{
  28342. ServerResponse: googleapi.ServerResponse{
  28343. Header: res.Header,
  28344. HTTPStatusCode: res.StatusCode,
  28345. },
  28346. }
  28347. target := &ret
  28348. if err := gensupport.DecodeResponse(target, res); err != nil {
  28349. return nil, err
  28350. }
  28351. return ret, nil
  28352. // {
  28353. // "description": "Generates a tag for a floodlight activity.",
  28354. // "httpMethod": "POST",
  28355. // "id": "dfareporting.floodlightActivities.generatetag",
  28356. // "parameterOrder": [
  28357. // "profileId"
  28358. // ],
  28359. // "parameters": {
  28360. // "floodlightActivityId": {
  28361. // "description": "Floodlight activity ID for which we want to generate a tag.",
  28362. // "format": "int64",
  28363. // "location": "query",
  28364. // "type": "string"
  28365. // },
  28366. // "profileId": {
  28367. // "description": "User profile ID associated with this request.",
  28368. // "format": "int64",
  28369. // "location": "path",
  28370. // "required": true,
  28371. // "type": "string"
  28372. // }
  28373. // },
  28374. // "path": "userprofiles/{profileId}/floodlightActivities/generatetag",
  28375. // "response": {
  28376. // "$ref": "FloodlightActivitiesGenerateTagResponse"
  28377. // },
  28378. // "scopes": [
  28379. // "https://www.googleapis.com/auth/dfatrafficking"
  28380. // ]
  28381. // }
  28382. }
  28383. // method id "dfareporting.floodlightActivities.get":
  28384. type FloodlightActivitiesGetCall struct {
  28385. s *Service
  28386. profileId int64
  28387. id int64
  28388. urlParams_ gensupport.URLParams
  28389. ifNoneMatch_ string
  28390. ctx_ context.Context
  28391. header_ http.Header
  28392. }
  28393. // Get: Gets one floodlight activity by ID.
  28394. func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall {
  28395. c := &FloodlightActivitiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28396. c.profileId = profileId
  28397. c.id = id
  28398. return c
  28399. }
  28400. // Fields allows partial responses to be retrieved. See
  28401. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28402. // for more information.
  28403. func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall {
  28404. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28405. return c
  28406. }
  28407. // IfNoneMatch sets the optional parameter which makes the operation
  28408. // fail if the object's ETag matches the given value. This is useful for
  28409. // getting updates only after the object has changed since the last
  28410. // request. Use googleapi.IsNotModified to check whether the response
  28411. // error from Do is the result of In-None-Match.
  28412. func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall {
  28413. c.ifNoneMatch_ = entityTag
  28414. return c
  28415. }
  28416. // Context sets the context to be used in this call's Do method. Any
  28417. // pending HTTP request will be aborted if the provided context is
  28418. // canceled.
  28419. func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall {
  28420. c.ctx_ = ctx
  28421. return c
  28422. }
  28423. // Header returns an http.Header that can be modified by the caller to
  28424. // add HTTP headers to the request.
  28425. func (c *FloodlightActivitiesGetCall) Header() http.Header {
  28426. if c.header_ == nil {
  28427. c.header_ = make(http.Header)
  28428. }
  28429. return c.header_
  28430. }
  28431. func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) {
  28432. reqHeaders := make(http.Header)
  28433. for k, v := range c.header_ {
  28434. reqHeaders[k] = v
  28435. }
  28436. reqHeaders.Set("User-Agent", c.s.userAgent())
  28437. if c.ifNoneMatch_ != "" {
  28438. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28439. }
  28440. var body io.Reader = nil
  28441. c.urlParams_.Set("alt", alt)
  28442. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  28443. urls += "?" + c.urlParams_.Encode()
  28444. req, _ := http.NewRequest("GET", urls, body)
  28445. req.Header = reqHeaders
  28446. googleapi.Expand(req.URL, map[string]string{
  28447. "profileId": strconv.FormatInt(c.profileId, 10),
  28448. "id": strconv.FormatInt(c.id, 10),
  28449. })
  28450. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28451. }
  28452. // Do executes the "dfareporting.floodlightActivities.get" call.
  28453. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  28454. // non-2xx status code is an error. Response headers are in either
  28455. // *FloodlightActivity.ServerResponse.Header or (if a response was
  28456. // returned at all) in error.(*googleapi.Error).Header. Use
  28457. // googleapi.IsNotModified to check whether the returned error was
  28458. // because http.StatusNotModified was returned.
  28459. func (c *FloodlightActivitiesGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  28460. gensupport.SetOptions(c.urlParams_, opts...)
  28461. res, err := c.doRequest("json")
  28462. if res != nil && res.StatusCode == http.StatusNotModified {
  28463. if res.Body != nil {
  28464. res.Body.Close()
  28465. }
  28466. return nil, &googleapi.Error{
  28467. Code: res.StatusCode,
  28468. Header: res.Header,
  28469. }
  28470. }
  28471. if err != nil {
  28472. return nil, err
  28473. }
  28474. defer googleapi.CloseBody(res)
  28475. if err := googleapi.CheckResponse(res); err != nil {
  28476. return nil, err
  28477. }
  28478. ret := &FloodlightActivity{
  28479. ServerResponse: googleapi.ServerResponse{
  28480. Header: res.Header,
  28481. HTTPStatusCode: res.StatusCode,
  28482. },
  28483. }
  28484. target := &ret
  28485. if err := gensupport.DecodeResponse(target, res); err != nil {
  28486. return nil, err
  28487. }
  28488. return ret, nil
  28489. // {
  28490. // "description": "Gets one floodlight activity by ID.",
  28491. // "httpMethod": "GET",
  28492. // "id": "dfareporting.floodlightActivities.get",
  28493. // "parameterOrder": [
  28494. // "profileId",
  28495. // "id"
  28496. // ],
  28497. // "parameters": {
  28498. // "id": {
  28499. // "description": "Floodlight activity ID.",
  28500. // "format": "int64",
  28501. // "location": "path",
  28502. // "required": true,
  28503. // "type": "string"
  28504. // },
  28505. // "profileId": {
  28506. // "description": "User profile ID associated with this request.",
  28507. // "format": "int64",
  28508. // "location": "path",
  28509. // "required": true,
  28510. // "type": "string"
  28511. // }
  28512. // },
  28513. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  28514. // "response": {
  28515. // "$ref": "FloodlightActivity"
  28516. // },
  28517. // "scopes": [
  28518. // "https://www.googleapis.com/auth/dfatrafficking"
  28519. // ]
  28520. // }
  28521. }
  28522. // method id "dfareporting.floodlightActivities.insert":
  28523. type FloodlightActivitiesInsertCall struct {
  28524. s *Service
  28525. profileId int64
  28526. floodlightactivity *FloodlightActivity
  28527. urlParams_ gensupport.URLParams
  28528. ctx_ context.Context
  28529. header_ http.Header
  28530. }
  28531. // Insert: Inserts a new floodlight activity.
  28532. func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall {
  28533. c := &FloodlightActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28534. c.profileId = profileId
  28535. c.floodlightactivity = floodlightactivity
  28536. return c
  28537. }
  28538. // Fields allows partial responses to be retrieved. See
  28539. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28540. // for more information.
  28541. func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall {
  28542. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28543. return c
  28544. }
  28545. // Context sets the context to be used in this call's Do method. Any
  28546. // pending HTTP request will be aborted if the provided context is
  28547. // canceled.
  28548. func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall {
  28549. c.ctx_ = ctx
  28550. return c
  28551. }
  28552. // Header returns an http.Header that can be modified by the caller to
  28553. // add HTTP headers to the request.
  28554. func (c *FloodlightActivitiesInsertCall) Header() http.Header {
  28555. if c.header_ == nil {
  28556. c.header_ = make(http.Header)
  28557. }
  28558. return c.header_
  28559. }
  28560. func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  28561. reqHeaders := make(http.Header)
  28562. for k, v := range c.header_ {
  28563. reqHeaders[k] = v
  28564. }
  28565. reqHeaders.Set("User-Agent", c.s.userAgent())
  28566. var body io.Reader = nil
  28567. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  28568. if err != nil {
  28569. return nil, err
  28570. }
  28571. reqHeaders.Set("Content-Type", "application/json")
  28572. c.urlParams_.Set("alt", alt)
  28573. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  28574. urls += "?" + c.urlParams_.Encode()
  28575. req, _ := http.NewRequest("POST", urls, body)
  28576. req.Header = reqHeaders
  28577. googleapi.Expand(req.URL, map[string]string{
  28578. "profileId": strconv.FormatInt(c.profileId, 10),
  28579. })
  28580. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28581. }
  28582. // Do executes the "dfareporting.floodlightActivities.insert" call.
  28583. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  28584. // non-2xx status code is an error. Response headers are in either
  28585. // *FloodlightActivity.ServerResponse.Header or (if a response was
  28586. // returned at all) in error.(*googleapi.Error).Header. Use
  28587. // googleapi.IsNotModified to check whether the returned error was
  28588. // because http.StatusNotModified was returned.
  28589. func (c *FloodlightActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  28590. gensupport.SetOptions(c.urlParams_, opts...)
  28591. res, err := c.doRequest("json")
  28592. if res != nil && res.StatusCode == http.StatusNotModified {
  28593. if res.Body != nil {
  28594. res.Body.Close()
  28595. }
  28596. return nil, &googleapi.Error{
  28597. Code: res.StatusCode,
  28598. Header: res.Header,
  28599. }
  28600. }
  28601. if err != nil {
  28602. return nil, err
  28603. }
  28604. defer googleapi.CloseBody(res)
  28605. if err := googleapi.CheckResponse(res); err != nil {
  28606. return nil, err
  28607. }
  28608. ret := &FloodlightActivity{
  28609. ServerResponse: googleapi.ServerResponse{
  28610. Header: res.Header,
  28611. HTTPStatusCode: res.StatusCode,
  28612. },
  28613. }
  28614. target := &ret
  28615. if err := gensupport.DecodeResponse(target, res); err != nil {
  28616. return nil, err
  28617. }
  28618. return ret, nil
  28619. // {
  28620. // "description": "Inserts a new floodlight activity.",
  28621. // "httpMethod": "POST",
  28622. // "id": "dfareporting.floodlightActivities.insert",
  28623. // "parameterOrder": [
  28624. // "profileId"
  28625. // ],
  28626. // "parameters": {
  28627. // "profileId": {
  28628. // "description": "User profile ID associated with this request.",
  28629. // "format": "int64",
  28630. // "location": "path",
  28631. // "required": true,
  28632. // "type": "string"
  28633. // }
  28634. // },
  28635. // "path": "userprofiles/{profileId}/floodlightActivities",
  28636. // "request": {
  28637. // "$ref": "FloodlightActivity"
  28638. // },
  28639. // "response": {
  28640. // "$ref": "FloodlightActivity"
  28641. // },
  28642. // "scopes": [
  28643. // "https://www.googleapis.com/auth/dfatrafficking"
  28644. // ]
  28645. // }
  28646. }
  28647. // method id "dfareporting.floodlightActivities.list":
  28648. type FloodlightActivitiesListCall struct {
  28649. s *Service
  28650. profileId int64
  28651. urlParams_ gensupport.URLParams
  28652. ifNoneMatch_ string
  28653. ctx_ context.Context
  28654. header_ http.Header
  28655. }
  28656. // List: Retrieves a list of floodlight activities, possibly filtered.
  28657. // This method supports paging.
  28658. func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall {
  28659. c := &FloodlightActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28660. c.profileId = profileId
  28661. return c
  28662. }
  28663. // AdvertiserId sets the optional parameter "advertiserId": Select only
  28664. // floodlight activities for the specified advertiser ID. Must specify
  28665. // either ids, advertiserId, or floodlightConfigurationId for a
  28666. // non-empty result.
  28667. func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall {
  28668. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  28669. return c
  28670. }
  28671. // FloodlightActivityGroupIds sets the optional parameter
  28672. // "floodlightActivityGroupIds": Select only floodlight activities with
  28673. // the specified floodlight activity group IDs.
  28674. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds ...int64) *FloodlightActivitiesListCall {
  28675. var floodlightActivityGroupIds_ []string
  28676. for _, v := range floodlightActivityGroupIds {
  28677. floodlightActivityGroupIds_ = append(floodlightActivityGroupIds_, fmt.Sprint(v))
  28678. }
  28679. c.urlParams_.SetMulti("floodlightActivityGroupIds", floodlightActivityGroupIds_)
  28680. return c
  28681. }
  28682. // FloodlightActivityGroupName sets the optional parameter
  28683. // "floodlightActivityGroupName": Select only floodlight activities with
  28684. // the specified floodlight activity group name.
  28685. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall {
  28686. c.urlParams_.Set("floodlightActivityGroupName", floodlightActivityGroupName)
  28687. return c
  28688. }
  28689. // FloodlightActivityGroupTagString sets the optional parameter
  28690. // "floodlightActivityGroupTagString": Select only floodlight activities
  28691. // with the specified floodlight activity group tag string.
  28692. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall {
  28693. c.urlParams_.Set("floodlightActivityGroupTagString", floodlightActivityGroupTagString)
  28694. return c
  28695. }
  28696. // FloodlightActivityGroupType sets the optional parameter
  28697. // "floodlightActivityGroupType": Select only floodlight activities with
  28698. // the specified floodlight activity group type.
  28699. //
  28700. // Possible values:
  28701. // "COUNTER"
  28702. // "SALE"
  28703. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall {
  28704. c.urlParams_.Set("floodlightActivityGroupType", floodlightActivityGroupType)
  28705. return c
  28706. }
  28707. // FloodlightConfigurationId sets the optional parameter
  28708. // "floodlightConfigurationId": Select only floodlight activities for
  28709. // the specified floodlight configuration ID. Must specify either ids,
  28710. // advertiserId, or floodlightConfigurationId for a non-empty result.
  28711. func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall {
  28712. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  28713. return c
  28714. }
  28715. // Ids sets the optional parameter "ids": Select only floodlight
  28716. // activities with the specified IDs. Must specify either ids,
  28717. // advertiserId, or floodlightConfigurationId for a non-empty result.
  28718. func (c *FloodlightActivitiesListCall) Ids(ids ...int64) *FloodlightActivitiesListCall {
  28719. var ids_ []string
  28720. for _, v := range ids {
  28721. ids_ = append(ids_, fmt.Sprint(v))
  28722. }
  28723. c.urlParams_.SetMulti("ids", ids_)
  28724. return c
  28725. }
  28726. // MaxResults sets the optional parameter "maxResults": Maximum number
  28727. // of results to return.
  28728. func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall {
  28729. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28730. return c
  28731. }
  28732. // PageToken sets the optional parameter "pageToken": Value of the
  28733. // nextPageToken from the previous result page.
  28734. func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall {
  28735. c.urlParams_.Set("pageToken", pageToken)
  28736. return c
  28737. }
  28738. // SearchString sets the optional parameter "searchString": Allows
  28739. // searching for objects by name or ID. Wildcards (*) are allowed. For
  28740. // example, "floodlightactivity*2015" will return objects with names
  28741. // like "floodlightactivity June 2015", "floodlightactivity April 2015",
  28742. // or simply "floodlightactivity 2015". Most of the searches also add
  28743. // wildcards implicitly at the start and the end of the search string.
  28744. // For example, a search string of "floodlightactivity" will match
  28745. // objects with name "my floodlightactivity activity",
  28746. // "floodlightactivity 2015", or simply "floodlightactivity".
  28747. func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall {
  28748. c.urlParams_.Set("searchString", searchString)
  28749. return c
  28750. }
  28751. // SortField sets the optional parameter "sortField": Field by which to
  28752. // sort the list.
  28753. //
  28754. // Possible values:
  28755. // "ID" (default)
  28756. // "NAME"
  28757. func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall {
  28758. c.urlParams_.Set("sortField", sortField)
  28759. return c
  28760. }
  28761. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  28762. // results.
  28763. //
  28764. // Possible values:
  28765. // "ASCENDING" (default)
  28766. // "DESCENDING"
  28767. func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall {
  28768. c.urlParams_.Set("sortOrder", sortOrder)
  28769. return c
  28770. }
  28771. // TagString sets the optional parameter "tagString": Select only
  28772. // floodlight activities with the specified tag string.
  28773. func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall {
  28774. c.urlParams_.Set("tagString", tagString)
  28775. return c
  28776. }
  28777. // Fields allows partial responses to be retrieved. See
  28778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28779. // for more information.
  28780. func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall {
  28781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28782. return c
  28783. }
  28784. // IfNoneMatch sets the optional parameter which makes the operation
  28785. // fail if the object's ETag matches the given value. This is useful for
  28786. // getting updates only after the object has changed since the last
  28787. // request. Use googleapi.IsNotModified to check whether the response
  28788. // error from Do is the result of In-None-Match.
  28789. func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall {
  28790. c.ifNoneMatch_ = entityTag
  28791. return c
  28792. }
  28793. // Context sets the context to be used in this call's Do method. Any
  28794. // pending HTTP request will be aborted if the provided context is
  28795. // canceled.
  28796. func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall {
  28797. c.ctx_ = ctx
  28798. return c
  28799. }
  28800. // Header returns an http.Header that can be modified by the caller to
  28801. // add HTTP headers to the request.
  28802. func (c *FloodlightActivitiesListCall) Header() http.Header {
  28803. if c.header_ == nil {
  28804. c.header_ = make(http.Header)
  28805. }
  28806. return c.header_
  28807. }
  28808. func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  28809. reqHeaders := make(http.Header)
  28810. for k, v := range c.header_ {
  28811. reqHeaders[k] = v
  28812. }
  28813. reqHeaders.Set("User-Agent", c.s.userAgent())
  28814. if c.ifNoneMatch_ != "" {
  28815. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28816. }
  28817. var body io.Reader = nil
  28818. c.urlParams_.Set("alt", alt)
  28819. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  28820. urls += "?" + c.urlParams_.Encode()
  28821. req, _ := http.NewRequest("GET", urls, body)
  28822. req.Header = reqHeaders
  28823. googleapi.Expand(req.URL, map[string]string{
  28824. "profileId": strconv.FormatInt(c.profileId, 10),
  28825. })
  28826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28827. }
  28828. // Do executes the "dfareporting.floodlightActivities.list" call.
  28829. // Exactly one of *FloodlightActivitiesListResponse or error will be
  28830. // non-nil. Any non-2xx status code is an error. Response headers are in
  28831. // either *FloodlightActivitiesListResponse.ServerResponse.Header or (if
  28832. // a response was returned at all) in error.(*googleapi.Error).Header.
  28833. // Use googleapi.IsNotModified to check whether the returned error was
  28834. // because http.StatusNotModified was returned.
  28835. func (c *FloodlightActivitiesListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesListResponse, error) {
  28836. gensupport.SetOptions(c.urlParams_, opts...)
  28837. res, err := c.doRequest("json")
  28838. if res != nil && res.StatusCode == http.StatusNotModified {
  28839. if res.Body != nil {
  28840. res.Body.Close()
  28841. }
  28842. return nil, &googleapi.Error{
  28843. Code: res.StatusCode,
  28844. Header: res.Header,
  28845. }
  28846. }
  28847. if err != nil {
  28848. return nil, err
  28849. }
  28850. defer googleapi.CloseBody(res)
  28851. if err := googleapi.CheckResponse(res); err != nil {
  28852. return nil, err
  28853. }
  28854. ret := &FloodlightActivitiesListResponse{
  28855. ServerResponse: googleapi.ServerResponse{
  28856. Header: res.Header,
  28857. HTTPStatusCode: res.StatusCode,
  28858. },
  28859. }
  28860. target := &ret
  28861. if err := gensupport.DecodeResponse(target, res); err != nil {
  28862. return nil, err
  28863. }
  28864. return ret, nil
  28865. // {
  28866. // "description": "Retrieves a list of floodlight activities, possibly filtered. This method supports paging.",
  28867. // "httpMethod": "GET",
  28868. // "id": "dfareporting.floodlightActivities.list",
  28869. // "parameterOrder": [
  28870. // "profileId"
  28871. // ],
  28872. // "parameters": {
  28873. // "advertiserId": {
  28874. // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  28875. // "format": "int64",
  28876. // "location": "query",
  28877. // "type": "string"
  28878. // },
  28879. // "floodlightActivityGroupIds": {
  28880. // "description": "Select only floodlight activities with the specified floodlight activity group IDs.",
  28881. // "format": "int64",
  28882. // "location": "query",
  28883. // "repeated": true,
  28884. // "type": "string"
  28885. // },
  28886. // "floodlightActivityGroupName": {
  28887. // "description": "Select only floodlight activities with the specified floodlight activity group name.",
  28888. // "location": "query",
  28889. // "type": "string"
  28890. // },
  28891. // "floodlightActivityGroupTagString": {
  28892. // "description": "Select only floodlight activities with the specified floodlight activity group tag string.",
  28893. // "location": "query",
  28894. // "type": "string"
  28895. // },
  28896. // "floodlightActivityGroupType": {
  28897. // "description": "Select only floodlight activities with the specified floodlight activity group type.",
  28898. // "enum": [
  28899. // "COUNTER",
  28900. // "SALE"
  28901. // ],
  28902. // "enumDescriptions": [
  28903. // "",
  28904. // ""
  28905. // ],
  28906. // "location": "query",
  28907. // "type": "string"
  28908. // },
  28909. // "floodlightConfigurationId": {
  28910. // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  28911. // "format": "int64",
  28912. // "location": "query",
  28913. // "type": "string"
  28914. // },
  28915. // "ids": {
  28916. // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  28917. // "format": "int64",
  28918. // "location": "query",
  28919. // "repeated": true,
  28920. // "type": "string"
  28921. // },
  28922. // "maxResults": {
  28923. // "default": "1000",
  28924. // "description": "Maximum number of results to return.",
  28925. // "format": "int32",
  28926. // "location": "query",
  28927. // "maximum": "1000",
  28928. // "minimum": "0",
  28929. // "type": "integer"
  28930. // },
  28931. // "pageToken": {
  28932. // "description": "Value of the nextPageToken from the previous result page.",
  28933. // "location": "query",
  28934. // "type": "string"
  28935. // },
  28936. // "profileId": {
  28937. // "description": "User profile ID associated with this request.",
  28938. // "format": "int64",
  28939. // "location": "path",
  28940. // "required": true,
  28941. // "type": "string"
  28942. // },
  28943. // "searchString": {
  28944. // "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\".",
  28945. // "location": "query",
  28946. // "type": "string"
  28947. // },
  28948. // "sortField": {
  28949. // "default": "ID",
  28950. // "description": "Field by which to sort the list.",
  28951. // "enum": [
  28952. // "ID",
  28953. // "NAME"
  28954. // ],
  28955. // "enumDescriptions": [
  28956. // "",
  28957. // ""
  28958. // ],
  28959. // "location": "query",
  28960. // "type": "string"
  28961. // },
  28962. // "sortOrder": {
  28963. // "default": "ASCENDING",
  28964. // "description": "Order of sorted results.",
  28965. // "enum": [
  28966. // "ASCENDING",
  28967. // "DESCENDING"
  28968. // ],
  28969. // "enumDescriptions": [
  28970. // "",
  28971. // ""
  28972. // ],
  28973. // "location": "query",
  28974. // "type": "string"
  28975. // },
  28976. // "tagString": {
  28977. // "description": "Select only floodlight activities with the specified tag string.",
  28978. // "location": "query",
  28979. // "type": "string"
  28980. // }
  28981. // },
  28982. // "path": "userprofiles/{profileId}/floodlightActivities",
  28983. // "response": {
  28984. // "$ref": "FloodlightActivitiesListResponse"
  28985. // },
  28986. // "scopes": [
  28987. // "https://www.googleapis.com/auth/dfatrafficking"
  28988. // ]
  28989. // }
  28990. }
  28991. // Pages invokes f for each page of results.
  28992. // A non-nil error returned from f will halt the iteration.
  28993. // The provided context supersedes any context provided to the Context method.
  28994. func (c *FloodlightActivitiesListCall) Pages(ctx context.Context, f func(*FloodlightActivitiesListResponse) error) error {
  28995. c.ctx_ = ctx
  28996. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28997. for {
  28998. x, err := c.Do()
  28999. if err != nil {
  29000. return err
  29001. }
  29002. if err := f(x); err != nil {
  29003. return err
  29004. }
  29005. if x.NextPageToken == "" {
  29006. return nil
  29007. }
  29008. c.PageToken(x.NextPageToken)
  29009. }
  29010. }
  29011. // method id "dfareporting.floodlightActivities.patch":
  29012. type FloodlightActivitiesPatchCall struct {
  29013. s *Service
  29014. profileId int64
  29015. floodlightactivity *FloodlightActivity
  29016. urlParams_ gensupport.URLParams
  29017. ctx_ context.Context
  29018. header_ http.Header
  29019. }
  29020. // Patch: Updates an existing floodlight activity. This method supports
  29021. // patch semantics.
  29022. func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall {
  29023. c := &FloodlightActivitiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29024. c.profileId = profileId
  29025. c.urlParams_.Set("id", fmt.Sprint(id))
  29026. c.floodlightactivity = floodlightactivity
  29027. return c
  29028. }
  29029. // Fields allows partial responses to be retrieved. See
  29030. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29031. // for more information.
  29032. func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall {
  29033. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29034. return c
  29035. }
  29036. // Context sets the context to be used in this call's Do method. Any
  29037. // pending HTTP request will be aborted if the provided context is
  29038. // canceled.
  29039. func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall {
  29040. c.ctx_ = ctx
  29041. return c
  29042. }
  29043. // Header returns an http.Header that can be modified by the caller to
  29044. // add HTTP headers to the request.
  29045. func (c *FloodlightActivitiesPatchCall) Header() http.Header {
  29046. if c.header_ == nil {
  29047. c.header_ = make(http.Header)
  29048. }
  29049. return c.header_
  29050. }
  29051. func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) {
  29052. reqHeaders := make(http.Header)
  29053. for k, v := range c.header_ {
  29054. reqHeaders[k] = v
  29055. }
  29056. reqHeaders.Set("User-Agent", c.s.userAgent())
  29057. var body io.Reader = nil
  29058. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29059. if err != nil {
  29060. return nil, err
  29061. }
  29062. reqHeaders.Set("Content-Type", "application/json")
  29063. c.urlParams_.Set("alt", alt)
  29064. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29065. urls += "?" + c.urlParams_.Encode()
  29066. req, _ := http.NewRequest("PATCH", urls, body)
  29067. req.Header = reqHeaders
  29068. googleapi.Expand(req.URL, map[string]string{
  29069. "profileId": strconv.FormatInt(c.profileId, 10),
  29070. })
  29071. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29072. }
  29073. // Do executes the "dfareporting.floodlightActivities.patch" call.
  29074. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29075. // non-2xx status code is an error. Response headers are in either
  29076. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29077. // returned at all) in error.(*googleapi.Error).Header. Use
  29078. // googleapi.IsNotModified to check whether the returned error was
  29079. // because http.StatusNotModified was returned.
  29080. func (c *FloodlightActivitiesPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29081. gensupport.SetOptions(c.urlParams_, opts...)
  29082. res, err := c.doRequest("json")
  29083. if res != nil && res.StatusCode == http.StatusNotModified {
  29084. if res.Body != nil {
  29085. res.Body.Close()
  29086. }
  29087. return nil, &googleapi.Error{
  29088. Code: res.StatusCode,
  29089. Header: res.Header,
  29090. }
  29091. }
  29092. if err != nil {
  29093. return nil, err
  29094. }
  29095. defer googleapi.CloseBody(res)
  29096. if err := googleapi.CheckResponse(res); err != nil {
  29097. return nil, err
  29098. }
  29099. ret := &FloodlightActivity{
  29100. ServerResponse: googleapi.ServerResponse{
  29101. Header: res.Header,
  29102. HTTPStatusCode: res.StatusCode,
  29103. },
  29104. }
  29105. target := &ret
  29106. if err := gensupport.DecodeResponse(target, res); err != nil {
  29107. return nil, err
  29108. }
  29109. return ret, nil
  29110. // {
  29111. // "description": "Updates an existing floodlight activity. This method supports patch semantics.",
  29112. // "httpMethod": "PATCH",
  29113. // "id": "dfareporting.floodlightActivities.patch",
  29114. // "parameterOrder": [
  29115. // "profileId",
  29116. // "id"
  29117. // ],
  29118. // "parameters": {
  29119. // "id": {
  29120. // "description": "Floodlight activity ID.",
  29121. // "format": "int64",
  29122. // "location": "query",
  29123. // "required": true,
  29124. // "type": "string"
  29125. // },
  29126. // "profileId": {
  29127. // "description": "User profile ID associated with this request.",
  29128. // "format": "int64",
  29129. // "location": "path",
  29130. // "required": true,
  29131. // "type": "string"
  29132. // }
  29133. // },
  29134. // "path": "userprofiles/{profileId}/floodlightActivities",
  29135. // "request": {
  29136. // "$ref": "FloodlightActivity"
  29137. // },
  29138. // "response": {
  29139. // "$ref": "FloodlightActivity"
  29140. // },
  29141. // "scopes": [
  29142. // "https://www.googleapis.com/auth/dfatrafficking"
  29143. // ]
  29144. // }
  29145. }
  29146. // method id "dfareporting.floodlightActivities.update":
  29147. type FloodlightActivitiesUpdateCall struct {
  29148. s *Service
  29149. profileId int64
  29150. floodlightactivity *FloodlightActivity
  29151. urlParams_ gensupport.URLParams
  29152. ctx_ context.Context
  29153. header_ http.Header
  29154. }
  29155. // Update: Updates an existing floodlight activity.
  29156. func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall {
  29157. c := &FloodlightActivitiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29158. c.profileId = profileId
  29159. c.floodlightactivity = floodlightactivity
  29160. return c
  29161. }
  29162. // Fields allows partial responses to be retrieved. See
  29163. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29164. // for more information.
  29165. func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall {
  29166. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29167. return c
  29168. }
  29169. // Context sets the context to be used in this call's Do method. Any
  29170. // pending HTTP request will be aborted if the provided context is
  29171. // canceled.
  29172. func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall {
  29173. c.ctx_ = ctx
  29174. return c
  29175. }
  29176. // Header returns an http.Header that can be modified by the caller to
  29177. // add HTTP headers to the request.
  29178. func (c *FloodlightActivitiesUpdateCall) Header() http.Header {
  29179. if c.header_ == nil {
  29180. c.header_ = make(http.Header)
  29181. }
  29182. return c.header_
  29183. }
  29184. func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  29185. reqHeaders := make(http.Header)
  29186. for k, v := range c.header_ {
  29187. reqHeaders[k] = v
  29188. }
  29189. reqHeaders.Set("User-Agent", c.s.userAgent())
  29190. var body io.Reader = nil
  29191. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  29192. if err != nil {
  29193. return nil, err
  29194. }
  29195. reqHeaders.Set("Content-Type", "application/json")
  29196. c.urlParams_.Set("alt", alt)
  29197. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  29198. urls += "?" + c.urlParams_.Encode()
  29199. req, _ := http.NewRequest("PUT", urls, body)
  29200. req.Header = reqHeaders
  29201. googleapi.Expand(req.URL, map[string]string{
  29202. "profileId": strconv.FormatInt(c.profileId, 10),
  29203. })
  29204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29205. }
  29206. // Do executes the "dfareporting.floodlightActivities.update" call.
  29207. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  29208. // non-2xx status code is an error. Response headers are in either
  29209. // *FloodlightActivity.ServerResponse.Header or (if a response was
  29210. // returned at all) in error.(*googleapi.Error).Header. Use
  29211. // googleapi.IsNotModified to check whether the returned error was
  29212. // because http.StatusNotModified was returned.
  29213. func (c *FloodlightActivitiesUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  29214. gensupport.SetOptions(c.urlParams_, opts...)
  29215. res, err := c.doRequest("json")
  29216. if res != nil && res.StatusCode == http.StatusNotModified {
  29217. if res.Body != nil {
  29218. res.Body.Close()
  29219. }
  29220. return nil, &googleapi.Error{
  29221. Code: res.StatusCode,
  29222. Header: res.Header,
  29223. }
  29224. }
  29225. if err != nil {
  29226. return nil, err
  29227. }
  29228. defer googleapi.CloseBody(res)
  29229. if err := googleapi.CheckResponse(res); err != nil {
  29230. return nil, err
  29231. }
  29232. ret := &FloodlightActivity{
  29233. ServerResponse: googleapi.ServerResponse{
  29234. Header: res.Header,
  29235. HTTPStatusCode: res.StatusCode,
  29236. },
  29237. }
  29238. target := &ret
  29239. if err := gensupport.DecodeResponse(target, res); err != nil {
  29240. return nil, err
  29241. }
  29242. return ret, nil
  29243. // {
  29244. // "description": "Updates an existing floodlight activity.",
  29245. // "httpMethod": "PUT",
  29246. // "id": "dfareporting.floodlightActivities.update",
  29247. // "parameterOrder": [
  29248. // "profileId"
  29249. // ],
  29250. // "parameters": {
  29251. // "profileId": {
  29252. // "description": "User profile ID associated with this request.",
  29253. // "format": "int64",
  29254. // "location": "path",
  29255. // "required": true,
  29256. // "type": "string"
  29257. // }
  29258. // },
  29259. // "path": "userprofiles/{profileId}/floodlightActivities",
  29260. // "request": {
  29261. // "$ref": "FloodlightActivity"
  29262. // },
  29263. // "response": {
  29264. // "$ref": "FloodlightActivity"
  29265. // },
  29266. // "scopes": [
  29267. // "https://www.googleapis.com/auth/dfatrafficking"
  29268. // ]
  29269. // }
  29270. }
  29271. // method id "dfareporting.floodlightActivityGroups.get":
  29272. type FloodlightActivityGroupsGetCall struct {
  29273. s *Service
  29274. profileId int64
  29275. id int64
  29276. urlParams_ gensupport.URLParams
  29277. ifNoneMatch_ string
  29278. ctx_ context.Context
  29279. header_ http.Header
  29280. }
  29281. // Get: Gets one floodlight activity group by ID.
  29282. func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall {
  29283. c := &FloodlightActivityGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29284. c.profileId = profileId
  29285. c.id = id
  29286. return c
  29287. }
  29288. // Fields allows partial responses to be retrieved. See
  29289. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29290. // for more information.
  29291. func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall {
  29292. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29293. return c
  29294. }
  29295. // IfNoneMatch sets the optional parameter which makes the operation
  29296. // fail if the object's ETag matches the given value. This is useful for
  29297. // getting updates only after the object has changed since the last
  29298. // request. Use googleapi.IsNotModified to check whether the response
  29299. // error from Do is the result of In-None-Match.
  29300. func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall {
  29301. c.ifNoneMatch_ = entityTag
  29302. return c
  29303. }
  29304. // Context sets the context to be used in this call's Do method. Any
  29305. // pending HTTP request will be aborted if the provided context is
  29306. // canceled.
  29307. func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall {
  29308. c.ctx_ = ctx
  29309. return c
  29310. }
  29311. // Header returns an http.Header that can be modified by the caller to
  29312. // add HTTP headers to the request.
  29313. func (c *FloodlightActivityGroupsGetCall) Header() http.Header {
  29314. if c.header_ == nil {
  29315. c.header_ = make(http.Header)
  29316. }
  29317. return c.header_
  29318. }
  29319. func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  29320. reqHeaders := make(http.Header)
  29321. for k, v := range c.header_ {
  29322. reqHeaders[k] = v
  29323. }
  29324. reqHeaders.Set("User-Agent", c.s.userAgent())
  29325. if c.ifNoneMatch_ != "" {
  29326. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29327. }
  29328. var body io.Reader = nil
  29329. c.urlParams_.Set("alt", alt)
  29330. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}")
  29331. urls += "?" + c.urlParams_.Encode()
  29332. req, _ := http.NewRequest("GET", urls, body)
  29333. req.Header = reqHeaders
  29334. googleapi.Expand(req.URL, map[string]string{
  29335. "profileId": strconv.FormatInt(c.profileId, 10),
  29336. "id": strconv.FormatInt(c.id, 10),
  29337. })
  29338. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29339. }
  29340. // Do executes the "dfareporting.floodlightActivityGroups.get" call.
  29341. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  29342. // non-2xx status code is an error. Response headers are in either
  29343. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  29344. // returned at all) in error.(*googleapi.Error).Header. Use
  29345. // googleapi.IsNotModified to check whether the returned error was
  29346. // because http.StatusNotModified was returned.
  29347. func (c *FloodlightActivityGroupsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  29348. gensupport.SetOptions(c.urlParams_, opts...)
  29349. res, err := c.doRequest("json")
  29350. if res != nil && res.StatusCode == http.StatusNotModified {
  29351. if res.Body != nil {
  29352. res.Body.Close()
  29353. }
  29354. return nil, &googleapi.Error{
  29355. Code: res.StatusCode,
  29356. Header: res.Header,
  29357. }
  29358. }
  29359. if err != nil {
  29360. return nil, err
  29361. }
  29362. defer googleapi.CloseBody(res)
  29363. if err := googleapi.CheckResponse(res); err != nil {
  29364. return nil, err
  29365. }
  29366. ret := &FloodlightActivityGroup{
  29367. ServerResponse: googleapi.ServerResponse{
  29368. Header: res.Header,
  29369. HTTPStatusCode: res.StatusCode,
  29370. },
  29371. }
  29372. target := &ret
  29373. if err := gensupport.DecodeResponse(target, res); err != nil {
  29374. return nil, err
  29375. }
  29376. return ret, nil
  29377. // {
  29378. // "description": "Gets one floodlight activity group by ID.",
  29379. // "httpMethod": "GET",
  29380. // "id": "dfareporting.floodlightActivityGroups.get",
  29381. // "parameterOrder": [
  29382. // "profileId",
  29383. // "id"
  29384. // ],
  29385. // "parameters": {
  29386. // "id": {
  29387. // "description": "Floodlight activity Group ID.",
  29388. // "format": "int64",
  29389. // "location": "path",
  29390. // "required": true,
  29391. // "type": "string"
  29392. // },
  29393. // "profileId": {
  29394. // "description": "User profile ID associated with this request.",
  29395. // "format": "int64",
  29396. // "location": "path",
  29397. // "required": true,
  29398. // "type": "string"
  29399. // }
  29400. // },
  29401. // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}",
  29402. // "response": {
  29403. // "$ref": "FloodlightActivityGroup"
  29404. // },
  29405. // "scopes": [
  29406. // "https://www.googleapis.com/auth/dfatrafficking"
  29407. // ]
  29408. // }
  29409. }
  29410. // method id "dfareporting.floodlightActivityGroups.insert":
  29411. type FloodlightActivityGroupsInsertCall struct {
  29412. s *Service
  29413. profileId int64
  29414. floodlightactivitygroup *FloodlightActivityGroup
  29415. urlParams_ gensupport.URLParams
  29416. ctx_ context.Context
  29417. header_ http.Header
  29418. }
  29419. // Insert: Inserts a new floodlight activity group.
  29420. func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall {
  29421. c := &FloodlightActivityGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29422. c.profileId = profileId
  29423. c.floodlightactivitygroup = floodlightactivitygroup
  29424. return c
  29425. }
  29426. // Fields allows partial responses to be retrieved. See
  29427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29428. // for more information.
  29429. func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall {
  29430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29431. return c
  29432. }
  29433. // Context sets the context to be used in this call's Do method. Any
  29434. // pending HTTP request will be aborted if the provided context is
  29435. // canceled.
  29436. func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall {
  29437. c.ctx_ = ctx
  29438. return c
  29439. }
  29440. // Header returns an http.Header that can be modified by the caller to
  29441. // add HTTP headers to the request.
  29442. func (c *FloodlightActivityGroupsInsertCall) Header() http.Header {
  29443. if c.header_ == nil {
  29444. c.header_ = make(http.Header)
  29445. }
  29446. return c.header_
  29447. }
  29448. func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  29449. reqHeaders := make(http.Header)
  29450. for k, v := range c.header_ {
  29451. reqHeaders[k] = v
  29452. }
  29453. reqHeaders.Set("User-Agent", c.s.userAgent())
  29454. var body io.Reader = nil
  29455. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  29456. if err != nil {
  29457. return nil, err
  29458. }
  29459. reqHeaders.Set("Content-Type", "application/json")
  29460. c.urlParams_.Set("alt", alt)
  29461. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  29462. urls += "?" + c.urlParams_.Encode()
  29463. req, _ := http.NewRequest("POST", urls, body)
  29464. req.Header = reqHeaders
  29465. googleapi.Expand(req.URL, map[string]string{
  29466. "profileId": strconv.FormatInt(c.profileId, 10),
  29467. })
  29468. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29469. }
  29470. // Do executes the "dfareporting.floodlightActivityGroups.insert" call.
  29471. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  29472. // non-2xx status code is an error. Response headers are in either
  29473. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  29474. // returned at all) in error.(*googleapi.Error).Header. Use
  29475. // googleapi.IsNotModified to check whether the returned error was
  29476. // because http.StatusNotModified was returned.
  29477. func (c *FloodlightActivityGroupsInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  29478. gensupport.SetOptions(c.urlParams_, opts...)
  29479. res, err := c.doRequest("json")
  29480. if res != nil && res.StatusCode == http.StatusNotModified {
  29481. if res.Body != nil {
  29482. res.Body.Close()
  29483. }
  29484. return nil, &googleapi.Error{
  29485. Code: res.StatusCode,
  29486. Header: res.Header,
  29487. }
  29488. }
  29489. if err != nil {
  29490. return nil, err
  29491. }
  29492. defer googleapi.CloseBody(res)
  29493. if err := googleapi.CheckResponse(res); err != nil {
  29494. return nil, err
  29495. }
  29496. ret := &FloodlightActivityGroup{
  29497. ServerResponse: googleapi.ServerResponse{
  29498. Header: res.Header,
  29499. HTTPStatusCode: res.StatusCode,
  29500. },
  29501. }
  29502. target := &ret
  29503. if err := gensupport.DecodeResponse(target, res); err != nil {
  29504. return nil, err
  29505. }
  29506. return ret, nil
  29507. // {
  29508. // "description": "Inserts a new floodlight activity group.",
  29509. // "httpMethod": "POST",
  29510. // "id": "dfareporting.floodlightActivityGroups.insert",
  29511. // "parameterOrder": [
  29512. // "profileId"
  29513. // ],
  29514. // "parameters": {
  29515. // "profileId": {
  29516. // "description": "User profile ID associated with this request.",
  29517. // "format": "int64",
  29518. // "location": "path",
  29519. // "required": true,
  29520. // "type": "string"
  29521. // }
  29522. // },
  29523. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  29524. // "request": {
  29525. // "$ref": "FloodlightActivityGroup"
  29526. // },
  29527. // "response": {
  29528. // "$ref": "FloodlightActivityGroup"
  29529. // },
  29530. // "scopes": [
  29531. // "https://www.googleapis.com/auth/dfatrafficking"
  29532. // ]
  29533. // }
  29534. }
  29535. // method id "dfareporting.floodlightActivityGroups.list":
  29536. type FloodlightActivityGroupsListCall struct {
  29537. s *Service
  29538. profileId int64
  29539. urlParams_ gensupport.URLParams
  29540. ifNoneMatch_ string
  29541. ctx_ context.Context
  29542. header_ http.Header
  29543. }
  29544. // List: Retrieves a list of floodlight activity groups, possibly
  29545. // filtered. This method supports paging.
  29546. func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall {
  29547. c := &FloodlightActivityGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29548. c.profileId = profileId
  29549. return c
  29550. }
  29551. // AdvertiserId sets the optional parameter "advertiserId": Select only
  29552. // floodlight activity groups with the specified advertiser ID. Must
  29553. // specify either advertiserId or floodlightConfigurationId for a
  29554. // non-empty result.
  29555. func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall {
  29556. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  29557. return c
  29558. }
  29559. // FloodlightConfigurationId sets the optional parameter
  29560. // "floodlightConfigurationId": Select only floodlight activity groups
  29561. // with the specified floodlight configuration ID. Must specify either
  29562. // advertiserId, or floodlightConfigurationId for a non-empty result.
  29563. func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall {
  29564. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  29565. return c
  29566. }
  29567. // Ids sets the optional parameter "ids": Select only floodlight
  29568. // activity groups with the specified IDs. Must specify either
  29569. // advertiserId or floodlightConfigurationId for a non-empty result.
  29570. func (c *FloodlightActivityGroupsListCall) Ids(ids ...int64) *FloodlightActivityGroupsListCall {
  29571. var ids_ []string
  29572. for _, v := range ids {
  29573. ids_ = append(ids_, fmt.Sprint(v))
  29574. }
  29575. c.urlParams_.SetMulti("ids", ids_)
  29576. return c
  29577. }
  29578. // MaxResults sets the optional parameter "maxResults": Maximum number
  29579. // of results to return.
  29580. func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall {
  29581. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29582. return c
  29583. }
  29584. // PageToken sets the optional parameter "pageToken": Value of the
  29585. // nextPageToken from the previous result page.
  29586. func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall {
  29587. c.urlParams_.Set("pageToken", pageToken)
  29588. return c
  29589. }
  29590. // SearchString sets the optional parameter "searchString": Allows
  29591. // searching for objects by name or ID. Wildcards (*) are allowed. For
  29592. // example, "floodlightactivitygroup*2015" will return objects with
  29593. // names like "floodlightactivitygroup June 2015",
  29594. // "floodlightactivitygroup April 2015", or simply
  29595. // "floodlightactivitygroup 2015". Most of the searches also add
  29596. // wildcards implicitly at the start and the end of the search string.
  29597. // For example, a search string of "floodlightactivitygroup" will match
  29598. // objects with name "my floodlightactivitygroup activity",
  29599. // "floodlightactivitygroup 2015", or simply "floodlightactivitygroup".
  29600. func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall {
  29601. c.urlParams_.Set("searchString", searchString)
  29602. return c
  29603. }
  29604. // SortField sets the optional parameter "sortField": Field by which to
  29605. // sort the list.
  29606. //
  29607. // Possible values:
  29608. // "ID" (default)
  29609. // "NAME"
  29610. func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall {
  29611. c.urlParams_.Set("sortField", sortField)
  29612. return c
  29613. }
  29614. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  29615. // results.
  29616. //
  29617. // Possible values:
  29618. // "ASCENDING" (default)
  29619. // "DESCENDING"
  29620. func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall {
  29621. c.urlParams_.Set("sortOrder", sortOrder)
  29622. return c
  29623. }
  29624. // Type sets the optional parameter "type": Select only floodlight
  29625. // activity groups with the specified floodlight activity group type.
  29626. //
  29627. // Possible values:
  29628. // "COUNTER"
  29629. // "SALE"
  29630. func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall {
  29631. c.urlParams_.Set("type", type_)
  29632. return c
  29633. }
  29634. // Fields allows partial responses to be retrieved. See
  29635. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29636. // for more information.
  29637. func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall {
  29638. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29639. return c
  29640. }
  29641. // IfNoneMatch sets the optional parameter which makes the operation
  29642. // fail if the object's ETag matches the given value. This is useful for
  29643. // getting updates only after the object has changed since the last
  29644. // request. Use googleapi.IsNotModified to check whether the response
  29645. // error from Do is the result of In-None-Match.
  29646. func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall {
  29647. c.ifNoneMatch_ = entityTag
  29648. return c
  29649. }
  29650. // Context sets the context to be used in this call's Do method. Any
  29651. // pending HTTP request will be aborted if the provided context is
  29652. // canceled.
  29653. func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall {
  29654. c.ctx_ = ctx
  29655. return c
  29656. }
  29657. // Header returns an http.Header that can be modified by the caller to
  29658. // add HTTP headers to the request.
  29659. func (c *FloodlightActivityGroupsListCall) Header() http.Header {
  29660. if c.header_ == nil {
  29661. c.header_ = make(http.Header)
  29662. }
  29663. return c.header_
  29664. }
  29665. func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) {
  29666. reqHeaders := make(http.Header)
  29667. for k, v := range c.header_ {
  29668. reqHeaders[k] = v
  29669. }
  29670. reqHeaders.Set("User-Agent", c.s.userAgent())
  29671. if c.ifNoneMatch_ != "" {
  29672. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29673. }
  29674. var body io.Reader = nil
  29675. c.urlParams_.Set("alt", alt)
  29676. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  29677. urls += "?" + c.urlParams_.Encode()
  29678. req, _ := http.NewRequest("GET", urls, body)
  29679. req.Header = reqHeaders
  29680. googleapi.Expand(req.URL, map[string]string{
  29681. "profileId": strconv.FormatInt(c.profileId, 10),
  29682. })
  29683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29684. }
  29685. // Do executes the "dfareporting.floodlightActivityGroups.list" call.
  29686. // Exactly one of *FloodlightActivityGroupsListResponse or error will be
  29687. // non-nil. Any non-2xx status code is an error. Response headers are in
  29688. // either *FloodlightActivityGroupsListResponse.ServerResponse.Header or
  29689. // (if a response was returned at all) in
  29690. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  29691. // whether the returned error was because http.StatusNotModified was
  29692. // returned.
  29693. func (c *FloodlightActivityGroupsListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroupsListResponse, error) {
  29694. gensupport.SetOptions(c.urlParams_, opts...)
  29695. res, err := c.doRequest("json")
  29696. if res != nil && res.StatusCode == http.StatusNotModified {
  29697. if res.Body != nil {
  29698. res.Body.Close()
  29699. }
  29700. return nil, &googleapi.Error{
  29701. Code: res.StatusCode,
  29702. Header: res.Header,
  29703. }
  29704. }
  29705. if err != nil {
  29706. return nil, err
  29707. }
  29708. defer googleapi.CloseBody(res)
  29709. if err := googleapi.CheckResponse(res); err != nil {
  29710. return nil, err
  29711. }
  29712. ret := &FloodlightActivityGroupsListResponse{
  29713. ServerResponse: googleapi.ServerResponse{
  29714. Header: res.Header,
  29715. HTTPStatusCode: res.StatusCode,
  29716. },
  29717. }
  29718. target := &ret
  29719. if err := gensupport.DecodeResponse(target, res); err != nil {
  29720. return nil, err
  29721. }
  29722. return ret, nil
  29723. // {
  29724. // "description": "Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging.",
  29725. // "httpMethod": "GET",
  29726. // "id": "dfareporting.floodlightActivityGroups.list",
  29727. // "parameterOrder": [
  29728. // "profileId"
  29729. // ],
  29730. // "parameters": {
  29731. // "advertiserId": {
  29732. // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  29733. // "format": "int64",
  29734. // "location": "query",
  29735. // "type": "string"
  29736. // },
  29737. // "floodlightConfigurationId": {
  29738. // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.",
  29739. // "format": "int64",
  29740. // "location": "query",
  29741. // "type": "string"
  29742. // },
  29743. // "ids": {
  29744. // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  29745. // "format": "int64",
  29746. // "location": "query",
  29747. // "repeated": true,
  29748. // "type": "string"
  29749. // },
  29750. // "maxResults": {
  29751. // "default": "1000",
  29752. // "description": "Maximum number of results to return.",
  29753. // "format": "int32",
  29754. // "location": "query",
  29755. // "maximum": "1000",
  29756. // "minimum": "0",
  29757. // "type": "integer"
  29758. // },
  29759. // "pageToken": {
  29760. // "description": "Value of the nextPageToken from the previous result page.",
  29761. // "location": "query",
  29762. // "type": "string"
  29763. // },
  29764. // "profileId": {
  29765. // "description": "User profile ID associated with this request.",
  29766. // "format": "int64",
  29767. // "location": "path",
  29768. // "required": true,
  29769. // "type": "string"
  29770. // },
  29771. // "searchString": {
  29772. // "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\".",
  29773. // "location": "query",
  29774. // "type": "string"
  29775. // },
  29776. // "sortField": {
  29777. // "default": "ID",
  29778. // "description": "Field by which to sort the list.",
  29779. // "enum": [
  29780. // "ID",
  29781. // "NAME"
  29782. // ],
  29783. // "enumDescriptions": [
  29784. // "",
  29785. // ""
  29786. // ],
  29787. // "location": "query",
  29788. // "type": "string"
  29789. // },
  29790. // "sortOrder": {
  29791. // "default": "ASCENDING",
  29792. // "description": "Order of sorted results.",
  29793. // "enum": [
  29794. // "ASCENDING",
  29795. // "DESCENDING"
  29796. // ],
  29797. // "enumDescriptions": [
  29798. // "",
  29799. // ""
  29800. // ],
  29801. // "location": "query",
  29802. // "type": "string"
  29803. // },
  29804. // "type": {
  29805. // "description": "Select only floodlight activity groups with the specified floodlight activity group type.",
  29806. // "enum": [
  29807. // "COUNTER",
  29808. // "SALE"
  29809. // ],
  29810. // "enumDescriptions": [
  29811. // "",
  29812. // ""
  29813. // ],
  29814. // "location": "query",
  29815. // "type": "string"
  29816. // }
  29817. // },
  29818. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  29819. // "response": {
  29820. // "$ref": "FloodlightActivityGroupsListResponse"
  29821. // },
  29822. // "scopes": [
  29823. // "https://www.googleapis.com/auth/dfatrafficking"
  29824. // ]
  29825. // }
  29826. }
  29827. // Pages invokes f for each page of results.
  29828. // A non-nil error returned from f will halt the iteration.
  29829. // The provided context supersedes any context provided to the Context method.
  29830. func (c *FloodlightActivityGroupsListCall) Pages(ctx context.Context, f func(*FloodlightActivityGroupsListResponse) error) error {
  29831. c.ctx_ = ctx
  29832. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29833. for {
  29834. x, err := c.Do()
  29835. if err != nil {
  29836. return err
  29837. }
  29838. if err := f(x); err != nil {
  29839. return err
  29840. }
  29841. if x.NextPageToken == "" {
  29842. return nil
  29843. }
  29844. c.PageToken(x.NextPageToken)
  29845. }
  29846. }
  29847. // method id "dfareporting.floodlightActivityGroups.patch":
  29848. type FloodlightActivityGroupsPatchCall struct {
  29849. s *Service
  29850. profileId int64
  29851. floodlightactivitygroup *FloodlightActivityGroup
  29852. urlParams_ gensupport.URLParams
  29853. ctx_ context.Context
  29854. header_ http.Header
  29855. }
  29856. // Patch: Updates an existing floodlight activity group. This method
  29857. // supports patch semantics.
  29858. func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall {
  29859. c := &FloodlightActivityGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29860. c.profileId = profileId
  29861. c.urlParams_.Set("id", fmt.Sprint(id))
  29862. c.floodlightactivitygroup = floodlightactivitygroup
  29863. return c
  29864. }
  29865. // Fields allows partial responses to be retrieved. See
  29866. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29867. // for more information.
  29868. func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall {
  29869. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29870. return c
  29871. }
  29872. // Context sets the context to be used in this call's Do method. Any
  29873. // pending HTTP request will be aborted if the provided context is
  29874. // canceled.
  29875. func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall {
  29876. c.ctx_ = ctx
  29877. return c
  29878. }
  29879. // Header returns an http.Header that can be modified by the caller to
  29880. // add HTTP headers to the request.
  29881. func (c *FloodlightActivityGroupsPatchCall) Header() http.Header {
  29882. if c.header_ == nil {
  29883. c.header_ = make(http.Header)
  29884. }
  29885. return c.header_
  29886. }
  29887. func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  29888. reqHeaders := make(http.Header)
  29889. for k, v := range c.header_ {
  29890. reqHeaders[k] = v
  29891. }
  29892. reqHeaders.Set("User-Agent", c.s.userAgent())
  29893. var body io.Reader = nil
  29894. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  29895. if err != nil {
  29896. return nil, err
  29897. }
  29898. reqHeaders.Set("Content-Type", "application/json")
  29899. c.urlParams_.Set("alt", alt)
  29900. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  29901. urls += "?" + c.urlParams_.Encode()
  29902. req, _ := http.NewRequest("PATCH", urls, body)
  29903. req.Header = reqHeaders
  29904. googleapi.Expand(req.URL, map[string]string{
  29905. "profileId": strconv.FormatInt(c.profileId, 10),
  29906. })
  29907. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29908. }
  29909. // Do executes the "dfareporting.floodlightActivityGroups.patch" call.
  29910. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  29911. // non-2xx status code is an error. Response headers are in either
  29912. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  29913. // returned at all) in error.(*googleapi.Error).Header. Use
  29914. // googleapi.IsNotModified to check whether the returned error was
  29915. // because http.StatusNotModified was returned.
  29916. func (c *FloodlightActivityGroupsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  29917. gensupport.SetOptions(c.urlParams_, opts...)
  29918. res, err := c.doRequest("json")
  29919. if res != nil && res.StatusCode == http.StatusNotModified {
  29920. if res.Body != nil {
  29921. res.Body.Close()
  29922. }
  29923. return nil, &googleapi.Error{
  29924. Code: res.StatusCode,
  29925. Header: res.Header,
  29926. }
  29927. }
  29928. if err != nil {
  29929. return nil, err
  29930. }
  29931. defer googleapi.CloseBody(res)
  29932. if err := googleapi.CheckResponse(res); err != nil {
  29933. return nil, err
  29934. }
  29935. ret := &FloodlightActivityGroup{
  29936. ServerResponse: googleapi.ServerResponse{
  29937. Header: res.Header,
  29938. HTTPStatusCode: res.StatusCode,
  29939. },
  29940. }
  29941. target := &ret
  29942. if err := gensupport.DecodeResponse(target, res); err != nil {
  29943. return nil, err
  29944. }
  29945. return ret, nil
  29946. // {
  29947. // "description": "Updates an existing floodlight activity group. This method supports patch semantics.",
  29948. // "httpMethod": "PATCH",
  29949. // "id": "dfareporting.floodlightActivityGroups.patch",
  29950. // "parameterOrder": [
  29951. // "profileId",
  29952. // "id"
  29953. // ],
  29954. // "parameters": {
  29955. // "id": {
  29956. // "description": "Floodlight activity Group ID.",
  29957. // "format": "int64",
  29958. // "location": "query",
  29959. // "required": true,
  29960. // "type": "string"
  29961. // },
  29962. // "profileId": {
  29963. // "description": "User profile ID associated with this request.",
  29964. // "format": "int64",
  29965. // "location": "path",
  29966. // "required": true,
  29967. // "type": "string"
  29968. // }
  29969. // },
  29970. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  29971. // "request": {
  29972. // "$ref": "FloodlightActivityGroup"
  29973. // },
  29974. // "response": {
  29975. // "$ref": "FloodlightActivityGroup"
  29976. // },
  29977. // "scopes": [
  29978. // "https://www.googleapis.com/auth/dfatrafficking"
  29979. // ]
  29980. // }
  29981. }
  29982. // method id "dfareporting.floodlightActivityGroups.update":
  29983. type FloodlightActivityGroupsUpdateCall struct {
  29984. s *Service
  29985. profileId int64
  29986. floodlightactivitygroup *FloodlightActivityGroup
  29987. urlParams_ gensupport.URLParams
  29988. ctx_ context.Context
  29989. header_ http.Header
  29990. }
  29991. // Update: Updates an existing floodlight activity group.
  29992. func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall {
  29993. c := &FloodlightActivityGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29994. c.profileId = profileId
  29995. c.floodlightactivitygroup = floodlightactivitygroup
  29996. return c
  29997. }
  29998. // Fields allows partial responses to be retrieved. See
  29999. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30000. // for more information.
  30001. func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall {
  30002. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30003. return c
  30004. }
  30005. // Context sets the context to be used in this call's Do method. Any
  30006. // pending HTTP request will be aborted if the provided context is
  30007. // canceled.
  30008. func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall {
  30009. c.ctx_ = ctx
  30010. return c
  30011. }
  30012. // Header returns an http.Header that can be modified by the caller to
  30013. // add HTTP headers to the request.
  30014. func (c *FloodlightActivityGroupsUpdateCall) Header() http.Header {
  30015. if c.header_ == nil {
  30016. c.header_ = make(http.Header)
  30017. }
  30018. return c.header_
  30019. }
  30020. func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30021. reqHeaders := make(http.Header)
  30022. for k, v := range c.header_ {
  30023. reqHeaders[k] = v
  30024. }
  30025. reqHeaders.Set("User-Agent", c.s.userAgent())
  30026. var body io.Reader = nil
  30027. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  30028. if err != nil {
  30029. return nil, err
  30030. }
  30031. reqHeaders.Set("Content-Type", "application/json")
  30032. c.urlParams_.Set("alt", alt)
  30033. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  30034. urls += "?" + c.urlParams_.Encode()
  30035. req, _ := http.NewRequest("PUT", urls, body)
  30036. req.Header = reqHeaders
  30037. googleapi.Expand(req.URL, map[string]string{
  30038. "profileId": strconv.FormatInt(c.profileId, 10),
  30039. })
  30040. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30041. }
  30042. // Do executes the "dfareporting.floodlightActivityGroups.update" call.
  30043. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  30044. // non-2xx status code is an error. Response headers are in either
  30045. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  30046. // returned at all) in error.(*googleapi.Error).Header. Use
  30047. // googleapi.IsNotModified to check whether the returned error was
  30048. // because http.StatusNotModified was returned.
  30049. func (c *FloodlightActivityGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  30050. gensupport.SetOptions(c.urlParams_, opts...)
  30051. res, err := c.doRequest("json")
  30052. if res != nil && res.StatusCode == http.StatusNotModified {
  30053. if res.Body != nil {
  30054. res.Body.Close()
  30055. }
  30056. return nil, &googleapi.Error{
  30057. Code: res.StatusCode,
  30058. Header: res.Header,
  30059. }
  30060. }
  30061. if err != nil {
  30062. return nil, err
  30063. }
  30064. defer googleapi.CloseBody(res)
  30065. if err := googleapi.CheckResponse(res); err != nil {
  30066. return nil, err
  30067. }
  30068. ret := &FloodlightActivityGroup{
  30069. ServerResponse: googleapi.ServerResponse{
  30070. Header: res.Header,
  30071. HTTPStatusCode: res.StatusCode,
  30072. },
  30073. }
  30074. target := &ret
  30075. if err := gensupport.DecodeResponse(target, res); err != nil {
  30076. return nil, err
  30077. }
  30078. return ret, nil
  30079. // {
  30080. // "description": "Updates an existing floodlight activity group.",
  30081. // "httpMethod": "PUT",
  30082. // "id": "dfareporting.floodlightActivityGroups.update",
  30083. // "parameterOrder": [
  30084. // "profileId"
  30085. // ],
  30086. // "parameters": {
  30087. // "profileId": {
  30088. // "description": "User profile ID associated with this request.",
  30089. // "format": "int64",
  30090. // "location": "path",
  30091. // "required": true,
  30092. // "type": "string"
  30093. // }
  30094. // },
  30095. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  30096. // "request": {
  30097. // "$ref": "FloodlightActivityGroup"
  30098. // },
  30099. // "response": {
  30100. // "$ref": "FloodlightActivityGroup"
  30101. // },
  30102. // "scopes": [
  30103. // "https://www.googleapis.com/auth/dfatrafficking"
  30104. // ]
  30105. // }
  30106. }
  30107. // method id "dfareporting.floodlightConfigurations.get":
  30108. type FloodlightConfigurationsGetCall struct {
  30109. s *Service
  30110. profileId int64
  30111. id int64
  30112. urlParams_ gensupport.URLParams
  30113. ifNoneMatch_ string
  30114. ctx_ context.Context
  30115. header_ http.Header
  30116. }
  30117. // Get: Gets one floodlight configuration by ID.
  30118. func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall {
  30119. c := &FloodlightConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30120. c.profileId = profileId
  30121. c.id = id
  30122. return c
  30123. }
  30124. // Fields allows partial responses to be retrieved. See
  30125. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30126. // for more information.
  30127. func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall {
  30128. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30129. return c
  30130. }
  30131. // IfNoneMatch sets the optional parameter which makes the operation
  30132. // fail if the object's ETag matches the given value. This is useful for
  30133. // getting updates only after the object has changed since the last
  30134. // request. Use googleapi.IsNotModified to check whether the response
  30135. // error from Do is the result of In-None-Match.
  30136. func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall {
  30137. c.ifNoneMatch_ = entityTag
  30138. return c
  30139. }
  30140. // Context sets the context to be used in this call's Do method. Any
  30141. // pending HTTP request will be aborted if the provided context is
  30142. // canceled.
  30143. func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall {
  30144. c.ctx_ = ctx
  30145. return c
  30146. }
  30147. // Header returns an http.Header that can be modified by the caller to
  30148. // add HTTP headers to the request.
  30149. func (c *FloodlightConfigurationsGetCall) Header() http.Header {
  30150. if c.header_ == nil {
  30151. c.header_ = make(http.Header)
  30152. }
  30153. return c.header_
  30154. }
  30155. func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  30156. reqHeaders := make(http.Header)
  30157. for k, v := range c.header_ {
  30158. reqHeaders[k] = v
  30159. }
  30160. reqHeaders.Set("User-Agent", c.s.userAgent())
  30161. if c.ifNoneMatch_ != "" {
  30162. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30163. }
  30164. var body io.Reader = nil
  30165. c.urlParams_.Set("alt", alt)
  30166. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}")
  30167. urls += "?" + c.urlParams_.Encode()
  30168. req, _ := http.NewRequest("GET", urls, body)
  30169. req.Header = reqHeaders
  30170. googleapi.Expand(req.URL, map[string]string{
  30171. "profileId": strconv.FormatInt(c.profileId, 10),
  30172. "id": strconv.FormatInt(c.id, 10),
  30173. })
  30174. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30175. }
  30176. // Do executes the "dfareporting.floodlightConfigurations.get" call.
  30177. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30178. // non-2xx status code is an error. Response headers are in either
  30179. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30180. // returned at all) in error.(*googleapi.Error).Header. Use
  30181. // googleapi.IsNotModified to check whether the returned error was
  30182. // because http.StatusNotModified was returned.
  30183. func (c *FloodlightConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30184. gensupport.SetOptions(c.urlParams_, opts...)
  30185. res, err := c.doRequest("json")
  30186. if res != nil && res.StatusCode == http.StatusNotModified {
  30187. if res.Body != nil {
  30188. res.Body.Close()
  30189. }
  30190. return nil, &googleapi.Error{
  30191. Code: res.StatusCode,
  30192. Header: res.Header,
  30193. }
  30194. }
  30195. if err != nil {
  30196. return nil, err
  30197. }
  30198. defer googleapi.CloseBody(res)
  30199. if err := googleapi.CheckResponse(res); err != nil {
  30200. return nil, err
  30201. }
  30202. ret := &FloodlightConfiguration{
  30203. ServerResponse: googleapi.ServerResponse{
  30204. Header: res.Header,
  30205. HTTPStatusCode: res.StatusCode,
  30206. },
  30207. }
  30208. target := &ret
  30209. if err := gensupport.DecodeResponse(target, res); err != nil {
  30210. return nil, err
  30211. }
  30212. return ret, nil
  30213. // {
  30214. // "description": "Gets one floodlight configuration by ID.",
  30215. // "httpMethod": "GET",
  30216. // "id": "dfareporting.floodlightConfigurations.get",
  30217. // "parameterOrder": [
  30218. // "profileId",
  30219. // "id"
  30220. // ],
  30221. // "parameters": {
  30222. // "id": {
  30223. // "description": "Floodlight configuration ID.",
  30224. // "format": "int64",
  30225. // "location": "path",
  30226. // "required": true,
  30227. // "type": "string"
  30228. // },
  30229. // "profileId": {
  30230. // "description": "User profile ID associated with this request.",
  30231. // "format": "int64",
  30232. // "location": "path",
  30233. // "required": true,
  30234. // "type": "string"
  30235. // }
  30236. // },
  30237. // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}",
  30238. // "response": {
  30239. // "$ref": "FloodlightConfiguration"
  30240. // },
  30241. // "scopes": [
  30242. // "https://www.googleapis.com/auth/dfatrafficking"
  30243. // ]
  30244. // }
  30245. }
  30246. // method id "dfareporting.floodlightConfigurations.list":
  30247. type FloodlightConfigurationsListCall struct {
  30248. s *Service
  30249. profileId int64
  30250. urlParams_ gensupport.URLParams
  30251. ifNoneMatch_ string
  30252. ctx_ context.Context
  30253. header_ http.Header
  30254. }
  30255. // List: Retrieves a list of floodlight configurations, possibly
  30256. // filtered.
  30257. func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall {
  30258. c := &FloodlightConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30259. c.profileId = profileId
  30260. return c
  30261. }
  30262. // Ids sets the optional parameter "ids": Set of IDs of floodlight
  30263. // configurations to retrieve. Required field; otherwise an empty list
  30264. // will be returned.
  30265. func (c *FloodlightConfigurationsListCall) Ids(ids ...int64) *FloodlightConfigurationsListCall {
  30266. var ids_ []string
  30267. for _, v := range ids {
  30268. ids_ = append(ids_, fmt.Sprint(v))
  30269. }
  30270. c.urlParams_.SetMulti("ids", ids_)
  30271. return c
  30272. }
  30273. // Fields allows partial responses to be retrieved. See
  30274. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30275. // for more information.
  30276. func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall {
  30277. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30278. return c
  30279. }
  30280. // IfNoneMatch sets the optional parameter which makes the operation
  30281. // fail if the object's ETag matches the given value. This is useful for
  30282. // getting updates only after the object has changed since the last
  30283. // request. Use googleapi.IsNotModified to check whether the response
  30284. // error from Do is the result of In-None-Match.
  30285. func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall {
  30286. c.ifNoneMatch_ = entityTag
  30287. return c
  30288. }
  30289. // Context sets the context to be used in this call's Do method. Any
  30290. // pending HTTP request will be aborted if the provided context is
  30291. // canceled.
  30292. func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall {
  30293. c.ctx_ = ctx
  30294. return c
  30295. }
  30296. // Header returns an http.Header that can be modified by the caller to
  30297. // add HTTP headers to the request.
  30298. func (c *FloodlightConfigurationsListCall) Header() http.Header {
  30299. if c.header_ == nil {
  30300. c.header_ = make(http.Header)
  30301. }
  30302. return c.header_
  30303. }
  30304. func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  30305. reqHeaders := make(http.Header)
  30306. for k, v := range c.header_ {
  30307. reqHeaders[k] = v
  30308. }
  30309. reqHeaders.Set("User-Agent", c.s.userAgent())
  30310. if c.ifNoneMatch_ != "" {
  30311. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30312. }
  30313. var body io.Reader = nil
  30314. c.urlParams_.Set("alt", alt)
  30315. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30316. urls += "?" + c.urlParams_.Encode()
  30317. req, _ := http.NewRequest("GET", urls, body)
  30318. req.Header = reqHeaders
  30319. googleapi.Expand(req.URL, map[string]string{
  30320. "profileId": strconv.FormatInt(c.profileId, 10),
  30321. })
  30322. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30323. }
  30324. // Do executes the "dfareporting.floodlightConfigurations.list" call.
  30325. // Exactly one of *FloodlightConfigurationsListResponse or error will be
  30326. // non-nil. Any non-2xx status code is an error. Response headers are in
  30327. // either *FloodlightConfigurationsListResponse.ServerResponse.Header or
  30328. // (if a response was returned at all) in
  30329. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  30330. // whether the returned error was because http.StatusNotModified was
  30331. // returned.
  30332. func (c *FloodlightConfigurationsListCall) Do(opts ...googleapi.CallOption) (*FloodlightConfigurationsListResponse, error) {
  30333. gensupport.SetOptions(c.urlParams_, opts...)
  30334. res, err := c.doRequest("json")
  30335. if res != nil && res.StatusCode == http.StatusNotModified {
  30336. if res.Body != nil {
  30337. res.Body.Close()
  30338. }
  30339. return nil, &googleapi.Error{
  30340. Code: res.StatusCode,
  30341. Header: res.Header,
  30342. }
  30343. }
  30344. if err != nil {
  30345. return nil, err
  30346. }
  30347. defer googleapi.CloseBody(res)
  30348. if err := googleapi.CheckResponse(res); err != nil {
  30349. return nil, err
  30350. }
  30351. ret := &FloodlightConfigurationsListResponse{
  30352. ServerResponse: googleapi.ServerResponse{
  30353. Header: res.Header,
  30354. HTTPStatusCode: res.StatusCode,
  30355. },
  30356. }
  30357. target := &ret
  30358. if err := gensupport.DecodeResponse(target, res); err != nil {
  30359. return nil, err
  30360. }
  30361. return ret, nil
  30362. // {
  30363. // "description": "Retrieves a list of floodlight configurations, possibly filtered.",
  30364. // "httpMethod": "GET",
  30365. // "id": "dfareporting.floodlightConfigurations.list",
  30366. // "parameterOrder": [
  30367. // "profileId"
  30368. // ],
  30369. // "parameters": {
  30370. // "ids": {
  30371. // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.",
  30372. // "format": "int64",
  30373. // "location": "query",
  30374. // "repeated": true,
  30375. // "type": "string"
  30376. // },
  30377. // "profileId": {
  30378. // "description": "User profile ID associated with this request.",
  30379. // "format": "int64",
  30380. // "location": "path",
  30381. // "required": true,
  30382. // "type": "string"
  30383. // }
  30384. // },
  30385. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30386. // "response": {
  30387. // "$ref": "FloodlightConfigurationsListResponse"
  30388. // },
  30389. // "scopes": [
  30390. // "https://www.googleapis.com/auth/dfatrafficking"
  30391. // ]
  30392. // }
  30393. }
  30394. // method id "dfareporting.floodlightConfigurations.patch":
  30395. type FloodlightConfigurationsPatchCall struct {
  30396. s *Service
  30397. profileId int64
  30398. floodlightconfiguration *FloodlightConfiguration
  30399. urlParams_ gensupport.URLParams
  30400. ctx_ context.Context
  30401. header_ http.Header
  30402. }
  30403. // Patch: Updates an existing floodlight configuration. This method
  30404. // supports patch semantics.
  30405. func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall {
  30406. c := &FloodlightConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30407. c.profileId = profileId
  30408. c.urlParams_.Set("id", fmt.Sprint(id))
  30409. c.floodlightconfiguration = floodlightconfiguration
  30410. return c
  30411. }
  30412. // Fields allows partial responses to be retrieved. See
  30413. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30414. // for more information.
  30415. func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall {
  30416. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30417. return c
  30418. }
  30419. // Context sets the context to be used in this call's Do method. Any
  30420. // pending HTTP request will be aborted if the provided context is
  30421. // canceled.
  30422. func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall {
  30423. c.ctx_ = ctx
  30424. return c
  30425. }
  30426. // Header returns an http.Header that can be modified by the caller to
  30427. // add HTTP headers to the request.
  30428. func (c *FloodlightConfigurationsPatchCall) Header() http.Header {
  30429. if c.header_ == nil {
  30430. c.header_ = make(http.Header)
  30431. }
  30432. return c.header_
  30433. }
  30434. func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  30435. reqHeaders := make(http.Header)
  30436. for k, v := range c.header_ {
  30437. reqHeaders[k] = v
  30438. }
  30439. reqHeaders.Set("User-Agent", c.s.userAgent())
  30440. var body io.Reader = nil
  30441. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  30442. if err != nil {
  30443. return nil, err
  30444. }
  30445. reqHeaders.Set("Content-Type", "application/json")
  30446. c.urlParams_.Set("alt", alt)
  30447. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30448. urls += "?" + c.urlParams_.Encode()
  30449. req, _ := http.NewRequest("PATCH", urls, body)
  30450. req.Header = reqHeaders
  30451. googleapi.Expand(req.URL, map[string]string{
  30452. "profileId": strconv.FormatInt(c.profileId, 10),
  30453. })
  30454. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30455. }
  30456. // Do executes the "dfareporting.floodlightConfigurations.patch" call.
  30457. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30458. // non-2xx status code is an error. Response headers are in either
  30459. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30460. // returned at all) in error.(*googleapi.Error).Header. Use
  30461. // googleapi.IsNotModified to check whether the returned error was
  30462. // because http.StatusNotModified was returned.
  30463. func (c *FloodlightConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30464. gensupport.SetOptions(c.urlParams_, opts...)
  30465. res, err := c.doRequest("json")
  30466. if res != nil && res.StatusCode == http.StatusNotModified {
  30467. if res.Body != nil {
  30468. res.Body.Close()
  30469. }
  30470. return nil, &googleapi.Error{
  30471. Code: res.StatusCode,
  30472. Header: res.Header,
  30473. }
  30474. }
  30475. if err != nil {
  30476. return nil, err
  30477. }
  30478. defer googleapi.CloseBody(res)
  30479. if err := googleapi.CheckResponse(res); err != nil {
  30480. return nil, err
  30481. }
  30482. ret := &FloodlightConfiguration{
  30483. ServerResponse: googleapi.ServerResponse{
  30484. Header: res.Header,
  30485. HTTPStatusCode: res.StatusCode,
  30486. },
  30487. }
  30488. target := &ret
  30489. if err := gensupport.DecodeResponse(target, res); err != nil {
  30490. return nil, err
  30491. }
  30492. return ret, nil
  30493. // {
  30494. // "description": "Updates an existing floodlight configuration. This method supports patch semantics.",
  30495. // "httpMethod": "PATCH",
  30496. // "id": "dfareporting.floodlightConfigurations.patch",
  30497. // "parameterOrder": [
  30498. // "profileId",
  30499. // "id"
  30500. // ],
  30501. // "parameters": {
  30502. // "id": {
  30503. // "description": "Floodlight configuration ID.",
  30504. // "format": "int64",
  30505. // "location": "query",
  30506. // "required": true,
  30507. // "type": "string"
  30508. // },
  30509. // "profileId": {
  30510. // "description": "User profile ID associated with this request.",
  30511. // "format": "int64",
  30512. // "location": "path",
  30513. // "required": true,
  30514. // "type": "string"
  30515. // }
  30516. // },
  30517. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30518. // "request": {
  30519. // "$ref": "FloodlightConfiguration"
  30520. // },
  30521. // "response": {
  30522. // "$ref": "FloodlightConfiguration"
  30523. // },
  30524. // "scopes": [
  30525. // "https://www.googleapis.com/auth/dfatrafficking"
  30526. // ]
  30527. // }
  30528. }
  30529. // method id "dfareporting.floodlightConfigurations.update":
  30530. type FloodlightConfigurationsUpdateCall struct {
  30531. s *Service
  30532. profileId int64
  30533. floodlightconfiguration *FloodlightConfiguration
  30534. urlParams_ gensupport.URLParams
  30535. ctx_ context.Context
  30536. header_ http.Header
  30537. }
  30538. // Update: Updates an existing floodlight configuration.
  30539. func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall {
  30540. c := &FloodlightConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30541. c.profileId = profileId
  30542. c.floodlightconfiguration = floodlightconfiguration
  30543. return c
  30544. }
  30545. // Fields allows partial responses to be retrieved. See
  30546. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30547. // for more information.
  30548. func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall {
  30549. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30550. return c
  30551. }
  30552. // Context sets the context to be used in this call's Do method. Any
  30553. // pending HTTP request will be aborted if the provided context is
  30554. // canceled.
  30555. func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall {
  30556. c.ctx_ = ctx
  30557. return c
  30558. }
  30559. // Header returns an http.Header that can be modified by the caller to
  30560. // add HTTP headers to the request.
  30561. func (c *FloodlightConfigurationsUpdateCall) Header() http.Header {
  30562. if c.header_ == nil {
  30563. c.header_ = make(http.Header)
  30564. }
  30565. return c.header_
  30566. }
  30567. func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  30568. reqHeaders := make(http.Header)
  30569. for k, v := range c.header_ {
  30570. reqHeaders[k] = v
  30571. }
  30572. reqHeaders.Set("User-Agent", c.s.userAgent())
  30573. var body io.Reader = nil
  30574. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  30575. if err != nil {
  30576. return nil, err
  30577. }
  30578. reqHeaders.Set("Content-Type", "application/json")
  30579. c.urlParams_.Set("alt", alt)
  30580. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  30581. urls += "?" + c.urlParams_.Encode()
  30582. req, _ := http.NewRequest("PUT", urls, body)
  30583. req.Header = reqHeaders
  30584. googleapi.Expand(req.URL, map[string]string{
  30585. "profileId": strconv.FormatInt(c.profileId, 10),
  30586. })
  30587. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30588. }
  30589. // Do executes the "dfareporting.floodlightConfigurations.update" call.
  30590. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  30591. // non-2xx status code is an error. Response headers are in either
  30592. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  30593. // returned at all) in error.(*googleapi.Error).Header. Use
  30594. // googleapi.IsNotModified to check whether the returned error was
  30595. // because http.StatusNotModified was returned.
  30596. func (c *FloodlightConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  30597. gensupport.SetOptions(c.urlParams_, opts...)
  30598. res, err := c.doRequest("json")
  30599. if res != nil && res.StatusCode == http.StatusNotModified {
  30600. if res.Body != nil {
  30601. res.Body.Close()
  30602. }
  30603. return nil, &googleapi.Error{
  30604. Code: res.StatusCode,
  30605. Header: res.Header,
  30606. }
  30607. }
  30608. if err != nil {
  30609. return nil, err
  30610. }
  30611. defer googleapi.CloseBody(res)
  30612. if err := googleapi.CheckResponse(res); err != nil {
  30613. return nil, err
  30614. }
  30615. ret := &FloodlightConfiguration{
  30616. ServerResponse: googleapi.ServerResponse{
  30617. Header: res.Header,
  30618. HTTPStatusCode: res.StatusCode,
  30619. },
  30620. }
  30621. target := &ret
  30622. if err := gensupport.DecodeResponse(target, res); err != nil {
  30623. return nil, err
  30624. }
  30625. return ret, nil
  30626. // {
  30627. // "description": "Updates an existing floodlight configuration.",
  30628. // "httpMethod": "PUT",
  30629. // "id": "dfareporting.floodlightConfigurations.update",
  30630. // "parameterOrder": [
  30631. // "profileId"
  30632. // ],
  30633. // "parameters": {
  30634. // "profileId": {
  30635. // "description": "User profile ID associated with this request.",
  30636. // "format": "int64",
  30637. // "location": "path",
  30638. // "required": true,
  30639. // "type": "string"
  30640. // }
  30641. // },
  30642. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  30643. // "request": {
  30644. // "$ref": "FloodlightConfiguration"
  30645. // },
  30646. // "response": {
  30647. // "$ref": "FloodlightConfiguration"
  30648. // },
  30649. // "scopes": [
  30650. // "https://www.googleapis.com/auth/dfatrafficking"
  30651. // ]
  30652. // }
  30653. }
  30654. // method id "dfareporting.inventoryItems.get":
  30655. type InventoryItemsGetCall struct {
  30656. s *Service
  30657. profileId int64
  30658. projectId int64
  30659. id int64
  30660. urlParams_ gensupport.URLParams
  30661. ifNoneMatch_ string
  30662. ctx_ context.Context
  30663. header_ http.Header
  30664. }
  30665. // Get: Gets one inventory item by ID.
  30666. func (r *InventoryItemsService) Get(profileId int64, projectId int64, id int64) *InventoryItemsGetCall {
  30667. c := &InventoryItemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30668. c.profileId = profileId
  30669. c.projectId = projectId
  30670. c.id = id
  30671. return c
  30672. }
  30673. // Fields allows partial responses to be retrieved. See
  30674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30675. // for more information.
  30676. func (c *InventoryItemsGetCall) Fields(s ...googleapi.Field) *InventoryItemsGetCall {
  30677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30678. return c
  30679. }
  30680. // IfNoneMatch sets the optional parameter which makes the operation
  30681. // fail if the object's ETag matches the given value. This is useful for
  30682. // getting updates only after the object has changed since the last
  30683. // request. Use googleapi.IsNotModified to check whether the response
  30684. // error from Do is the result of In-None-Match.
  30685. func (c *InventoryItemsGetCall) IfNoneMatch(entityTag string) *InventoryItemsGetCall {
  30686. c.ifNoneMatch_ = entityTag
  30687. return c
  30688. }
  30689. // Context sets the context to be used in this call's Do method. Any
  30690. // pending HTTP request will be aborted if the provided context is
  30691. // canceled.
  30692. func (c *InventoryItemsGetCall) Context(ctx context.Context) *InventoryItemsGetCall {
  30693. c.ctx_ = ctx
  30694. return c
  30695. }
  30696. // Header returns an http.Header that can be modified by the caller to
  30697. // add HTTP headers to the request.
  30698. func (c *InventoryItemsGetCall) Header() http.Header {
  30699. if c.header_ == nil {
  30700. c.header_ = make(http.Header)
  30701. }
  30702. return c.header_
  30703. }
  30704. func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) {
  30705. reqHeaders := make(http.Header)
  30706. for k, v := range c.header_ {
  30707. reqHeaders[k] = v
  30708. }
  30709. reqHeaders.Set("User-Agent", c.s.userAgent())
  30710. if c.ifNoneMatch_ != "" {
  30711. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30712. }
  30713. var body io.Reader = nil
  30714. c.urlParams_.Set("alt", alt)
  30715. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}")
  30716. urls += "?" + c.urlParams_.Encode()
  30717. req, _ := http.NewRequest("GET", urls, body)
  30718. req.Header = reqHeaders
  30719. googleapi.Expand(req.URL, map[string]string{
  30720. "profileId": strconv.FormatInt(c.profileId, 10),
  30721. "projectId": strconv.FormatInt(c.projectId, 10),
  30722. "id": strconv.FormatInt(c.id, 10),
  30723. })
  30724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30725. }
  30726. // Do executes the "dfareporting.inventoryItems.get" call.
  30727. // Exactly one of *InventoryItem or error will be non-nil. Any non-2xx
  30728. // status code is an error. Response headers are in either
  30729. // *InventoryItem.ServerResponse.Header or (if a response was returned
  30730. // at all) in error.(*googleapi.Error).Header. Use
  30731. // googleapi.IsNotModified to check whether the returned error was
  30732. // because http.StatusNotModified was returned.
  30733. func (c *InventoryItemsGetCall) Do(opts ...googleapi.CallOption) (*InventoryItem, error) {
  30734. gensupport.SetOptions(c.urlParams_, opts...)
  30735. res, err := c.doRequest("json")
  30736. if res != nil && res.StatusCode == http.StatusNotModified {
  30737. if res.Body != nil {
  30738. res.Body.Close()
  30739. }
  30740. return nil, &googleapi.Error{
  30741. Code: res.StatusCode,
  30742. Header: res.Header,
  30743. }
  30744. }
  30745. if err != nil {
  30746. return nil, err
  30747. }
  30748. defer googleapi.CloseBody(res)
  30749. if err := googleapi.CheckResponse(res); err != nil {
  30750. return nil, err
  30751. }
  30752. ret := &InventoryItem{
  30753. ServerResponse: googleapi.ServerResponse{
  30754. Header: res.Header,
  30755. HTTPStatusCode: res.StatusCode,
  30756. },
  30757. }
  30758. target := &ret
  30759. if err := gensupport.DecodeResponse(target, res); err != nil {
  30760. return nil, err
  30761. }
  30762. return ret, nil
  30763. // {
  30764. // "description": "Gets one inventory item by ID.",
  30765. // "httpMethod": "GET",
  30766. // "id": "dfareporting.inventoryItems.get",
  30767. // "parameterOrder": [
  30768. // "profileId",
  30769. // "projectId",
  30770. // "id"
  30771. // ],
  30772. // "parameters": {
  30773. // "id": {
  30774. // "description": "Inventory item ID.",
  30775. // "format": "int64",
  30776. // "location": "path",
  30777. // "required": true,
  30778. // "type": "string"
  30779. // },
  30780. // "profileId": {
  30781. // "description": "User profile ID associated with this request.",
  30782. // "format": "int64",
  30783. // "location": "path",
  30784. // "required": true,
  30785. // "type": "string"
  30786. // },
  30787. // "projectId": {
  30788. // "description": "Project ID for order documents.",
  30789. // "format": "int64",
  30790. // "location": "path",
  30791. // "required": true,
  30792. // "type": "string"
  30793. // }
  30794. // },
  30795. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}",
  30796. // "response": {
  30797. // "$ref": "InventoryItem"
  30798. // },
  30799. // "scopes": [
  30800. // "https://www.googleapis.com/auth/dfatrafficking"
  30801. // ]
  30802. // }
  30803. }
  30804. // method id "dfareporting.inventoryItems.list":
  30805. type InventoryItemsListCall struct {
  30806. s *Service
  30807. profileId int64
  30808. projectId int64
  30809. urlParams_ gensupport.URLParams
  30810. ifNoneMatch_ string
  30811. ctx_ context.Context
  30812. header_ http.Header
  30813. }
  30814. // List: Retrieves a list of inventory items, possibly filtered. This
  30815. // method supports paging.
  30816. func (r *InventoryItemsService) List(profileId int64, projectId int64) *InventoryItemsListCall {
  30817. c := &InventoryItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30818. c.profileId = profileId
  30819. c.projectId = projectId
  30820. return c
  30821. }
  30822. // Ids sets the optional parameter "ids": Select only inventory items
  30823. // with these IDs.
  30824. func (c *InventoryItemsListCall) Ids(ids ...int64) *InventoryItemsListCall {
  30825. var ids_ []string
  30826. for _, v := range ids {
  30827. ids_ = append(ids_, fmt.Sprint(v))
  30828. }
  30829. c.urlParams_.SetMulti("ids", ids_)
  30830. return c
  30831. }
  30832. // InPlan sets the optional parameter "inPlan": Select only inventory
  30833. // items that are in plan.
  30834. func (c *InventoryItemsListCall) InPlan(inPlan bool) *InventoryItemsListCall {
  30835. c.urlParams_.Set("inPlan", fmt.Sprint(inPlan))
  30836. return c
  30837. }
  30838. // MaxResults sets the optional parameter "maxResults": Maximum number
  30839. // of results to return.
  30840. func (c *InventoryItemsListCall) MaxResults(maxResults int64) *InventoryItemsListCall {
  30841. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  30842. return c
  30843. }
  30844. // OrderId sets the optional parameter "orderId": Select only inventory
  30845. // items that belong to specified orders.
  30846. func (c *InventoryItemsListCall) OrderId(orderId ...int64) *InventoryItemsListCall {
  30847. var orderId_ []string
  30848. for _, v := range orderId {
  30849. orderId_ = append(orderId_, fmt.Sprint(v))
  30850. }
  30851. c.urlParams_.SetMulti("orderId", orderId_)
  30852. return c
  30853. }
  30854. // PageToken sets the optional parameter "pageToken": Value of the
  30855. // nextPageToken from the previous result page.
  30856. func (c *InventoryItemsListCall) PageToken(pageToken string) *InventoryItemsListCall {
  30857. c.urlParams_.Set("pageToken", pageToken)
  30858. return c
  30859. }
  30860. // SiteId sets the optional parameter "siteId": Select only inventory
  30861. // items that are associated with these sites.
  30862. func (c *InventoryItemsListCall) SiteId(siteId ...int64) *InventoryItemsListCall {
  30863. var siteId_ []string
  30864. for _, v := range siteId {
  30865. siteId_ = append(siteId_, fmt.Sprint(v))
  30866. }
  30867. c.urlParams_.SetMulti("siteId", siteId_)
  30868. return c
  30869. }
  30870. // SortField sets the optional parameter "sortField": Field by which to
  30871. // sort the list.
  30872. //
  30873. // Possible values:
  30874. // "ID" (default)
  30875. // "NAME"
  30876. func (c *InventoryItemsListCall) SortField(sortField string) *InventoryItemsListCall {
  30877. c.urlParams_.Set("sortField", sortField)
  30878. return c
  30879. }
  30880. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  30881. // results.
  30882. //
  30883. // Possible values:
  30884. // "ASCENDING" (default)
  30885. // "DESCENDING"
  30886. func (c *InventoryItemsListCall) SortOrder(sortOrder string) *InventoryItemsListCall {
  30887. c.urlParams_.Set("sortOrder", sortOrder)
  30888. return c
  30889. }
  30890. // Type sets the optional parameter "type": Select only inventory items
  30891. // with this type.
  30892. //
  30893. // Possible values:
  30894. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  30895. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  30896. func (c *InventoryItemsListCall) Type(type_ string) *InventoryItemsListCall {
  30897. c.urlParams_.Set("type", type_)
  30898. return c
  30899. }
  30900. // Fields allows partial responses to be retrieved. See
  30901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30902. // for more information.
  30903. func (c *InventoryItemsListCall) Fields(s ...googleapi.Field) *InventoryItemsListCall {
  30904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30905. return c
  30906. }
  30907. // IfNoneMatch sets the optional parameter which makes the operation
  30908. // fail if the object's ETag matches the given value. This is useful for
  30909. // getting updates only after the object has changed since the last
  30910. // request. Use googleapi.IsNotModified to check whether the response
  30911. // error from Do is the result of In-None-Match.
  30912. func (c *InventoryItemsListCall) IfNoneMatch(entityTag string) *InventoryItemsListCall {
  30913. c.ifNoneMatch_ = entityTag
  30914. return c
  30915. }
  30916. // Context sets the context to be used in this call's Do method. Any
  30917. // pending HTTP request will be aborted if the provided context is
  30918. // canceled.
  30919. func (c *InventoryItemsListCall) Context(ctx context.Context) *InventoryItemsListCall {
  30920. c.ctx_ = ctx
  30921. return c
  30922. }
  30923. // Header returns an http.Header that can be modified by the caller to
  30924. // add HTTP headers to the request.
  30925. func (c *InventoryItemsListCall) Header() http.Header {
  30926. if c.header_ == nil {
  30927. c.header_ = make(http.Header)
  30928. }
  30929. return c.header_
  30930. }
  30931. func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) {
  30932. reqHeaders := make(http.Header)
  30933. for k, v := range c.header_ {
  30934. reqHeaders[k] = v
  30935. }
  30936. reqHeaders.Set("User-Agent", c.s.userAgent())
  30937. if c.ifNoneMatch_ != "" {
  30938. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30939. }
  30940. var body io.Reader = nil
  30941. c.urlParams_.Set("alt", alt)
  30942. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems")
  30943. urls += "?" + c.urlParams_.Encode()
  30944. req, _ := http.NewRequest("GET", urls, body)
  30945. req.Header = reqHeaders
  30946. googleapi.Expand(req.URL, map[string]string{
  30947. "profileId": strconv.FormatInt(c.profileId, 10),
  30948. "projectId": strconv.FormatInt(c.projectId, 10),
  30949. })
  30950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30951. }
  30952. // Do executes the "dfareporting.inventoryItems.list" call.
  30953. // Exactly one of *InventoryItemsListResponse or error will be non-nil.
  30954. // Any non-2xx status code is an error. Response headers are in either
  30955. // *InventoryItemsListResponse.ServerResponse.Header or (if a response
  30956. // was returned at all) in error.(*googleapi.Error).Header. Use
  30957. // googleapi.IsNotModified to check whether the returned error was
  30958. // because http.StatusNotModified was returned.
  30959. func (c *InventoryItemsListCall) Do(opts ...googleapi.CallOption) (*InventoryItemsListResponse, error) {
  30960. gensupport.SetOptions(c.urlParams_, opts...)
  30961. res, err := c.doRequest("json")
  30962. if res != nil && res.StatusCode == http.StatusNotModified {
  30963. if res.Body != nil {
  30964. res.Body.Close()
  30965. }
  30966. return nil, &googleapi.Error{
  30967. Code: res.StatusCode,
  30968. Header: res.Header,
  30969. }
  30970. }
  30971. if err != nil {
  30972. return nil, err
  30973. }
  30974. defer googleapi.CloseBody(res)
  30975. if err := googleapi.CheckResponse(res); err != nil {
  30976. return nil, err
  30977. }
  30978. ret := &InventoryItemsListResponse{
  30979. ServerResponse: googleapi.ServerResponse{
  30980. Header: res.Header,
  30981. HTTPStatusCode: res.StatusCode,
  30982. },
  30983. }
  30984. target := &ret
  30985. if err := gensupport.DecodeResponse(target, res); err != nil {
  30986. return nil, err
  30987. }
  30988. return ret, nil
  30989. // {
  30990. // "description": "Retrieves a list of inventory items, possibly filtered. This method supports paging.",
  30991. // "httpMethod": "GET",
  30992. // "id": "dfareporting.inventoryItems.list",
  30993. // "parameterOrder": [
  30994. // "profileId",
  30995. // "projectId"
  30996. // ],
  30997. // "parameters": {
  30998. // "ids": {
  30999. // "description": "Select only inventory items with these IDs.",
  31000. // "format": "int64",
  31001. // "location": "query",
  31002. // "repeated": true,
  31003. // "type": "string"
  31004. // },
  31005. // "inPlan": {
  31006. // "description": "Select only inventory items that are in plan.",
  31007. // "location": "query",
  31008. // "type": "boolean"
  31009. // },
  31010. // "maxResults": {
  31011. // "default": "1000",
  31012. // "description": "Maximum number of results to return.",
  31013. // "format": "int32",
  31014. // "location": "query",
  31015. // "maximum": "1000",
  31016. // "minimum": "0",
  31017. // "type": "integer"
  31018. // },
  31019. // "orderId": {
  31020. // "description": "Select only inventory items that belong to specified orders.",
  31021. // "format": "int64",
  31022. // "location": "query",
  31023. // "repeated": true,
  31024. // "type": "string"
  31025. // },
  31026. // "pageToken": {
  31027. // "description": "Value of the nextPageToken from the previous result page.",
  31028. // "location": "query",
  31029. // "type": "string"
  31030. // },
  31031. // "profileId": {
  31032. // "description": "User profile ID associated with this request.",
  31033. // "format": "int64",
  31034. // "location": "path",
  31035. // "required": true,
  31036. // "type": "string"
  31037. // },
  31038. // "projectId": {
  31039. // "description": "Project ID for order documents.",
  31040. // "format": "int64",
  31041. // "location": "path",
  31042. // "required": true,
  31043. // "type": "string"
  31044. // },
  31045. // "siteId": {
  31046. // "description": "Select only inventory items that are associated with these sites.",
  31047. // "format": "int64",
  31048. // "location": "query",
  31049. // "repeated": true,
  31050. // "type": "string"
  31051. // },
  31052. // "sortField": {
  31053. // "default": "ID",
  31054. // "description": "Field by which to sort the list.",
  31055. // "enum": [
  31056. // "ID",
  31057. // "NAME"
  31058. // ],
  31059. // "enumDescriptions": [
  31060. // "",
  31061. // ""
  31062. // ],
  31063. // "location": "query",
  31064. // "type": "string"
  31065. // },
  31066. // "sortOrder": {
  31067. // "default": "ASCENDING",
  31068. // "description": "Order of sorted results.",
  31069. // "enum": [
  31070. // "ASCENDING",
  31071. // "DESCENDING"
  31072. // ],
  31073. // "enumDescriptions": [
  31074. // "",
  31075. // ""
  31076. // ],
  31077. // "location": "query",
  31078. // "type": "string"
  31079. // },
  31080. // "type": {
  31081. // "description": "Select only inventory items with this type.",
  31082. // "enum": [
  31083. // "PLANNING_PLACEMENT_TYPE_CREDIT",
  31084. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  31085. // ],
  31086. // "enumDescriptions": [
  31087. // "",
  31088. // ""
  31089. // ],
  31090. // "location": "query",
  31091. // "type": "string"
  31092. // }
  31093. // },
  31094. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems",
  31095. // "response": {
  31096. // "$ref": "InventoryItemsListResponse"
  31097. // },
  31098. // "scopes": [
  31099. // "https://www.googleapis.com/auth/dfatrafficking"
  31100. // ]
  31101. // }
  31102. }
  31103. // Pages invokes f for each page of results.
  31104. // A non-nil error returned from f will halt the iteration.
  31105. // The provided context supersedes any context provided to the Context method.
  31106. func (c *InventoryItemsListCall) Pages(ctx context.Context, f func(*InventoryItemsListResponse) error) error {
  31107. c.ctx_ = ctx
  31108. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  31109. for {
  31110. x, err := c.Do()
  31111. if err != nil {
  31112. return err
  31113. }
  31114. if err := f(x); err != nil {
  31115. return err
  31116. }
  31117. if x.NextPageToken == "" {
  31118. return nil
  31119. }
  31120. c.PageToken(x.NextPageToken)
  31121. }
  31122. }
  31123. // method id "dfareporting.languages.list":
  31124. type LanguagesListCall struct {
  31125. s *Service
  31126. profileId int64
  31127. urlParams_ gensupport.URLParams
  31128. ifNoneMatch_ string
  31129. ctx_ context.Context
  31130. header_ http.Header
  31131. }
  31132. // List: Retrieves a list of languages.
  31133. func (r *LanguagesService) List(profileId int64) *LanguagesListCall {
  31134. c := &LanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31135. c.profileId = profileId
  31136. return c
  31137. }
  31138. // Fields allows partial responses to be retrieved. See
  31139. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31140. // for more information.
  31141. func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall {
  31142. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31143. return c
  31144. }
  31145. // IfNoneMatch sets the optional parameter which makes the operation
  31146. // fail if the object's ETag matches the given value. This is useful for
  31147. // getting updates only after the object has changed since the last
  31148. // request. Use googleapi.IsNotModified to check whether the response
  31149. // error from Do is the result of In-None-Match.
  31150. func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall {
  31151. c.ifNoneMatch_ = entityTag
  31152. return c
  31153. }
  31154. // Context sets the context to be used in this call's Do method. Any
  31155. // pending HTTP request will be aborted if the provided context is
  31156. // canceled.
  31157. func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall {
  31158. c.ctx_ = ctx
  31159. return c
  31160. }
  31161. // Header returns an http.Header that can be modified by the caller to
  31162. // add HTTP headers to the request.
  31163. func (c *LanguagesListCall) Header() http.Header {
  31164. if c.header_ == nil {
  31165. c.header_ = make(http.Header)
  31166. }
  31167. return c.header_
  31168. }
  31169. func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) {
  31170. reqHeaders := make(http.Header)
  31171. for k, v := range c.header_ {
  31172. reqHeaders[k] = v
  31173. }
  31174. reqHeaders.Set("User-Agent", c.s.userAgent())
  31175. if c.ifNoneMatch_ != "" {
  31176. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31177. }
  31178. var body io.Reader = nil
  31179. c.urlParams_.Set("alt", alt)
  31180. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/languages")
  31181. urls += "?" + c.urlParams_.Encode()
  31182. req, _ := http.NewRequest("GET", urls, body)
  31183. req.Header = reqHeaders
  31184. googleapi.Expand(req.URL, map[string]string{
  31185. "profileId": strconv.FormatInt(c.profileId, 10),
  31186. })
  31187. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31188. }
  31189. // Do executes the "dfareporting.languages.list" call.
  31190. // Exactly one of *LanguagesListResponse or error will be non-nil. Any
  31191. // non-2xx status code is an error. Response headers are in either
  31192. // *LanguagesListResponse.ServerResponse.Header or (if a response was
  31193. // returned at all) in error.(*googleapi.Error).Header. Use
  31194. // googleapi.IsNotModified to check whether the returned error was
  31195. // because http.StatusNotModified was returned.
  31196. func (c *LanguagesListCall) Do(opts ...googleapi.CallOption) (*LanguagesListResponse, error) {
  31197. gensupport.SetOptions(c.urlParams_, opts...)
  31198. res, err := c.doRequest("json")
  31199. if res != nil && res.StatusCode == http.StatusNotModified {
  31200. if res.Body != nil {
  31201. res.Body.Close()
  31202. }
  31203. return nil, &googleapi.Error{
  31204. Code: res.StatusCode,
  31205. Header: res.Header,
  31206. }
  31207. }
  31208. if err != nil {
  31209. return nil, err
  31210. }
  31211. defer googleapi.CloseBody(res)
  31212. if err := googleapi.CheckResponse(res); err != nil {
  31213. return nil, err
  31214. }
  31215. ret := &LanguagesListResponse{
  31216. ServerResponse: googleapi.ServerResponse{
  31217. Header: res.Header,
  31218. HTTPStatusCode: res.StatusCode,
  31219. },
  31220. }
  31221. target := &ret
  31222. if err := gensupport.DecodeResponse(target, res); err != nil {
  31223. return nil, err
  31224. }
  31225. return ret, nil
  31226. // {
  31227. // "description": "Retrieves a list of languages.",
  31228. // "httpMethod": "GET",
  31229. // "id": "dfareporting.languages.list",
  31230. // "parameterOrder": [
  31231. // "profileId"
  31232. // ],
  31233. // "parameters": {
  31234. // "profileId": {
  31235. // "description": "User profile ID associated with this request.",
  31236. // "format": "int64",
  31237. // "location": "path",
  31238. // "required": true,
  31239. // "type": "string"
  31240. // }
  31241. // },
  31242. // "path": "userprofiles/{profileId}/languages",
  31243. // "response": {
  31244. // "$ref": "LanguagesListResponse"
  31245. // },
  31246. // "scopes": [
  31247. // "https://www.googleapis.com/auth/dfatrafficking"
  31248. // ]
  31249. // }
  31250. }
  31251. // method id "dfareporting.metros.list":
  31252. type MetrosListCall struct {
  31253. s *Service
  31254. profileId int64
  31255. urlParams_ gensupport.URLParams
  31256. ifNoneMatch_ string
  31257. ctx_ context.Context
  31258. header_ http.Header
  31259. }
  31260. // List: Retrieves a list of metros.
  31261. func (r *MetrosService) List(profileId int64) *MetrosListCall {
  31262. c := &MetrosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31263. c.profileId = profileId
  31264. return c
  31265. }
  31266. // Fields allows partial responses to be retrieved. See
  31267. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31268. // for more information.
  31269. func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall {
  31270. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31271. return c
  31272. }
  31273. // IfNoneMatch sets the optional parameter which makes the operation
  31274. // fail if the object's ETag matches the given value. This is useful for
  31275. // getting updates only after the object has changed since the last
  31276. // request. Use googleapi.IsNotModified to check whether the response
  31277. // error from Do is the result of In-None-Match.
  31278. func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall {
  31279. c.ifNoneMatch_ = entityTag
  31280. return c
  31281. }
  31282. // Context sets the context to be used in this call's Do method. Any
  31283. // pending HTTP request will be aborted if the provided context is
  31284. // canceled.
  31285. func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall {
  31286. c.ctx_ = ctx
  31287. return c
  31288. }
  31289. // Header returns an http.Header that can be modified by the caller to
  31290. // add HTTP headers to the request.
  31291. func (c *MetrosListCall) Header() http.Header {
  31292. if c.header_ == nil {
  31293. c.header_ = make(http.Header)
  31294. }
  31295. return c.header_
  31296. }
  31297. func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) {
  31298. reqHeaders := make(http.Header)
  31299. for k, v := range c.header_ {
  31300. reqHeaders[k] = v
  31301. }
  31302. reqHeaders.Set("User-Agent", c.s.userAgent())
  31303. if c.ifNoneMatch_ != "" {
  31304. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31305. }
  31306. var body io.Reader = nil
  31307. c.urlParams_.Set("alt", alt)
  31308. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros")
  31309. urls += "?" + c.urlParams_.Encode()
  31310. req, _ := http.NewRequest("GET", urls, body)
  31311. req.Header = reqHeaders
  31312. googleapi.Expand(req.URL, map[string]string{
  31313. "profileId": strconv.FormatInt(c.profileId, 10),
  31314. })
  31315. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31316. }
  31317. // Do executes the "dfareporting.metros.list" call.
  31318. // Exactly one of *MetrosListResponse or error will be non-nil. Any
  31319. // non-2xx status code is an error. Response headers are in either
  31320. // *MetrosListResponse.ServerResponse.Header or (if a response was
  31321. // returned at all) in error.(*googleapi.Error).Header. Use
  31322. // googleapi.IsNotModified to check whether the returned error was
  31323. // because http.StatusNotModified was returned.
  31324. func (c *MetrosListCall) Do(opts ...googleapi.CallOption) (*MetrosListResponse, error) {
  31325. gensupport.SetOptions(c.urlParams_, opts...)
  31326. res, err := c.doRequest("json")
  31327. if res != nil && res.StatusCode == http.StatusNotModified {
  31328. if res.Body != nil {
  31329. res.Body.Close()
  31330. }
  31331. return nil, &googleapi.Error{
  31332. Code: res.StatusCode,
  31333. Header: res.Header,
  31334. }
  31335. }
  31336. if err != nil {
  31337. return nil, err
  31338. }
  31339. defer googleapi.CloseBody(res)
  31340. if err := googleapi.CheckResponse(res); err != nil {
  31341. return nil, err
  31342. }
  31343. ret := &MetrosListResponse{
  31344. ServerResponse: googleapi.ServerResponse{
  31345. Header: res.Header,
  31346. HTTPStatusCode: res.StatusCode,
  31347. },
  31348. }
  31349. target := &ret
  31350. if err := gensupport.DecodeResponse(target, res); err != nil {
  31351. return nil, err
  31352. }
  31353. return ret, nil
  31354. // {
  31355. // "description": "Retrieves a list of metros.",
  31356. // "httpMethod": "GET",
  31357. // "id": "dfareporting.metros.list",
  31358. // "parameterOrder": [
  31359. // "profileId"
  31360. // ],
  31361. // "parameters": {
  31362. // "profileId": {
  31363. // "description": "User profile ID associated with this request.",
  31364. // "format": "int64",
  31365. // "location": "path",
  31366. // "required": true,
  31367. // "type": "string"
  31368. // }
  31369. // },
  31370. // "path": "userprofiles/{profileId}/metros",
  31371. // "response": {
  31372. // "$ref": "MetrosListResponse"
  31373. // },
  31374. // "scopes": [
  31375. // "https://www.googleapis.com/auth/dfatrafficking"
  31376. // ]
  31377. // }
  31378. }
  31379. // method id "dfareporting.mobileCarriers.get":
  31380. type MobileCarriersGetCall struct {
  31381. s *Service
  31382. profileId int64
  31383. id int64
  31384. urlParams_ gensupport.URLParams
  31385. ifNoneMatch_ string
  31386. ctx_ context.Context
  31387. header_ http.Header
  31388. }
  31389. // Get: Gets one mobile carrier by ID.
  31390. func (r *MobileCarriersService) Get(profileId int64, id int64) *MobileCarriersGetCall {
  31391. c := &MobileCarriersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31392. c.profileId = profileId
  31393. c.id = id
  31394. return c
  31395. }
  31396. // Fields allows partial responses to be retrieved. See
  31397. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31398. // for more information.
  31399. func (c *MobileCarriersGetCall) Fields(s ...googleapi.Field) *MobileCarriersGetCall {
  31400. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31401. return c
  31402. }
  31403. // IfNoneMatch sets the optional parameter which makes the operation
  31404. // fail if the object's ETag matches the given value. This is useful for
  31405. // getting updates only after the object has changed since the last
  31406. // request. Use googleapi.IsNotModified to check whether the response
  31407. // error from Do is the result of In-None-Match.
  31408. func (c *MobileCarriersGetCall) IfNoneMatch(entityTag string) *MobileCarriersGetCall {
  31409. c.ifNoneMatch_ = entityTag
  31410. return c
  31411. }
  31412. // Context sets the context to be used in this call's Do method. Any
  31413. // pending HTTP request will be aborted if the provided context is
  31414. // canceled.
  31415. func (c *MobileCarriersGetCall) Context(ctx context.Context) *MobileCarriersGetCall {
  31416. c.ctx_ = ctx
  31417. return c
  31418. }
  31419. // Header returns an http.Header that can be modified by the caller to
  31420. // add HTTP headers to the request.
  31421. func (c *MobileCarriersGetCall) Header() http.Header {
  31422. if c.header_ == nil {
  31423. c.header_ = make(http.Header)
  31424. }
  31425. return c.header_
  31426. }
  31427. func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) {
  31428. reqHeaders := make(http.Header)
  31429. for k, v := range c.header_ {
  31430. reqHeaders[k] = v
  31431. }
  31432. reqHeaders.Set("User-Agent", c.s.userAgent())
  31433. if c.ifNoneMatch_ != "" {
  31434. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31435. }
  31436. var body io.Reader = nil
  31437. c.urlParams_.Set("alt", alt)
  31438. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers/{id}")
  31439. urls += "?" + c.urlParams_.Encode()
  31440. req, _ := http.NewRequest("GET", urls, body)
  31441. req.Header = reqHeaders
  31442. googleapi.Expand(req.URL, map[string]string{
  31443. "profileId": strconv.FormatInt(c.profileId, 10),
  31444. "id": strconv.FormatInt(c.id, 10),
  31445. })
  31446. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31447. }
  31448. // Do executes the "dfareporting.mobileCarriers.get" call.
  31449. // Exactly one of *MobileCarrier or error will be non-nil. Any non-2xx
  31450. // status code is an error. Response headers are in either
  31451. // *MobileCarrier.ServerResponse.Header or (if a response was returned
  31452. // at all) in error.(*googleapi.Error).Header. Use
  31453. // googleapi.IsNotModified to check whether the returned error was
  31454. // because http.StatusNotModified was returned.
  31455. func (c *MobileCarriersGetCall) Do(opts ...googleapi.CallOption) (*MobileCarrier, error) {
  31456. gensupport.SetOptions(c.urlParams_, opts...)
  31457. res, err := c.doRequest("json")
  31458. if res != nil && res.StatusCode == http.StatusNotModified {
  31459. if res.Body != nil {
  31460. res.Body.Close()
  31461. }
  31462. return nil, &googleapi.Error{
  31463. Code: res.StatusCode,
  31464. Header: res.Header,
  31465. }
  31466. }
  31467. if err != nil {
  31468. return nil, err
  31469. }
  31470. defer googleapi.CloseBody(res)
  31471. if err := googleapi.CheckResponse(res); err != nil {
  31472. return nil, err
  31473. }
  31474. ret := &MobileCarrier{
  31475. ServerResponse: googleapi.ServerResponse{
  31476. Header: res.Header,
  31477. HTTPStatusCode: res.StatusCode,
  31478. },
  31479. }
  31480. target := &ret
  31481. if err := gensupport.DecodeResponse(target, res); err != nil {
  31482. return nil, err
  31483. }
  31484. return ret, nil
  31485. // {
  31486. // "description": "Gets one mobile carrier by ID.",
  31487. // "httpMethod": "GET",
  31488. // "id": "dfareporting.mobileCarriers.get",
  31489. // "parameterOrder": [
  31490. // "profileId",
  31491. // "id"
  31492. // ],
  31493. // "parameters": {
  31494. // "id": {
  31495. // "description": "Mobile carrier ID.",
  31496. // "format": "int64",
  31497. // "location": "path",
  31498. // "required": true,
  31499. // "type": "string"
  31500. // },
  31501. // "profileId": {
  31502. // "description": "User profile ID associated with this request.",
  31503. // "format": "int64",
  31504. // "location": "path",
  31505. // "required": true,
  31506. // "type": "string"
  31507. // }
  31508. // },
  31509. // "path": "userprofiles/{profileId}/mobileCarriers/{id}",
  31510. // "response": {
  31511. // "$ref": "MobileCarrier"
  31512. // },
  31513. // "scopes": [
  31514. // "https://www.googleapis.com/auth/dfatrafficking"
  31515. // ]
  31516. // }
  31517. }
  31518. // method id "dfareporting.mobileCarriers.list":
  31519. type MobileCarriersListCall struct {
  31520. s *Service
  31521. profileId int64
  31522. urlParams_ gensupport.URLParams
  31523. ifNoneMatch_ string
  31524. ctx_ context.Context
  31525. header_ http.Header
  31526. }
  31527. // List: Retrieves a list of mobile carriers.
  31528. func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall {
  31529. c := &MobileCarriersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31530. c.profileId = profileId
  31531. return c
  31532. }
  31533. // Fields allows partial responses to be retrieved. See
  31534. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31535. // for more information.
  31536. func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall {
  31537. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31538. return c
  31539. }
  31540. // IfNoneMatch sets the optional parameter which makes the operation
  31541. // fail if the object's ETag matches the given value. This is useful for
  31542. // getting updates only after the object has changed since the last
  31543. // request. Use googleapi.IsNotModified to check whether the response
  31544. // error from Do is the result of In-None-Match.
  31545. func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall {
  31546. c.ifNoneMatch_ = entityTag
  31547. return c
  31548. }
  31549. // Context sets the context to be used in this call's Do method. Any
  31550. // pending HTTP request will be aborted if the provided context is
  31551. // canceled.
  31552. func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall {
  31553. c.ctx_ = ctx
  31554. return c
  31555. }
  31556. // Header returns an http.Header that can be modified by the caller to
  31557. // add HTTP headers to the request.
  31558. func (c *MobileCarriersListCall) Header() http.Header {
  31559. if c.header_ == nil {
  31560. c.header_ = make(http.Header)
  31561. }
  31562. return c.header_
  31563. }
  31564. func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) {
  31565. reqHeaders := make(http.Header)
  31566. for k, v := range c.header_ {
  31567. reqHeaders[k] = v
  31568. }
  31569. reqHeaders.Set("User-Agent", c.s.userAgent())
  31570. if c.ifNoneMatch_ != "" {
  31571. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31572. }
  31573. var body io.Reader = nil
  31574. c.urlParams_.Set("alt", alt)
  31575. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers")
  31576. urls += "?" + c.urlParams_.Encode()
  31577. req, _ := http.NewRequest("GET", urls, body)
  31578. req.Header = reqHeaders
  31579. googleapi.Expand(req.URL, map[string]string{
  31580. "profileId": strconv.FormatInt(c.profileId, 10),
  31581. })
  31582. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31583. }
  31584. // Do executes the "dfareporting.mobileCarriers.list" call.
  31585. // Exactly one of *MobileCarriersListResponse or error will be non-nil.
  31586. // Any non-2xx status code is an error. Response headers are in either
  31587. // *MobileCarriersListResponse.ServerResponse.Header or (if a response
  31588. // was returned at all) in error.(*googleapi.Error).Header. Use
  31589. // googleapi.IsNotModified to check whether the returned error was
  31590. // because http.StatusNotModified was returned.
  31591. func (c *MobileCarriersListCall) Do(opts ...googleapi.CallOption) (*MobileCarriersListResponse, error) {
  31592. gensupport.SetOptions(c.urlParams_, opts...)
  31593. res, err := c.doRequest("json")
  31594. if res != nil && res.StatusCode == http.StatusNotModified {
  31595. if res.Body != nil {
  31596. res.Body.Close()
  31597. }
  31598. return nil, &googleapi.Error{
  31599. Code: res.StatusCode,
  31600. Header: res.Header,
  31601. }
  31602. }
  31603. if err != nil {
  31604. return nil, err
  31605. }
  31606. defer googleapi.CloseBody(res)
  31607. if err := googleapi.CheckResponse(res); err != nil {
  31608. return nil, err
  31609. }
  31610. ret := &MobileCarriersListResponse{
  31611. ServerResponse: googleapi.ServerResponse{
  31612. Header: res.Header,
  31613. HTTPStatusCode: res.StatusCode,
  31614. },
  31615. }
  31616. target := &ret
  31617. if err := gensupport.DecodeResponse(target, res); err != nil {
  31618. return nil, err
  31619. }
  31620. return ret, nil
  31621. // {
  31622. // "description": "Retrieves a list of mobile carriers.",
  31623. // "httpMethod": "GET",
  31624. // "id": "dfareporting.mobileCarriers.list",
  31625. // "parameterOrder": [
  31626. // "profileId"
  31627. // ],
  31628. // "parameters": {
  31629. // "profileId": {
  31630. // "description": "User profile ID associated with this request.",
  31631. // "format": "int64",
  31632. // "location": "path",
  31633. // "required": true,
  31634. // "type": "string"
  31635. // }
  31636. // },
  31637. // "path": "userprofiles/{profileId}/mobileCarriers",
  31638. // "response": {
  31639. // "$ref": "MobileCarriersListResponse"
  31640. // },
  31641. // "scopes": [
  31642. // "https://www.googleapis.com/auth/dfatrafficking"
  31643. // ]
  31644. // }
  31645. }
  31646. // method id "dfareporting.operatingSystemVersions.get":
  31647. type OperatingSystemVersionsGetCall struct {
  31648. s *Service
  31649. profileId int64
  31650. id int64
  31651. urlParams_ gensupport.URLParams
  31652. ifNoneMatch_ string
  31653. ctx_ context.Context
  31654. header_ http.Header
  31655. }
  31656. // Get: Gets one operating system version by ID.
  31657. func (r *OperatingSystemVersionsService) Get(profileId int64, id int64) *OperatingSystemVersionsGetCall {
  31658. c := &OperatingSystemVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31659. c.profileId = profileId
  31660. c.id = id
  31661. return c
  31662. }
  31663. // Fields allows partial responses to be retrieved. See
  31664. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31665. // for more information.
  31666. func (c *OperatingSystemVersionsGetCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsGetCall {
  31667. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31668. return c
  31669. }
  31670. // IfNoneMatch sets the optional parameter which makes the operation
  31671. // fail if the object's ETag matches the given value. This is useful for
  31672. // getting updates only after the object has changed since the last
  31673. // request. Use googleapi.IsNotModified to check whether the response
  31674. // error from Do is the result of In-None-Match.
  31675. func (c *OperatingSystemVersionsGetCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsGetCall {
  31676. c.ifNoneMatch_ = entityTag
  31677. return c
  31678. }
  31679. // Context sets the context to be used in this call's Do method. Any
  31680. // pending HTTP request will be aborted if the provided context is
  31681. // canceled.
  31682. func (c *OperatingSystemVersionsGetCall) Context(ctx context.Context) *OperatingSystemVersionsGetCall {
  31683. c.ctx_ = ctx
  31684. return c
  31685. }
  31686. // Header returns an http.Header that can be modified by the caller to
  31687. // add HTTP headers to the request.
  31688. func (c *OperatingSystemVersionsGetCall) Header() http.Header {
  31689. if c.header_ == nil {
  31690. c.header_ = make(http.Header)
  31691. }
  31692. return c.header_
  31693. }
  31694. func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  31695. reqHeaders := make(http.Header)
  31696. for k, v := range c.header_ {
  31697. reqHeaders[k] = v
  31698. }
  31699. reqHeaders.Set("User-Agent", c.s.userAgent())
  31700. if c.ifNoneMatch_ != "" {
  31701. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31702. }
  31703. var body io.Reader = nil
  31704. c.urlParams_.Set("alt", alt)
  31705. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions/{id}")
  31706. urls += "?" + c.urlParams_.Encode()
  31707. req, _ := http.NewRequest("GET", urls, body)
  31708. req.Header = reqHeaders
  31709. googleapi.Expand(req.URL, map[string]string{
  31710. "profileId": strconv.FormatInt(c.profileId, 10),
  31711. "id": strconv.FormatInt(c.id, 10),
  31712. })
  31713. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31714. }
  31715. // Do executes the "dfareporting.operatingSystemVersions.get" call.
  31716. // Exactly one of *OperatingSystemVersion or error will be non-nil. Any
  31717. // non-2xx status code is an error. Response headers are in either
  31718. // *OperatingSystemVersion.ServerResponse.Header or (if a response was
  31719. // returned at all) in error.(*googleapi.Error).Header. Use
  31720. // googleapi.IsNotModified to check whether the returned error was
  31721. // because http.StatusNotModified was returned.
  31722. func (c *OperatingSystemVersionsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersion, error) {
  31723. gensupport.SetOptions(c.urlParams_, opts...)
  31724. res, err := c.doRequest("json")
  31725. if res != nil && res.StatusCode == http.StatusNotModified {
  31726. if res.Body != nil {
  31727. res.Body.Close()
  31728. }
  31729. return nil, &googleapi.Error{
  31730. Code: res.StatusCode,
  31731. Header: res.Header,
  31732. }
  31733. }
  31734. if err != nil {
  31735. return nil, err
  31736. }
  31737. defer googleapi.CloseBody(res)
  31738. if err := googleapi.CheckResponse(res); err != nil {
  31739. return nil, err
  31740. }
  31741. ret := &OperatingSystemVersion{
  31742. ServerResponse: googleapi.ServerResponse{
  31743. Header: res.Header,
  31744. HTTPStatusCode: res.StatusCode,
  31745. },
  31746. }
  31747. target := &ret
  31748. if err := gensupport.DecodeResponse(target, res); err != nil {
  31749. return nil, err
  31750. }
  31751. return ret, nil
  31752. // {
  31753. // "description": "Gets one operating system version by ID.",
  31754. // "httpMethod": "GET",
  31755. // "id": "dfareporting.operatingSystemVersions.get",
  31756. // "parameterOrder": [
  31757. // "profileId",
  31758. // "id"
  31759. // ],
  31760. // "parameters": {
  31761. // "id": {
  31762. // "description": "Operating system version ID.",
  31763. // "format": "int64",
  31764. // "location": "path",
  31765. // "required": true,
  31766. // "type": "string"
  31767. // },
  31768. // "profileId": {
  31769. // "description": "User profile ID associated with this request.",
  31770. // "format": "int64",
  31771. // "location": "path",
  31772. // "required": true,
  31773. // "type": "string"
  31774. // }
  31775. // },
  31776. // "path": "userprofiles/{profileId}/operatingSystemVersions/{id}",
  31777. // "response": {
  31778. // "$ref": "OperatingSystemVersion"
  31779. // },
  31780. // "scopes": [
  31781. // "https://www.googleapis.com/auth/dfatrafficking"
  31782. // ]
  31783. // }
  31784. }
  31785. // method id "dfareporting.operatingSystemVersions.list":
  31786. type OperatingSystemVersionsListCall struct {
  31787. s *Service
  31788. profileId int64
  31789. urlParams_ gensupport.URLParams
  31790. ifNoneMatch_ string
  31791. ctx_ context.Context
  31792. header_ http.Header
  31793. }
  31794. // List: Retrieves a list of operating system versions.
  31795. func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall {
  31796. c := &OperatingSystemVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31797. c.profileId = profileId
  31798. return c
  31799. }
  31800. // Fields allows partial responses to be retrieved. See
  31801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31802. // for more information.
  31803. func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall {
  31804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31805. return c
  31806. }
  31807. // IfNoneMatch sets the optional parameter which makes the operation
  31808. // fail if the object's ETag matches the given value. This is useful for
  31809. // getting updates only after the object has changed since the last
  31810. // request. Use googleapi.IsNotModified to check whether the response
  31811. // error from Do is the result of In-None-Match.
  31812. func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall {
  31813. c.ifNoneMatch_ = entityTag
  31814. return c
  31815. }
  31816. // Context sets the context to be used in this call's Do method. Any
  31817. // pending HTTP request will be aborted if the provided context is
  31818. // canceled.
  31819. func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall {
  31820. c.ctx_ = ctx
  31821. return c
  31822. }
  31823. // Header returns an http.Header that can be modified by the caller to
  31824. // add HTTP headers to the request.
  31825. func (c *OperatingSystemVersionsListCall) Header() http.Header {
  31826. if c.header_ == nil {
  31827. c.header_ = make(http.Header)
  31828. }
  31829. return c.header_
  31830. }
  31831. func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) {
  31832. reqHeaders := make(http.Header)
  31833. for k, v := range c.header_ {
  31834. reqHeaders[k] = v
  31835. }
  31836. reqHeaders.Set("User-Agent", c.s.userAgent())
  31837. if c.ifNoneMatch_ != "" {
  31838. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31839. }
  31840. var body io.Reader = nil
  31841. c.urlParams_.Set("alt", alt)
  31842. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions")
  31843. urls += "?" + c.urlParams_.Encode()
  31844. req, _ := http.NewRequest("GET", urls, body)
  31845. req.Header = reqHeaders
  31846. googleapi.Expand(req.URL, map[string]string{
  31847. "profileId": strconv.FormatInt(c.profileId, 10),
  31848. })
  31849. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31850. }
  31851. // Do executes the "dfareporting.operatingSystemVersions.list" call.
  31852. // Exactly one of *OperatingSystemVersionsListResponse or error will be
  31853. // non-nil. Any non-2xx status code is an error. Response headers are in
  31854. // either *OperatingSystemVersionsListResponse.ServerResponse.Header or
  31855. // (if a response was returned at all) in
  31856. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  31857. // whether the returned error was because http.StatusNotModified was
  31858. // returned.
  31859. func (c *OperatingSystemVersionsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersionsListResponse, error) {
  31860. gensupport.SetOptions(c.urlParams_, opts...)
  31861. res, err := c.doRequest("json")
  31862. if res != nil && res.StatusCode == http.StatusNotModified {
  31863. if res.Body != nil {
  31864. res.Body.Close()
  31865. }
  31866. return nil, &googleapi.Error{
  31867. Code: res.StatusCode,
  31868. Header: res.Header,
  31869. }
  31870. }
  31871. if err != nil {
  31872. return nil, err
  31873. }
  31874. defer googleapi.CloseBody(res)
  31875. if err := googleapi.CheckResponse(res); err != nil {
  31876. return nil, err
  31877. }
  31878. ret := &OperatingSystemVersionsListResponse{
  31879. ServerResponse: googleapi.ServerResponse{
  31880. Header: res.Header,
  31881. HTTPStatusCode: res.StatusCode,
  31882. },
  31883. }
  31884. target := &ret
  31885. if err := gensupport.DecodeResponse(target, res); err != nil {
  31886. return nil, err
  31887. }
  31888. return ret, nil
  31889. // {
  31890. // "description": "Retrieves a list of operating system versions.",
  31891. // "httpMethod": "GET",
  31892. // "id": "dfareporting.operatingSystemVersions.list",
  31893. // "parameterOrder": [
  31894. // "profileId"
  31895. // ],
  31896. // "parameters": {
  31897. // "profileId": {
  31898. // "description": "User profile ID associated with this request.",
  31899. // "format": "int64",
  31900. // "location": "path",
  31901. // "required": true,
  31902. // "type": "string"
  31903. // }
  31904. // },
  31905. // "path": "userprofiles/{profileId}/operatingSystemVersions",
  31906. // "response": {
  31907. // "$ref": "OperatingSystemVersionsListResponse"
  31908. // },
  31909. // "scopes": [
  31910. // "https://www.googleapis.com/auth/dfatrafficking"
  31911. // ]
  31912. // }
  31913. }
  31914. // method id "dfareporting.operatingSystems.get":
  31915. type OperatingSystemsGetCall struct {
  31916. s *Service
  31917. profileId int64
  31918. dartId int64
  31919. urlParams_ gensupport.URLParams
  31920. ifNoneMatch_ string
  31921. ctx_ context.Context
  31922. header_ http.Header
  31923. }
  31924. // Get: Gets one operating system by DART ID.
  31925. func (r *OperatingSystemsService) Get(profileId int64, dartId int64) *OperatingSystemsGetCall {
  31926. c := &OperatingSystemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31927. c.profileId = profileId
  31928. c.dartId = dartId
  31929. return c
  31930. }
  31931. // Fields allows partial responses to be retrieved. See
  31932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31933. // for more information.
  31934. func (c *OperatingSystemsGetCall) Fields(s ...googleapi.Field) *OperatingSystemsGetCall {
  31935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31936. return c
  31937. }
  31938. // IfNoneMatch sets the optional parameter which makes the operation
  31939. // fail if the object's ETag matches the given value. This is useful for
  31940. // getting updates only after the object has changed since the last
  31941. // request. Use googleapi.IsNotModified to check whether the response
  31942. // error from Do is the result of In-None-Match.
  31943. func (c *OperatingSystemsGetCall) IfNoneMatch(entityTag string) *OperatingSystemsGetCall {
  31944. c.ifNoneMatch_ = entityTag
  31945. return c
  31946. }
  31947. // Context sets the context to be used in this call's Do method. Any
  31948. // pending HTTP request will be aborted if the provided context is
  31949. // canceled.
  31950. func (c *OperatingSystemsGetCall) Context(ctx context.Context) *OperatingSystemsGetCall {
  31951. c.ctx_ = ctx
  31952. return c
  31953. }
  31954. // Header returns an http.Header that can be modified by the caller to
  31955. // add HTTP headers to the request.
  31956. func (c *OperatingSystemsGetCall) Header() http.Header {
  31957. if c.header_ == nil {
  31958. c.header_ = make(http.Header)
  31959. }
  31960. return c.header_
  31961. }
  31962. func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) {
  31963. reqHeaders := make(http.Header)
  31964. for k, v := range c.header_ {
  31965. reqHeaders[k] = v
  31966. }
  31967. reqHeaders.Set("User-Agent", c.s.userAgent())
  31968. if c.ifNoneMatch_ != "" {
  31969. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31970. }
  31971. var body io.Reader = nil
  31972. c.urlParams_.Set("alt", alt)
  31973. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems/{dartId}")
  31974. urls += "?" + c.urlParams_.Encode()
  31975. req, _ := http.NewRequest("GET", urls, body)
  31976. req.Header = reqHeaders
  31977. googleapi.Expand(req.URL, map[string]string{
  31978. "profileId": strconv.FormatInt(c.profileId, 10),
  31979. "dartId": strconv.FormatInt(c.dartId, 10),
  31980. })
  31981. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31982. }
  31983. // Do executes the "dfareporting.operatingSystems.get" call.
  31984. // Exactly one of *OperatingSystem or error will be non-nil. Any non-2xx
  31985. // status code is an error. Response headers are in either
  31986. // *OperatingSystem.ServerResponse.Header or (if a response was returned
  31987. // at all) in error.(*googleapi.Error).Header. Use
  31988. // googleapi.IsNotModified to check whether the returned error was
  31989. // because http.StatusNotModified was returned.
  31990. func (c *OperatingSystemsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystem, error) {
  31991. gensupport.SetOptions(c.urlParams_, opts...)
  31992. res, err := c.doRequest("json")
  31993. if res != nil && res.StatusCode == http.StatusNotModified {
  31994. if res.Body != nil {
  31995. res.Body.Close()
  31996. }
  31997. return nil, &googleapi.Error{
  31998. Code: res.StatusCode,
  31999. Header: res.Header,
  32000. }
  32001. }
  32002. if err != nil {
  32003. return nil, err
  32004. }
  32005. defer googleapi.CloseBody(res)
  32006. if err := googleapi.CheckResponse(res); err != nil {
  32007. return nil, err
  32008. }
  32009. ret := &OperatingSystem{
  32010. ServerResponse: googleapi.ServerResponse{
  32011. Header: res.Header,
  32012. HTTPStatusCode: res.StatusCode,
  32013. },
  32014. }
  32015. target := &ret
  32016. if err := gensupport.DecodeResponse(target, res); err != nil {
  32017. return nil, err
  32018. }
  32019. return ret, nil
  32020. // {
  32021. // "description": "Gets one operating system by DART ID.",
  32022. // "httpMethod": "GET",
  32023. // "id": "dfareporting.operatingSystems.get",
  32024. // "parameterOrder": [
  32025. // "profileId",
  32026. // "dartId"
  32027. // ],
  32028. // "parameters": {
  32029. // "dartId": {
  32030. // "description": "Operating system DART ID.",
  32031. // "format": "int64",
  32032. // "location": "path",
  32033. // "required": true,
  32034. // "type": "string"
  32035. // },
  32036. // "profileId": {
  32037. // "description": "User profile ID associated with this request.",
  32038. // "format": "int64",
  32039. // "location": "path",
  32040. // "required": true,
  32041. // "type": "string"
  32042. // }
  32043. // },
  32044. // "path": "userprofiles/{profileId}/operatingSystems/{dartId}",
  32045. // "response": {
  32046. // "$ref": "OperatingSystem"
  32047. // },
  32048. // "scopes": [
  32049. // "https://www.googleapis.com/auth/dfatrafficking"
  32050. // ]
  32051. // }
  32052. }
  32053. // method id "dfareporting.operatingSystems.list":
  32054. type OperatingSystemsListCall struct {
  32055. s *Service
  32056. profileId int64
  32057. urlParams_ gensupport.URLParams
  32058. ifNoneMatch_ string
  32059. ctx_ context.Context
  32060. header_ http.Header
  32061. }
  32062. // List: Retrieves a list of operating systems.
  32063. func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall {
  32064. c := &OperatingSystemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32065. c.profileId = profileId
  32066. return c
  32067. }
  32068. // Fields allows partial responses to be retrieved. See
  32069. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32070. // for more information.
  32071. func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall {
  32072. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32073. return c
  32074. }
  32075. // IfNoneMatch sets the optional parameter which makes the operation
  32076. // fail if the object's ETag matches the given value. This is useful for
  32077. // getting updates only after the object has changed since the last
  32078. // request. Use googleapi.IsNotModified to check whether the response
  32079. // error from Do is the result of In-None-Match.
  32080. func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall {
  32081. c.ifNoneMatch_ = entityTag
  32082. return c
  32083. }
  32084. // Context sets the context to be used in this call's Do method. Any
  32085. // pending HTTP request will be aborted if the provided context is
  32086. // canceled.
  32087. func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall {
  32088. c.ctx_ = ctx
  32089. return c
  32090. }
  32091. // Header returns an http.Header that can be modified by the caller to
  32092. // add HTTP headers to the request.
  32093. func (c *OperatingSystemsListCall) Header() http.Header {
  32094. if c.header_ == nil {
  32095. c.header_ = make(http.Header)
  32096. }
  32097. return c.header_
  32098. }
  32099. func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) {
  32100. reqHeaders := make(http.Header)
  32101. for k, v := range c.header_ {
  32102. reqHeaders[k] = v
  32103. }
  32104. reqHeaders.Set("User-Agent", c.s.userAgent())
  32105. if c.ifNoneMatch_ != "" {
  32106. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32107. }
  32108. var body io.Reader = nil
  32109. c.urlParams_.Set("alt", alt)
  32110. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems")
  32111. urls += "?" + c.urlParams_.Encode()
  32112. req, _ := http.NewRequest("GET", urls, body)
  32113. req.Header = reqHeaders
  32114. googleapi.Expand(req.URL, map[string]string{
  32115. "profileId": strconv.FormatInt(c.profileId, 10),
  32116. })
  32117. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32118. }
  32119. // Do executes the "dfareporting.operatingSystems.list" call.
  32120. // Exactly one of *OperatingSystemsListResponse or error will be
  32121. // non-nil. Any non-2xx status code is an error. Response headers are in
  32122. // either *OperatingSystemsListResponse.ServerResponse.Header or (if a
  32123. // response was returned at all) in error.(*googleapi.Error).Header. Use
  32124. // googleapi.IsNotModified to check whether the returned error was
  32125. // because http.StatusNotModified was returned.
  32126. func (c *OperatingSystemsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemsListResponse, error) {
  32127. gensupport.SetOptions(c.urlParams_, opts...)
  32128. res, err := c.doRequest("json")
  32129. if res != nil && res.StatusCode == http.StatusNotModified {
  32130. if res.Body != nil {
  32131. res.Body.Close()
  32132. }
  32133. return nil, &googleapi.Error{
  32134. Code: res.StatusCode,
  32135. Header: res.Header,
  32136. }
  32137. }
  32138. if err != nil {
  32139. return nil, err
  32140. }
  32141. defer googleapi.CloseBody(res)
  32142. if err := googleapi.CheckResponse(res); err != nil {
  32143. return nil, err
  32144. }
  32145. ret := &OperatingSystemsListResponse{
  32146. ServerResponse: googleapi.ServerResponse{
  32147. Header: res.Header,
  32148. HTTPStatusCode: res.StatusCode,
  32149. },
  32150. }
  32151. target := &ret
  32152. if err := gensupport.DecodeResponse(target, res); err != nil {
  32153. return nil, err
  32154. }
  32155. return ret, nil
  32156. // {
  32157. // "description": "Retrieves a list of operating systems.",
  32158. // "httpMethod": "GET",
  32159. // "id": "dfareporting.operatingSystems.list",
  32160. // "parameterOrder": [
  32161. // "profileId"
  32162. // ],
  32163. // "parameters": {
  32164. // "profileId": {
  32165. // "description": "User profile ID associated with this request.",
  32166. // "format": "int64",
  32167. // "location": "path",
  32168. // "required": true,
  32169. // "type": "string"
  32170. // }
  32171. // },
  32172. // "path": "userprofiles/{profileId}/operatingSystems",
  32173. // "response": {
  32174. // "$ref": "OperatingSystemsListResponse"
  32175. // },
  32176. // "scopes": [
  32177. // "https://www.googleapis.com/auth/dfatrafficking"
  32178. // ]
  32179. // }
  32180. }
  32181. // method id "dfareporting.orderDocuments.get":
  32182. type OrderDocumentsGetCall struct {
  32183. s *Service
  32184. profileId int64
  32185. projectId int64
  32186. id int64
  32187. urlParams_ gensupport.URLParams
  32188. ifNoneMatch_ string
  32189. ctx_ context.Context
  32190. header_ http.Header
  32191. }
  32192. // Get: Gets one order document by ID.
  32193. func (r *OrderDocumentsService) Get(profileId int64, projectId int64, id int64) *OrderDocumentsGetCall {
  32194. c := &OrderDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32195. c.profileId = profileId
  32196. c.projectId = projectId
  32197. c.id = id
  32198. return c
  32199. }
  32200. // Fields allows partial responses to be retrieved. See
  32201. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32202. // for more information.
  32203. func (c *OrderDocumentsGetCall) Fields(s ...googleapi.Field) *OrderDocumentsGetCall {
  32204. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32205. return c
  32206. }
  32207. // IfNoneMatch sets the optional parameter which makes the operation
  32208. // fail if the object's ETag matches the given value. This is useful for
  32209. // getting updates only after the object has changed since the last
  32210. // request. Use googleapi.IsNotModified to check whether the response
  32211. // error from Do is the result of In-None-Match.
  32212. func (c *OrderDocumentsGetCall) IfNoneMatch(entityTag string) *OrderDocumentsGetCall {
  32213. c.ifNoneMatch_ = entityTag
  32214. return c
  32215. }
  32216. // Context sets the context to be used in this call's Do method. Any
  32217. // pending HTTP request will be aborted if the provided context is
  32218. // canceled.
  32219. func (c *OrderDocumentsGetCall) Context(ctx context.Context) *OrderDocumentsGetCall {
  32220. c.ctx_ = ctx
  32221. return c
  32222. }
  32223. // Header returns an http.Header that can be modified by the caller to
  32224. // add HTTP headers to the request.
  32225. func (c *OrderDocumentsGetCall) Header() http.Header {
  32226. if c.header_ == nil {
  32227. c.header_ = make(http.Header)
  32228. }
  32229. return c.header_
  32230. }
  32231. func (c *OrderDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  32232. reqHeaders := make(http.Header)
  32233. for k, v := range c.header_ {
  32234. reqHeaders[k] = v
  32235. }
  32236. reqHeaders.Set("User-Agent", c.s.userAgent())
  32237. if c.ifNoneMatch_ != "" {
  32238. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32239. }
  32240. var body io.Reader = nil
  32241. c.urlParams_.Set("alt", alt)
  32242. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}")
  32243. urls += "?" + c.urlParams_.Encode()
  32244. req, _ := http.NewRequest("GET", urls, body)
  32245. req.Header = reqHeaders
  32246. googleapi.Expand(req.URL, map[string]string{
  32247. "profileId": strconv.FormatInt(c.profileId, 10),
  32248. "projectId": strconv.FormatInt(c.projectId, 10),
  32249. "id": strconv.FormatInt(c.id, 10),
  32250. })
  32251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32252. }
  32253. // Do executes the "dfareporting.orderDocuments.get" call.
  32254. // Exactly one of *OrderDocument or error will be non-nil. Any non-2xx
  32255. // status code is an error. Response headers are in either
  32256. // *OrderDocument.ServerResponse.Header or (if a response was returned
  32257. // at all) in error.(*googleapi.Error).Header. Use
  32258. // googleapi.IsNotModified to check whether the returned error was
  32259. // because http.StatusNotModified was returned.
  32260. func (c *OrderDocumentsGetCall) Do(opts ...googleapi.CallOption) (*OrderDocument, error) {
  32261. gensupport.SetOptions(c.urlParams_, opts...)
  32262. res, err := c.doRequest("json")
  32263. if res != nil && res.StatusCode == http.StatusNotModified {
  32264. if res.Body != nil {
  32265. res.Body.Close()
  32266. }
  32267. return nil, &googleapi.Error{
  32268. Code: res.StatusCode,
  32269. Header: res.Header,
  32270. }
  32271. }
  32272. if err != nil {
  32273. return nil, err
  32274. }
  32275. defer googleapi.CloseBody(res)
  32276. if err := googleapi.CheckResponse(res); err != nil {
  32277. return nil, err
  32278. }
  32279. ret := &OrderDocument{
  32280. ServerResponse: googleapi.ServerResponse{
  32281. Header: res.Header,
  32282. HTTPStatusCode: res.StatusCode,
  32283. },
  32284. }
  32285. target := &ret
  32286. if err := gensupport.DecodeResponse(target, res); err != nil {
  32287. return nil, err
  32288. }
  32289. return ret, nil
  32290. // {
  32291. // "description": "Gets one order document by ID.",
  32292. // "httpMethod": "GET",
  32293. // "id": "dfareporting.orderDocuments.get",
  32294. // "parameterOrder": [
  32295. // "profileId",
  32296. // "projectId",
  32297. // "id"
  32298. // ],
  32299. // "parameters": {
  32300. // "id": {
  32301. // "description": "Order document ID.",
  32302. // "format": "int64",
  32303. // "location": "path",
  32304. // "required": true,
  32305. // "type": "string"
  32306. // },
  32307. // "profileId": {
  32308. // "description": "User profile ID associated with this request.",
  32309. // "format": "int64",
  32310. // "location": "path",
  32311. // "required": true,
  32312. // "type": "string"
  32313. // },
  32314. // "projectId": {
  32315. // "description": "Project ID for order documents.",
  32316. // "format": "int64",
  32317. // "location": "path",
  32318. // "required": true,
  32319. // "type": "string"
  32320. // }
  32321. // },
  32322. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}",
  32323. // "response": {
  32324. // "$ref": "OrderDocument"
  32325. // },
  32326. // "scopes": [
  32327. // "https://www.googleapis.com/auth/dfatrafficking"
  32328. // ]
  32329. // }
  32330. }
  32331. // method id "dfareporting.orderDocuments.list":
  32332. type OrderDocumentsListCall struct {
  32333. s *Service
  32334. profileId int64
  32335. projectId int64
  32336. urlParams_ gensupport.URLParams
  32337. ifNoneMatch_ string
  32338. ctx_ context.Context
  32339. header_ http.Header
  32340. }
  32341. // List: Retrieves a list of order documents, possibly filtered. This
  32342. // method supports paging.
  32343. func (r *OrderDocumentsService) List(profileId int64, projectId int64) *OrderDocumentsListCall {
  32344. c := &OrderDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32345. c.profileId = profileId
  32346. c.projectId = projectId
  32347. return c
  32348. }
  32349. // Approved sets the optional parameter "approved": Select only order
  32350. // documents that have been approved by at least one user.
  32351. func (c *OrderDocumentsListCall) Approved(approved bool) *OrderDocumentsListCall {
  32352. c.urlParams_.Set("approved", fmt.Sprint(approved))
  32353. return c
  32354. }
  32355. // Ids sets the optional parameter "ids": Select only order documents
  32356. // with these IDs.
  32357. func (c *OrderDocumentsListCall) Ids(ids ...int64) *OrderDocumentsListCall {
  32358. var ids_ []string
  32359. for _, v := range ids {
  32360. ids_ = append(ids_, fmt.Sprint(v))
  32361. }
  32362. c.urlParams_.SetMulti("ids", ids_)
  32363. return c
  32364. }
  32365. // MaxResults sets the optional parameter "maxResults": Maximum number
  32366. // of results to return.
  32367. func (c *OrderDocumentsListCall) MaxResults(maxResults int64) *OrderDocumentsListCall {
  32368. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32369. return c
  32370. }
  32371. // OrderId sets the optional parameter "orderId": Select only order
  32372. // documents for specified orders.
  32373. func (c *OrderDocumentsListCall) OrderId(orderId ...int64) *OrderDocumentsListCall {
  32374. var orderId_ []string
  32375. for _, v := range orderId {
  32376. orderId_ = append(orderId_, fmt.Sprint(v))
  32377. }
  32378. c.urlParams_.SetMulti("orderId", orderId_)
  32379. return c
  32380. }
  32381. // PageToken sets the optional parameter "pageToken": Value of the
  32382. // nextPageToken from the previous result page.
  32383. func (c *OrderDocumentsListCall) PageToken(pageToken string) *OrderDocumentsListCall {
  32384. c.urlParams_.Set("pageToken", pageToken)
  32385. return c
  32386. }
  32387. // SearchString sets the optional parameter "searchString": Allows
  32388. // searching for order documents by name or ID. Wildcards (*) are
  32389. // allowed. For example, "orderdocument*2015" will return order
  32390. // documents with names like "orderdocument June 2015", "orderdocument
  32391. // April 2015", or simply "orderdocument 2015". Most of the searches
  32392. // also add wildcards implicitly at the start and the end of the search
  32393. // string. For example, a search string of "orderdocument" will match
  32394. // order documents with name "my orderdocument", "orderdocument 2015",
  32395. // or simply "orderdocument".
  32396. func (c *OrderDocumentsListCall) SearchString(searchString string) *OrderDocumentsListCall {
  32397. c.urlParams_.Set("searchString", searchString)
  32398. return c
  32399. }
  32400. // SiteId sets the optional parameter "siteId": Select only order
  32401. // documents that are associated with these sites.
  32402. func (c *OrderDocumentsListCall) SiteId(siteId ...int64) *OrderDocumentsListCall {
  32403. var siteId_ []string
  32404. for _, v := range siteId {
  32405. siteId_ = append(siteId_, fmt.Sprint(v))
  32406. }
  32407. c.urlParams_.SetMulti("siteId", siteId_)
  32408. return c
  32409. }
  32410. // SortField sets the optional parameter "sortField": Field by which to
  32411. // sort the list.
  32412. //
  32413. // Possible values:
  32414. // "ID" (default)
  32415. // "NAME"
  32416. func (c *OrderDocumentsListCall) SortField(sortField string) *OrderDocumentsListCall {
  32417. c.urlParams_.Set("sortField", sortField)
  32418. return c
  32419. }
  32420. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  32421. // results.
  32422. //
  32423. // Possible values:
  32424. // "ASCENDING" (default)
  32425. // "DESCENDING"
  32426. func (c *OrderDocumentsListCall) SortOrder(sortOrder string) *OrderDocumentsListCall {
  32427. c.urlParams_.Set("sortOrder", sortOrder)
  32428. return c
  32429. }
  32430. // Fields allows partial responses to be retrieved. See
  32431. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32432. // for more information.
  32433. func (c *OrderDocumentsListCall) Fields(s ...googleapi.Field) *OrderDocumentsListCall {
  32434. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32435. return c
  32436. }
  32437. // IfNoneMatch sets the optional parameter which makes the operation
  32438. // fail if the object's ETag matches the given value. This is useful for
  32439. // getting updates only after the object has changed since the last
  32440. // request. Use googleapi.IsNotModified to check whether the response
  32441. // error from Do is the result of In-None-Match.
  32442. func (c *OrderDocumentsListCall) IfNoneMatch(entityTag string) *OrderDocumentsListCall {
  32443. c.ifNoneMatch_ = entityTag
  32444. return c
  32445. }
  32446. // Context sets the context to be used in this call's Do method. Any
  32447. // pending HTTP request will be aborted if the provided context is
  32448. // canceled.
  32449. func (c *OrderDocumentsListCall) Context(ctx context.Context) *OrderDocumentsListCall {
  32450. c.ctx_ = ctx
  32451. return c
  32452. }
  32453. // Header returns an http.Header that can be modified by the caller to
  32454. // add HTTP headers to the request.
  32455. func (c *OrderDocumentsListCall) Header() http.Header {
  32456. if c.header_ == nil {
  32457. c.header_ = make(http.Header)
  32458. }
  32459. return c.header_
  32460. }
  32461. func (c *OrderDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  32462. reqHeaders := make(http.Header)
  32463. for k, v := range c.header_ {
  32464. reqHeaders[k] = v
  32465. }
  32466. reqHeaders.Set("User-Agent", c.s.userAgent())
  32467. if c.ifNoneMatch_ != "" {
  32468. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32469. }
  32470. var body io.Reader = nil
  32471. c.urlParams_.Set("alt", alt)
  32472. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments")
  32473. urls += "?" + c.urlParams_.Encode()
  32474. req, _ := http.NewRequest("GET", urls, body)
  32475. req.Header = reqHeaders
  32476. googleapi.Expand(req.URL, map[string]string{
  32477. "profileId": strconv.FormatInt(c.profileId, 10),
  32478. "projectId": strconv.FormatInt(c.projectId, 10),
  32479. })
  32480. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32481. }
  32482. // Do executes the "dfareporting.orderDocuments.list" call.
  32483. // Exactly one of *OrderDocumentsListResponse or error will be non-nil.
  32484. // Any non-2xx status code is an error. Response headers are in either
  32485. // *OrderDocumentsListResponse.ServerResponse.Header or (if a response
  32486. // was returned at all) in error.(*googleapi.Error).Header. Use
  32487. // googleapi.IsNotModified to check whether the returned error was
  32488. // because http.StatusNotModified was returned.
  32489. func (c *OrderDocumentsListCall) Do(opts ...googleapi.CallOption) (*OrderDocumentsListResponse, error) {
  32490. gensupport.SetOptions(c.urlParams_, opts...)
  32491. res, err := c.doRequest("json")
  32492. if res != nil && res.StatusCode == http.StatusNotModified {
  32493. if res.Body != nil {
  32494. res.Body.Close()
  32495. }
  32496. return nil, &googleapi.Error{
  32497. Code: res.StatusCode,
  32498. Header: res.Header,
  32499. }
  32500. }
  32501. if err != nil {
  32502. return nil, err
  32503. }
  32504. defer googleapi.CloseBody(res)
  32505. if err := googleapi.CheckResponse(res); err != nil {
  32506. return nil, err
  32507. }
  32508. ret := &OrderDocumentsListResponse{
  32509. ServerResponse: googleapi.ServerResponse{
  32510. Header: res.Header,
  32511. HTTPStatusCode: res.StatusCode,
  32512. },
  32513. }
  32514. target := &ret
  32515. if err := gensupport.DecodeResponse(target, res); err != nil {
  32516. return nil, err
  32517. }
  32518. return ret, nil
  32519. // {
  32520. // "description": "Retrieves a list of order documents, possibly filtered. This method supports paging.",
  32521. // "httpMethod": "GET",
  32522. // "id": "dfareporting.orderDocuments.list",
  32523. // "parameterOrder": [
  32524. // "profileId",
  32525. // "projectId"
  32526. // ],
  32527. // "parameters": {
  32528. // "approved": {
  32529. // "description": "Select only order documents that have been approved by at least one user.",
  32530. // "location": "query",
  32531. // "type": "boolean"
  32532. // },
  32533. // "ids": {
  32534. // "description": "Select only order documents with these IDs.",
  32535. // "format": "int64",
  32536. // "location": "query",
  32537. // "repeated": true,
  32538. // "type": "string"
  32539. // },
  32540. // "maxResults": {
  32541. // "default": "1000",
  32542. // "description": "Maximum number of results to return.",
  32543. // "format": "int32",
  32544. // "location": "query",
  32545. // "maximum": "1000",
  32546. // "minimum": "0",
  32547. // "type": "integer"
  32548. // },
  32549. // "orderId": {
  32550. // "description": "Select only order documents for specified orders.",
  32551. // "format": "int64",
  32552. // "location": "query",
  32553. // "repeated": true,
  32554. // "type": "string"
  32555. // },
  32556. // "pageToken": {
  32557. // "description": "Value of the nextPageToken from the previous result page.",
  32558. // "location": "query",
  32559. // "type": "string"
  32560. // },
  32561. // "profileId": {
  32562. // "description": "User profile ID associated with this request.",
  32563. // "format": "int64",
  32564. // "location": "path",
  32565. // "required": true,
  32566. // "type": "string"
  32567. // },
  32568. // "projectId": {
  32569. // "description": "Project ID for order documents.",
  32570. // "format": "int64",
  32571. // "location": "path",
  32572. // "required": true,
  32573. // "type": "string"
  32574. // },
  32575. // "searchString": {
  32576. // "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\".",
  32577. // "location": "query",
  32578. // "type": "string"
  32579. // },
  32580. // "siteId": {
  32581. // "description": "Select only order documents that are associated with these sites.",
  32582. // "format": "int64",
  32583. // "location": "query",
  32584. // "repeated": true,
  32585. // "type": "string"
  32586. // },
  32587. // "sortField": {
  32588. // "default": "ID",
  32589. // "description": "Field by which to sort the list.",
  32590. // "enum": [
  32591. // "ID",
  32592. // "NAME"
  32593. // ],
  32594. // "enumDescriptions": [
  32595. // "",
  32596. // ""
  32597. // ],
  32598. // "location": "query",
  32599. // "type": "string"
  32600. // },
  32601. // "sortOrder": {
  32602. // "default": "ASCENDING",
  32603. // "description": "Order of sorted results.",
  32604. // "enum": [
  32605. // "ASCENDING",
  32606. // "DESCENDING"
  32607. // ],
  32608. // "enumDescriptions": [
  32609. // "",
  32610. // ""
  32611. // ],
  32612. // "location": "query",
  32613. // "type": "string"
  32614. // }
  32615. // },
  32616. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments",
  32617. // "response": {
  32618. // "$ref": "OrderDocumentsListResponse"
  32619. // },
  32620. // "scopes": [
  32621. // "https://www.googleapis.com/auth/dfatrafficking"
  32622. // ]
  32623. // }
  32624. }
  32625. // Pages invokes f for each page of results.
  32626. // A non-nil error returned from f will halt the iteration.
  32627. // The provided context supersedes any context provided to the Context method.
  32628. func (c *OrderDocumentsListCall) Pages(ctx context.Context, f func(*OrderDocumentsListResponse) error) error {
  32629. c.ctx_ = ctx
  32630. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32631. for {
  32632. x, err := c.Do()
  32633. if err != nil {
  32634. return err
  32635. }
  32636. if err := f(x); err != nil {
  32637. return err
  32638. }
  32639. if x.NextPageToken == "" {
  32640. return nil
  32641. }
  32642. c.PageToken(x.NextPageToken)
  32643. }
  32644. }
  32645. // method id "dfareporting.orders.get":
  32646. type OrdersGetCall struct {
  32647. s *Service
  32648. profileId int64
  32649. projectId int64
  32650. id int64
  32651. urlParams_ gensupport.URLParams
  32652. ifNoneMatch_ string
  32653. ctx_ context.Context
  32654. header_ http.Header
  32655. }
  32656. // Get: Gets one order by ID.
  32657. func (r *OrdersService) Get(profileId int64, projectId int64, id int64) *OrdersGetCall {
  32658. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32659. c.profileId = profileId
  32660. c.projectId = projectId
  32661. c.id = id
  32662. return c
  32663. }
  32664. // Fields allows partial responses to be retrieved. See
  32665. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32666. // for more information.
  32667. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  32668. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32669. return c
  32670. }
  32671. // IfNoneMatch sets the optional parameter which makes the operation
  32672. // fail if the object's ETag matches the given value. This is useful for
  32673. // getting updates only after the object has changed since the last
  32674. // request. Use googleapi.IsNotModified to check whether the response
  32675. // error from Do is the result of In-None-Match.
  32676. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  32677. c.ifNoneMatch_ = entityTag
  32678. return c
  32679. }
  32680. // Context sets the context to be used in this call's Do method. Any
  32681. // pending HTTP request will be aborted if the provided context is
  32682. // canceled.
  32683. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  32684. c.ctx_ = ctx
  32685. return c
  32686. }
  32687. // Header returns an http.Header that can be modified by the caller to
  32688. // add HTTP headers to the request.
  32689. func (c *OrdersGetCall) Header() http.Header {
  32690. if c.header_ == nil {
  32691. c.header_ = make(http.Header)
  32692. }
  32693. return c.header_
  32694. }
  32695. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  32696. reqHeaders := make(http.Header)
  32697. for k, v := range c.header_ {
  32698. reqHeaders[k] = v
  32699. }
  32700. reqHeaders.Set("User-Agent", c.s.userAgent())
  32701. if c.ifNoneMatch_ != "" {
  32702. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32703. }
  32704. var body io.Reader = nil
  32705. c.urlParams_.Set("alt", alt)
  32706. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders/{id}")
  32707. urls += "?" + c.urlParams_.Encode()
  32708. req, _ := http.NewRequest("GET", urls, body)
  32709. req.Header = reqHeaders
  32710. googleapi.Expand(req.URL, map[string]string{
  32711. "profileId": strconv.FormatInt(c.profileId, 10),
  32712. "projectId": strconv.FormatInt(c.projectId, 10),
  32713. "id": strconv.FormatInt(c.id, 10),
  32714. })
  32715. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32716. }
  32717. // Do executes the "dfareporting.orders.get" call.
  32718. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  32719. // code is an error. Response headers are in either
  32720. // *Order.ServerResponse.Header or (if a response was returned at all)
  32721. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  32722. // check whether the returned error was because http.StatusNotModified
  32723. // was returned.
  32724. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  32725. gensupport.SetOptions(c.urlParams_, opts...)
  32726. res, err := c.doRequest("json")
  32727. if res != nil && res.StatusCode == http.StatusNotModified {
  32728. if res.Body != nil {
  32729. res.Body.Close()
  32730. }
  32731. return nil, &googleapi.Error{
  32732. Code: res.StatusCode,
  32733. Header: res.Header,
  32734. }
  32735. }
  32736. if err != nil {
  32737. return nil, err
  32738. }
  32739. defer googleapi.CloseBody(res)
  32740. if err := googleapi.CheckResponse(res); err != nil {
  32741. return nil, err
  32742. }
  32743. ret := &Order{
  32744. ServerResponse: googleapi.ServerResponse{
  32745. Header: res.Header,
  32746. HTTPStatusCode: res.StatusCode,
  32747. },
  32748. }
  32749. target := &ret
  32750. if err := gensupport.DecodeResponse(target, res); err != nil {
  32751. return nil, err
  32752. }
  32753. return ret, nil
  32754. // {
  32755. // "description": "Gets one order by ID.",
  32756. // "httpMethod": "GET",
  32757. // "id": "dfareporting.orders.get",
  32758. // "parameterOrder": [
  32759. // "profileId",
  32760. // "projectId",
  32761. // "id"
  32762. // ],
  32763. // "parameters": {
  32764. // "id": {
  32765. // "description": "Order ID.",
  32766. // "format": "int64",
  32767. // "location": "path",
  32768. // "required": true,
  32769. // "type": "string"
  32770. // },
  32771. // "profileId": {
  32772. // "description": "User profile ID associated with this request.",
  32773. // "format": "int64",
  32774. // "location": "path",
  32775. // "required": true,
  32776. // "type": "string"
  32777. // },
  32778. // "projectId": {
  32779. // "description": "Project ID for orders.",
  32780. // "format": "int64",
  32781. // "location": "path",
  32782. // "required": true,
  32783. // "type": "string"
  32784. // }
  32785. // },
  32786. // "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}",
  32787. // "response": {
  32788. // "$ref": "Order"
  32789. // },
  32790. // "scopes": [
  32791. // "https://www.googleapis.com/auth/dfatrafficking"
  32792. // ]
  32793. // }
  32794. }
  32795. // method id "dfareporting.orders.list":
  32796. type OrdersListCall struct {
  32797. s *Service
  32798. profileId int64
  32799. projectId int64
  32800. urlParams_ gensupport.URLParams
  32801. ifNoneMatch_ string
  32802. ctx_ context.Context
  32803. header_ http.Header
  32804. }
  32805. // List: Retrieves a list of orders, possibly filtered. This method
  32806. // supports paging.
  32807. func (r *OrdersService) List(profileId int64, projectId int64) *OrdersListCall {
  32808. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32809. c.profileId = profileId
  32810. c.projectId = projectId
  32811. return c
  32812. }
  32813. // Ids sets the optional parameter "ids": Select only orders with these
  32814. // IDs.
  32815. func (c *OrdersListCall) Ids(ids ...int64) *OrdersListCall {
  32816. var ids_ []string
  32817. for _, v := range ids {
  32818. ids_ = append(ids_, fmt.Sprint(v))
  32819. }
  32820. c.urlParams_.SetMulti("ids", ids_)
  32821. return c
  32822. }
  32823. // MaxResults sets the optional parameter "maxResults": Maximum number
  32824. // of results to return.
  32825. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  32826. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32827. return c
  32828. }
  32829. // PageToken sets the optional parameter "pageToken": Value of the
  32830. // nextPageToken from the previous result page.
  32831. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  32832. c.urlParams_.Set("pageToken", pageToken)
  32833. return c
  32834. }
  32835. // SearchString sets the optional parameter "searchString": Allows
  32836. // searching for orders by name or ID. Wildcards (*) are allowed. For
  32837. // example, "order*2015" will return orders with names like "order June
  32838. // 2015", "order April 2015", or simply "order 2015". Most of the
  32839. // searches also add wildcards implicitly at the start and the end of
  32840. // the search string. For example, a search string of "order" will match
  32841. // orders with name "my order", "order 2015", or simply "order".
  32842. func (c *OrdersListCall) SearchString(searchString string) *OrdersListCall {
  32843. c.urlParams_.Set("searchString", searchString)
  32844. return c
  32845. }
  32846. // SiteId sets the optional parameter "siteId": Select only orders that
  32847. // are associated with these site IDs.
  32848. func (c *OrdersListCall) SiteId(siteId ...int64) *OrdersListCall {
  32849. var siteId_ []string
  32850. for _, v := range siteId {
  32851. siteId_ = append(siteId_, fmt.Sprint(v))
  32852. }
  32853. c.urlParams_.SetMulti("siteId", siteId_)
  32854. return c
  32855. }
  32856. // SortField sets the optional parameter "sortField": Field by which to
  32857. // sort the list.
  32858. //
  32859. // Possible values:
  32860. // "ID" (default)
  32861. // "NAME"
  32862. func (c *OrdersListCall) SortField(sortField string) *OrdersListCall {
  32863. c.urlParams_.Set("sortField", sortField)
  32864. return c
  32865. }
  32866. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  32867. // results.
  32868. //
  32869. // Possible values:
  32870. // "ASCENDING" (default)
  32871. // "DESCENDING"
  32872. func (c *OrdersListCall) SortOrder(sortOrder string) *OrdersListCall {
  32873. c.urlParams_.Set("sortOrder", sortOrder)
  32874. return c
  32875. }
  32876. // Fields allows partial responses to be retrieved. See
  32877. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32878. // for more information.
  32879. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  32880. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32881. return c
  32882. }
  32883. // IfNoneMatch sets the optional parameter which makes the operation
  32884. // fail if the object's ETag matches the given value. This is useful for
  32885. // getting updates only after the object has changed since the last
  32886. // request. Use googleapi.IsNotModified to check whether the response
  32887. // error from Do is the result of In-None-Match.
  32888. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  32889. c.ifNoneMatch_ = entityTag
  32890. return c
  32891. }
  32892. // Context sets the context to be used in this call's Do method. Any
  32893. // pending HTTP request will be aborted if the provided context is
  32894. // canceled.
  32895. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  32896. c.ctx_ = ctx
  32897. return c
  32898. }
  32899. // Header returns an http.Header that can be modified by the caller to
  32900. // add HTTP headers to the request.
  32901. func (c *OrdersListCall) Header() http.Header {
  32902. if c.header_ == nil {
  32903. c.header_ = make(http.Header)
  32904. }
  32905. return c.header_
  32906. }
  32907. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  32908. reqHeaders := make(http.Header)
  32909. for k, v := range c.header_ {
  32910. reqHeaders[k] = v
  32911. }
  32912. reqHeaders.Set("User-Agent", c.s.userAgent())
  32913. if c.ifNoneMatch_ != "" {
  32914. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32915. }
  32916. var body io.Reader = nil
  32917. c.urlParams_.Set("alt", alt)
  32918. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders")
  32919. urls += "?" + c.urlParams_.Encode()
  32920. req, _ := http.NewRequest("GET", urls, body)
  32921. req.Header = reqHeaders
  32922. googleapi.Expand(req.URL, map[string]string{
  32923. "profileId": strconv.FormatInt(c.profileId, 10),
  32924. "projectId": strconv.FormatInt(c.projectId, 10),
  32925. })
  32926. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32927. }
  32928. // Do executes the "dfareporting.orders.list" call.
  32929. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  32930. // non-2xx status code is an error. Response headers are in either
  32931. // *OrdersListResponse.ServerResponse.Header or (if a response was
  32932. // returned at all) in error.(*googleapi.Error).Header. Use
  32933. // googleapi.IsNotModified to check whether the returned error was
  32934. // because http.StatusNotModified was returned.
  32935. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  32936. gensupport.SetOptions(c.urlParams_, opts...)
  32937. res, err := c.doRequest("json")
  32938. if res != nil && res.StatusCode == http.StatusNotModified {
  32939. if res.Body != nil {
  32940. res.Body.Close()
  32941. }
  32942. return nil, &googleapi.Error{
  32943. Code: res.StatusCode,
  32944. Header: res.Header,
  32945. }
  32946. }
  32947. if err != nil {
  32948. return nil, err
  32949. }
  32950. defer googleapi.CloseBody(res)
  32951. if err := googleapi.CheckResponse(res); err != nil {
  32952. return nil, err
  32953. }
  32954. ret := &OrdersListResponse{
  32955. ServerResponse: googleapi.ServerResponse{
  32956. Header: res.Header,
  32957. HTTPStatusCode: res.StatusCode,
  32958. },
  32959. }
  32960. target := &ret
  32961. if err := gensupport.DecodeResponse(target, res); err != nil {
  32962. return nil, err
  32963. }
  32964. return ret, nil
  32965. // {
  32966. // "description": "Retrieves a list of orders, possibly filtered. This method supports paging.",
  32967. // "httpMethod": "GET",
  32968. // "id": "dfareporting.orders.list",
  32969. // "parameterOrder": [
  32970. // "profileId",
  32971. // "projectId"
  32972. // ],
  32973. // "parameters": {
  32974. // "ids": {
  32975. // "description": "Select only orders with these IDs.",
  32976. // "format": "int64",
  32977. // "location": "query",
  32978. // "repeated": true,
  32979. // "type": "string"
  32980. // },
  32981. // "maxResults": {
  32982. // "default": "1000",
  32983. // "description": "Maximum number of results to return.",
  32984. // "format": "int32",
  32985. // "location": "query",
  32986. // "maximum": "1000",
  32987. // "minimum": "0",
  32988. // "type": "integer"
  32989. // },
  32990. // "pageToken": {
  32991. // "description": "Value of the nextPageToken from the previous result page.",
  32992. // "location": "query",
  32993. // "type": "string"
  32994. // },
  32995. // "profileId": {
  32996. // "description": "User profile ID associated with this request.",
  32997. // "format": "int64",
  32998. // "location": "path",
  32999. // "required": true,
  33000. // "type": "string"
  33001. // },
  33002. // "projectId": {
  33003. // "description": "Project ID for orders.",
  33004. // "format": "int64",
  33005. // "location": "path",
  33006. // "required": true,
  33007. // "type": "string"
  33008. // },
  33009. // "searchString": {
  33010. // "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\".",
  33011. // "location": "query",
  33012. // "type": "string"
  33013. // },
  33014. // "siteId": {
  33015. // "description": "Select only orders that are associated with these site IDs.",
  33016. // "format": "int64",
  33017. // "location": "query",
  33018. // "repeated": true,
  33019. // "type": "string"
  33020. // },
  33021. // "sortField": {
  33022. // "default": "ID",
  33023. // "description": "Field by which to sort the list.",
  33024. // "enum": [
  33025. // "ID",
  33026. // "NAME"
  33027. // ],
  33028. // "enumDescriptions": [
  33029. // "",
  33030. // ""
  33031. // ],
  33032. // "location": "query",
  33033. // "type": "string"
  33034. // },
  33035. // "sortOrder": {
  33036. // "default": "ASCENDING",
  33037. // "description": "Order of sorted results.",
  33038. // "enum": [
  33039. // "ASCENDING",
  33040. // "DESCENDING"
  33041. // ],
  33042. // "enumDescriptions": [
  33043. // "",
  33044. // ""
  33045. // ],
  33046. // "location": "query",
  33047. // "type": "string"
  33048. // }
  33049. // },
  33050. // "path": "userprofiles/{profileId}/projects/{projectId}/orders",
  33051. // "response": {
  33052. // "$ref": "OrdersListResponse"
  33053. // },
  33054. // "scopes": [
  33055. // "https://www.googleapis.com/auth/dfatrafficking"
  33056. // ]
  33057. // }
  33058. }
  33059. // Pages invokes f for each page of results.
  33060. // A non-nil error returned from f will halt the iteration.
  33061. // The provided context supersedes any context provided to the Context method.
  33062. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  33063. c.ctx_ = ctx
  33064. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33065. for {
  33066. x, err := c.Do()
  33067. if err != nil {
  33068. return err
  33069. }
  33070. if err := f(x); err != nil {
  33071. return err
  33072. }
  33073. if x.NextPageToken == "" {
  33074. return nil
  33075. }
  33076. c.PageToken(x.NextPageToken)
  33077. }
  33078. }
  33079. // method id "dfareporting.placementGroups.get":
  33080. type PlacementGroupsGetCall struct {
  33081. s *Service
  33082. profileId int64
  33083. id int64
  33084. urlParams_ gensupport.URLParams
  33085. ifNoneMatch_ string
  33086. ctx_ context.Context
  33087. header_ http.Header
  33088. }
  33089. // Get: Gets one placement group by ID.
  33090. func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall {
  33091. c := &PlacementGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33092. c.profileId = profileId
  33093. c.id = id
  33094. return c
  33095. }
  33096. // Fields allows partial responses to be retrieved. See
  33097. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33098. // for more information.
  33099. func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall {
  33100. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33101. return c
  33102. }
  33103. // IfNoneMatch sets the optional parameter which makes the operation
  33104. // fail if the object's ETag matches the given value. This is useful for
  33105. // getting updates only after the object has changed since the last
  33106. // request. Use googleapi.IsNotModified to check whether the response
  33107. // error from Do is the result of In-None-Match.
  33108. func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall {
  33109. c.ifNoneMatch_ = entityTag
  33110. return c
  33111. }
  33112. // Context sets the context to be used in this call's Do method. Any
  33113. // pending HTTP request will be aborted if the provided context is
  33114. // canceled.
  33115. func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall {
  33116. c.ctx_ = ctx
  33117. return c
  33118. }
  33119. // Header returns an http.Header that can be modified by the caller to
  33120. // add HTTP headers to the request.
  33121. func (c *PlacementGroupsGetCall) Header() http.Header {
  33122. if c.header_ == nil {
  33123. c.header_ = make(http.Header)
  33124. }
  33125. return c.header_
  33126. }
  33127. func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  33128. reqHeaders := make(http.Header)
  33129. for k, v := range c.header_ {
  33130. reqHeaders[k] = v
  33131. }
  33132. reqHeaders.Set("User-Agent", c.s.userAgent())
  33133. if c.ifNoneMatch_ != "" {
  33134. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33135. }
  33136. var body io.Reader = nil
  33137. c.urlParams_.Set("alt", alt)
  33138. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}")
  33139. urls += "?" + c.urlParams_.Encode()
  33140. req, _ := http.NewRequest("GET", urls, body)
  33141. req.Header = reqHeaders
  33142. googleapi.Expand(req.URL, map[string]string{
  33143. "profileId": strconv.FormatInt(c.profileId, 10),
  33144. "id": strconv.FormatInt(c.id, 10),
  33145. })
  33146. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33147. }
  33148. // Do executes the "dfareporting.placementGroups.get" call.
  33149. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33150. // status code is an error. Response headers are in either
  33151. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33152. // at all) in error.(*googleapi.Error).Header. Use
  33153. // googleapi.IsNotModified to check whether the returned error was
  33154. // because http.StatusNotModified was returned.
  33155. func (c *PlacementGroupsGetCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33156. gensupport.SetOptions(c.urlParams_, opts...)
  33157. res, err := c.doRequest("json")
  33158. if res != nil && res.StatusCode == http.StatusNotModified {
  33159. if res.Body != nil {
  33160. res.Body.Close()
  33161. }
  33162. return nil, &googleapi.Error{
  33163. Code: res.StatusCode,
  33164. Header: res.Header,
  33165. }
  33166. }
  33167. if err != nil {
  33168. return nil, err
  33169. }
  33170. defer googleapi.CloseBody(res)
  33171. if err := googleapi.CheckResponse(res); err != nil {
  33172. return nil, err
  33173. }
  33174. ret := &PlacementGroup{
  33175. ServerResponse: googleapi.ServerResponse{
  33176. Header: res.Header,
  33177. HTTPStatusCode: res.StatusCode,
  33178. },
  33179. }
  33180. target := &ret
  33181. if err := gensupport.DecodeResponse(target, res); err != nil {
  33182. return nil, err
  33183. }
  33184. return ret, nil
  33185. // {
  33186. // "description": "Gets one placement group by ID.",
  33187. // "httpMethod": "GET",
  33188. // "id": "dfareporting.placementGroups.get",
  33189. // "parameterOrder": [
  33190. // "profileId",
  33191. // "id"
  33192. // ],
  33193. // "parameters": {
  33194. // "id": {
  33195. // "description": "Placement group ID.",
  33196. // "format": "int64",
  33197. // "location": "path",
  33198. // "required": true,
  33199. // "type": "string"
  33200. // },
  33201. // "profileId": {
  33202. // "description": "User profile ID associated with this request.",
  33203. // "format": "int64",
  33204. // "location": "path",
  33205. // "required": true,
  33206. // "type": "string"
  33207. // }
  33208. // },
  33209. // "path": "userprofiles/{profileId}/placementGroups/{id}",
  33210. // "response": {
  33211. // "$ref": "PlacementGroup"
  33212. // },
  33213. // "scopes": [
  33214. // "https://www.googleapis.com/auth/dfatrafficking"
  33215. // ]
  33216. // }
  33217. }
  33218. // method id "dfareporting.placementGroups.insert":
  33219. type PlacementGroupsInsertCall struct {
  33220. s *Service
  33221. profileId int64
  33222. placementgroup *PlacementGroup
  33223. urlParams_ gensupport.URLParams
  33224. ctx_ context.Context
  33225. header_ http.Header
  33226. }
  33227. // Insert: Inserts a new placement group.
  33228. func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall {
  33229. c := &PlacementGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33230. c.profileId = profileId
  33231. c.placementgroup = placementgroup
  33232. return c
  33233. }
  33234. // Fields allows partial responses to be retrieved. See
  33235. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33236. // for more information.
  33237. func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall {
  33238. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33239. return c
  33240. }
  33241. // Context sets the context to be used in this call's Do method. Any
  33242. // pending HTTP request will be aborted if the provided context is
  33243. // canceled.
  33244. func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall {
  33245. c.ctx_ = ctx
  33246. return c
  33247. }
  33248. // Header returns an http.Header that can be modified by the caller to
  33249. // add HTTP headers to the request.
  33250. func (c *PlacementGroupsInsertCall) Header() http.Header {
  33251. if c.header_ == nil {
  33252. c.header_ = make(http.Header)
  33253. }
  33254. return c.header_
  33255. }
  33256. func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  33257. reqHeaders := make(http.Header)
  33258. for k, v := range c.header_ {
  33259. reqHeaders[k] = v
  33260. }
  33261. reqHeaders.Set("User-Agent", c.s.userAgent())
  33262. var body io.Reader = nil
  33263. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  33264. if err != nil {
  33265. return nil, err
  33266. }
  33267. reqHeaders.Set("Content-Type", "application/json")
  33268. c.urlParams_.Set("alt", alt)
  33269. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33270. urls += "?" + c.urlParams_.Encode()
  33271. req, _ := http.NewRequest("POST", urls, body)
  33272. req.Header = reqHeaders
  33273. googleapi.Expand(req.URL, map[string]string{
  33274. "profileId": strconv.FormatInt(c.profileId, 10),
  33275. })
  33276. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33277. }
  33278. // Do executes the "dfareporting.placementGroups.insert" call.
  33279. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33280. // status code is an error. Response headers are in either
  33281. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33282. // at all) in error.(*googleapi.Error).Header. Use
  33283. // googleapi.IsNotModified to check whether the returned error was
  33284. // because http.StatusNotModified was returned.
  33285. func (c *PlacementGroupsInsertCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33286. gensupport.SetOptions(c.urlParams_, opts...)
  33287. res, err := c.doRequest("json")
  33288. if res != nil && res.StatusCode == http.StatusNotModified {
  33289. if res.Body != nil {
  33290. res.Body.Close()
  33291. }
  33292. return nil, &googleapi.Error{
  33293. Code: res.StatusCode,
  33294. Header: res.Header,
  33295. }
  33296. }
  33297. if err != nil {
  33298. return nil, err
  33299. }
  33300. defer googleapi.CloseBody(res)
  33301. if err := googleapi.CheckResponse(res); err != nil {
  33302. return nil, err
  33303. }
  33304. ret := &PlacementGroup{
  33305. ServerResponse: googleapi.ServerResponse{
  33306. Header: res.Header,
  33307. HTTPStatusCode: res.StatusCode,
  33308. },
  33309. }
  33310. target := &ret
  33311. if err := gensupport.DecodeResponse(target, res); err != nil {
  33312. return nil, err
  33313. }
  33314. return ret, nil
  33315. // {
  33316. // "description": "Inserts a new placement group.",
  33317. // "httpMethod": "POST",
  33318. // "id": "dfareporting.placementGroups.insert",
  33319. // "parameterOrder": [
  33320. // "profileId"
  33321. // ],
  33322. // "parameters": {
  33323. // "profileId": {
  33324. // "description": "User profile ID associated with this request.",
  33325. // "format": "int64",
  33326. // "location": "path",
  33327. // "required": true,
  33328. // "type": "string"
  33329. // }
  33330. // },
  33331. // "path": "userprofiles/{profileId}/placementGroups",
  33332. // "request": {
  33333. // "$ref": "PlacementGroup"
  33334. // },
  33335. // "response": {
  33336. // "$ref": "PlacementGroup"
  33337. // },
  33338. // "scopes": [
  33339. // "https://www.googleapis.com/auth/dfatrafficking"
  33340. // ]
  33341. // }
  33342. }
  33343. // method id "dfareporting.placementGroups.list":
  33344. type PlacementGroupsListCall struct {
  33345. s *Service
  33346. profileId int64
  33347. urlParams_ gensupport.URLParams
  33348. ifNoneMatch_ string
  33349. ctx_ context.Context
  33350. header_ http.Header
  33351. }
  33352. // List: Retrieves a list of placement groups, possibly filtered. This
  33353. // method supports paging.
  33354. func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall {
  33355. c := &PlacementGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33356. c.profileId = profileId
  33357. return c
  33358. }
  33359. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  33360. // only placement groups that belong to these advertisers.
  33361. func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementGroupsListCall {
  33362. var advertiserIds_ []string
  33363. for _, v := range advertiserIds {
  33364. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  33365. }
  33366. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  33367. return c
  33368. }
  33369. // Archived sets the optional parameter "archived": Select only archived
  33370. // placements. Don't set this field to select both archived and
  33371. // non-archived placements.
  33372. func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall {
  33373. c.urlParams_.Set("archived", fmt.Sprint(archived))
  33374. return c
  33375. }
  33376. // CampaignIds sets the optional parameter "campaignIds": Select only
  33377. // placement groups that belong to these campaigns.
  33378. func (c *PlacementGroupsListCall) CampaignIds(campaignIds ...int64) *PlacementGroupsListCall {
  33379. var campaignIds_ []string
  33380. for _, v := range campaignIds {
  33381. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  33382. }
  33383. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  33384. return c
  33385. }
  33386. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  33387. // Select only placement groups that are associated with these content
  33388. // categories.
  33389. func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementGroupsListCall {
  33390. var contentCategoryIds_ []string
  33391. for _, v := range contentCategoryIds {
  33392. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  33393. }
  33394. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  33395. return c
  33396. }
  33397. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  33398. // Select only placement groups that are associated with these directory
  33399. // sites.
  33400. func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementGroupsListCall {
  33401. var directorySiteIds_ []string
  33402. for _, v := range directorySiteIds {
  33403. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  33404. }
  33405. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  33406. return c
  33407. }
  33408. // Ids sets the optional parameter "ids": Select only placement groups
  33409. // with these IDs.
  33410. func (c *PlacementGroupsListCall) Ids(ids ...int64) *PlacementGroupsListCall {
  33411. var ids_ []string
  33412. for _, v := range ids {
  33413. ids_ = append(ids_, fmt.Sprint(v))
  33414. }
  33415. c.urlParams_.SetMulti("ids", ids_)
  33416. return c
  33417. }
  33418. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  33419. // placements or placement groups whose end date is on or before the
  33420. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  33421. func (c *PlacementGroupsListCall) MaxEndDate(maxEndDate string) *PlacementGroupsListCall {
  33422. c.urlParams_.Set("maxEndDate", maxEndDate)
  33423. return c
  33424. }
  33425. // MaxResults sets the optional parameter "maxResults": Maximum number
  33426. // of results to return.
  33427. func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall {
  33428. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33429. return c
  33430. }
  33431. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  33432. // placements or placement groups whose start date is on or before the
  33433. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  33434. func (c *PlacementGroupsListCall) MaxStartDate(maxStartDate string) *PlacementGroupsListCall {
  33435. c.urlParams_.Set("maxStartDate", maxStartDate)
  33436. return c
  33437. }
  33438. // MinEndDate sets the optional parameter "minEndDate": Select only
  33439. // placements or placement groups whose end date is on or after the
  33440. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  33441. func (c *PlacementGroupsListCall) MinEndDate(minEndDate string) *PlacementGroupsListCall {
  33442. c.urlParams_.Set("minEndDate", minEndDate)
  33443. return c
  33444. }
  33445. // MinStartDate sets the optional parameter "minStartDate": Select only
  33446. // placements or placement groups whose start date is on or after the
  33447. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  33448. func (c *PlacementGroupsListCall) MinStartDate(minStartDate string) *PlacementGroupsListCall {
  33449. c.urlParams_.Set("minStartDate", minStartDate)
  33450. return c
  33451. }
  33452. // PageToken sets the optional parameter "pageToken": Value of the
  33453. // nextPageToken from the previous result page.
  33454. func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall {
  33455. c.urlParams_.Set("pageToken", pageToken)
  33456. return c
  33457. }
  33458. // PlacementGroupType sets the optional parameter "placementGroupType":
  33459. // Select only placement groups belonging with this group type. A
  33460. // package is a simple group of placements that acts as a single pricing
  33461. // point for a group of tags. A roadblock is a group of placements that
  33462. // not only acts as a single pricing point but also assumes that all the
  33463. // tags in it will be served at the same time. A roadblock requires one
  33464. // of its assigned placements to be marked as primary for reporting.
  33465. //
  33466. // Possible values:
  33467. // "PLACEMENT_PACKAGE"
  33468. // "PLACEMENT_ROADBLOCK"
  33469. func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall {
  33470. c.urlParams_.Set("placementGroupType", placementGroupType)
  33471. return c
  33472. }
  33473. // PlacementStrategyIds sets the optional parameter
  33474. // "placementStrategyIds": Select only placement groups that are
  33475. // associated with these placement strategies.
  33476. func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementGroupsListCall {
  33477. var placementStrategyIds_ []string
  33478. for _, v := range placementStrategyIds {
  33479. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  33480. }
  33481. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  33482. return c
  33483. }
  33484. // PricingTypes sets the optional parameter "pricingTypes": Select only
  33485. // placement groups with these pricing types.
  33486. //
  33487. // Possible values:
  33488. // "PRICING_TYPE_CPA"
  33489. // "PRICING_TYPE_CPC"
  33490. // "PRICING_TYPE_CPM"
  33491. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  33492. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  33493. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  33494. func (c *PlacementGroupsListCall) PricingTypes(pricingTypes ...string) *PlacementGroupsListCall {
  33495. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  33496. return c
  33497. }
  33498. // SearchString sets the optional parameter "searchString": Allows
  33499. // searching for placement groups by name or ID. Wildcards (*) are
  33500. // allowed. For example, "placement*2015" will return placement groups
  33501. // with names like "placement group June 2015", "placement group May
  33502. // 2015", or simply "placements 2015". Most of the searches also add
  33503. // wildcards implicitly at the start and the end of the search string.
  33504. // For example, a search string of "placementgroup" will match placement
  33505. // groups with name "my placementgroup", "placementgroup 2015", or
  33506. // simply "placementgroup".
  33507. func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall {
  33508. c.urlParams_.Set("searchString", searchString)
  33509. return c
  33510. }
  33511. // SiteIds sets the optional parameter "siteIds": Select only placement
  33512. // groups that are associated with these sites.
  33513. func (c *PlacementGroupsListCall) SiteIds(siteIds ...int64) *PlacementGroupsListCall {
  33514. var siteIds_ []string
  33515. for _, v := range siteIds {
  33516. siteIds_ = append(siteIds_, fmt.Sprint(v))
  33517. }
  33518. c.urlParams_.SetMulti("siteIds", siteIds_)
  33519. return c
  33520. }
  33521. // SortField sets the optional parameter "sortField": Field by which to
  33522. // sort the list.
  33523. //
  33524. // Possible values:
  33525. // "ID" (default)
  33526. // "NAME"
  33527. func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall {
  33528. c.urlParams_.Set("sortField", sortField)
  33529. return c
  33530. }
  33531. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33532. // results.
  33533. //
  33534. // Possible values:
  33535. // "ASCENDING" (default)
  33536. // "DESCENDING"
  33537. func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall {
  33538. c.urlParams_.Set("sortOrder", sortOrder)
  33539. return c
  33540. }
  33541. // Fields allows partial responses to be retrieved. See
  33542. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33543. // for more information.
  33544. func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall {
  33545. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33546. return c
  33547. }
  33548. // IfNoneMatch sets the optional parameter which makes the operation
  33549. // fail if the object's ETag matches the given value. This is useful for
  33550. // getting updates only after the object has changed since the last
  33551. // request. Use googleapi.IsNotModified to check whether the response
  33552. // error from Do is the result of In-None-Match.
  33553. func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall {
  33554. c.ifNoneMatch_ = entityTag
  33555. return c
  33556. }
  33557. // Context sets the context to be used in this call's Do method. Any
  33558. // pending HTTP request will be aborted if the provided context is
  33559. // canceled.
  33560. func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall {
  33561. c.ctx_ = ctx
  33562. return c
  33563. }
  33564. // Header returns an http.Header that can be modified by the caller to
  33565. // add HTTP headers to the request.
  33566. func (c *PlacementGroupsListCall) Header() http.Header {
  33567. if c.header_ == nil {
  33568. c.header_ = make(http.Header)
  33569. }
  33570. return c.header_
  33571. }
  33572. func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) {
  33573. reqHeaders := make(http.Header)
  33574. for k, v := range c.header_ {
  33575. reqHeaders[k] = v
  33576. }
  33577. reqHeaders.Set("User-Agent", c.s.userAgent())
  33578. if c.ifNoneMatch_ != "" {
  33579. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33580. }
  33581. var body io.Reader = nil
  33582. c.urlParams_.Set("alt", alt)
  33583. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33584. urls += "?" + c.urlParams_.Encode()
  33585. req, _ := http.NewRequest("GET", urls, body)
  33586. req.Header = reqHeaders
  33587. googleapi.Expand(req.URL, map[string]string{
  33588. "profileId": strconv.FormatInt(c.profileId, 10),
  33589. })
  33590. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33591. }
  33592. // Do executes the "dfareporting.placementGroups.list" call.
  33593. // Exactly one of *PlacementGroupsListResponse or error will be non-nil.
  33594. // Any non-2xx status code is an error. Response headers are in either
  33595. // *PlacementGroupsListResponse.ServerResponse.Header or (if a response
  33596. // was returned at all) in error.(*googleapi.Error).Header. Use
  33597. // googleapi.IsNotModified to check whether the returned error was
  33598. // because http.StatusNotModified was returned.
  33599. func (c *PlacementGroupsListCall) Do(opts ...googleapi.CallOption) (*PlacementGroupsListResponse, error) {
  33600. gensupport.SetOptions(c.urlParams_, opts...)
  33601. res, err := c.doRequest("json")
  33602. if res != nil && res.StatusCode == http.StatusNotModified {
  33603. if res.Body != nil {
  33604. res.Body.Close()
  33605. }
  33606. return nil, &googleapi.Error{
  33607. Code: res.StatusCode,
  33608. Header: res.Header,
  33609. }
  33610. }
  33611. if err != nil {
  33612. return nil, err
  33613. }
  33614. defer googleapi.CloseBody(res)
  33615. if err := googleapi.CheckResponse(res); err != nil {
  33616. return nil, err
  33617. }
  33618. ret := &PlacementGroupsListResponse{
  33619. ServerResponse: googleapi.ServerResponse{
  33620. Header: res.Header,
  33621. HTTPStatusCode: res.StatusCode,
  33622. },
  33623. }
  33624. target := &ret
  33625. if err := gensupport.DecodeResponse(target, res); err != nil {
  33626. return nil, err
  33627. }
  33628. return ret, nil
  33629. // {
  33630. // "description": "Retrieves a list of placement groups, possibly filtered. This method supports paging.",
  33631. // "httpMethod": "GET",
  33632. // "id": "dfareporting.placementGroups.list",
  33633. // "parameterOrder": [
  33634. // "profileId"
  33635. // ],
  33636. // "parameters": {
  33637. // "advertiserIds": {
  33638. // "description": "Select only placement groups that belong to these advertisers.",
  33639. // "format": "int64",
  33640. // "location": "query",
  33641. // "repeated": true,
  33642. // "type": "string"
  33643. // },
  33644. // "archived": {
  33645. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  33646. // "location": "query",
  33647. // "type": "boolean"
  33648. // },
  33649. // "campaignIds": {
  33650. // "description": "Select only placement groups that belong to these campaigns.",
  33651. // "format": "int64",
  33652. // "location": "query",
  33653. // "repeated": true,
  33654. // "type": "string"
  33655. // },
  33656. // "contentCategoryIds": {
  33657. // "description": "Select only placement groups that are associated with these content categories.",
  33658. // "format": "int64",
  33659. // "location": "query",
  33660. // "repeated": true,
  33661. // "type": "string"
  33662. // },
  33663. // "directorySiteIds": {
  33664. // "description": "Select only placement groups that are associated with these directory sites.",
  33665. // "format": "int64",
  33666. // "location": "query",
  33667. // "repeated": true,
  33668. // "type": "string"
  33669. // },
  33670. // "ids": {
  33671. // "description": "Select only placement groups with these IDs.",
  33672. // "format": "int64",
  33673. // "location": "query",
  33674. // "repeated": true,
  33675. // "type": "string"
  33676. // },
  33677. // "maxEndDate": {
  33678. // "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\".",
  33679. // "location": "query",
  33680. // "type": "string"
  33681. // },
  33682. // "maxResults": {
  33683. // "default": "800",
  33684. // "description": "Maximum number of results to return.",
  33685. // "format": "int32",
  33686. // "location": "query",
  33687. // "maximum": "800",
  33688. // "minimum": "0",
  33689. // "type": "integer"
  33690. // },
  33691. // "maxStartDate": {
  33692. // "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\".",
  33693. // "location": "query",
  33694. // "type": "string"
  33695. // },
  33696. // "minEndDate": {
  33697. // "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\".",
  33698. // "location": "query",
  33699. // "type": "string"
  33700. // },
  33701. // "minStartDate": {
  33702. // "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\".",
  33703. // "location": "query",
  33704. // "type": "string"
  33705. // },
  33706. // "pageToken": {
  33707. // "description": "Value of the nextPageToken from the previous result page.",
  33708. // "location": "query",
  33709. // "type": "string"
  33710. // },
  33711. // "placementGroupType": {
  33712. // "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.",
  33713. // "enum": [
  33714. // "PLACEMENT_PACKAGE",
  33715. // "PLACEMENT_ROADBLOCK"
  33716. // ],
  33717. // "enumDescriptions": [
  33718. // "",
  33719. // ""
  33720. // ],
  33721. // "location": "query",
  33722. // "type": "string"
  33723. // },
  33724. // "placementStrategyIds": {
  33725. // "description": "Select only placement groups that are associated with these placement strategies.",
  33726. // "format": "int64",
  33727. // "location": "query",
  33728. // "repeated": true,
  33729. // "type": "string"
  33730. // },
  33731. // "pricingTypes": {
  33732. // "description": "Select only placement groups with these pricing types.",
  33733. // "enum": [
  33734. // "PRICING_TYPE_CPA",
  33735. // "PRICING_TYPE_CPC",
  33736. // "PRICING_TYPE_CPM",
  33737. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  33738. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  33739. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  33740. // ],
  33741. // "enumDescriptions": [
  33742. // "",
  33743. // "",
  33744. // "",
  33745. // "",
  33746. // "",
  33747. // ""
  33748. // ],
  33749. // "location": "query",
  33750. // "repeated": true,
  33751. // "type": "string"
  33752. // },
  33753. // "profileId": {
  33754. // "description": "User profile ID associated with this request.",
  33755. // "format": "int64",
  33756. // "location": "path",
  33757. // "required": true,
  33758. // "type": "string"
  33759. // },
  33760. // "searchString": {
  33761. // "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\".",
  33762. // "location": "query",
  33763. // "type": "string"
  33764. // },
  33765. // "siteIds": {
  33766. // "description": "Select only placement groups that are associated with these sites.",
  33767. // "format": "int64",
  33768. // "location": "query",
  33769. // "repeated": true,
  33770. // "type": "string"
  33771. // },
  33772. // "sortField": {
  33773. // "default": "ID",
  33774. // "description": "Field by which to sort the list.",
  33775. // "enum": [
  33776. // "ID",
  33777. // "NAME"
  33778. // ],
  33779. // "enumDescriptions": [
  33780. // "",
  33781. // ""
  33782. // ],
  33783. // "location": "query",
  33784. // "type": "string"
  33785. // },
  33786. // "sortOrder": {
  33787. // "default": "ASCENDING",
  33788. // "description": "Order of sorted results.",
  33789. // "enum": [
  33790. // "ASCENDING",
  33791. // "DESCENDING"
  33792. // ],
  33793. // "enumDescriptions": [
  33794. // "",
  33795. // ""
  33796. // ],
  33797. // "location": "query",
  33798. // "type": "string"
  33799. // }
  33800. // },
  33801. // "path": "userprofiles/{profileId}/placementGroups",
  33802. // "response": {
  33803. // "$ref": "PlacementGroupsListResponse"
  33804. // },
  33805. // "scopes": [
  33806. // "https://www.googleapis.com/auth/dfatrafficking"
  33807. // ]
  33808. // }
  33809. }
  33810. // Pages invokes f for each page of results.
  33811. // A non-nil error returned from f will halt the iteration.
  33812. // The provided context supersedes any context provided to the Context method.
  33813. func (c *PlacementGroupsListCall) Pages(ctx context.Context, f func(*PlacementGroupsListResponse) error) error {
  33814. c.ctx_ = ctx
  33815. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33816. for {
  33817. x, err := c.Do()
  33818. if err != nil {
  33819. return err
  33820. }
  33821. if err := f(x); err != nil {
  33822. return err
  33823. }
  33824. if x.NextPageToken == "" {
  33825. return nil
  33826. }
  33827. c.PageToken(x.NextPageToken)
  33828. }
  33829. }
  33830. // method id "dfareporting.placementGroups.patch":
  33831. type PlacementGroupsPatchCall struct {
  33832. s *Service
  33833. profileId int64
  33834. placementgroup *PlacementGroup
  33835. urlParams_ gensupport.URLParams
  33836. ctx_ context.Context
  33837. header_ http.Header
  33838. }
  33839. // Patch: Updates an existing placement group. This method supports
  33840. // patch semantics.
  33841. func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall {
  33842. c := &PlacementGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33843. c.profileId = profileId
  33844. c.urlParams_.Set("id", fmt.Sprint(id))
  33845. c.placementgroup = placementgroup
  33846. return c
  33847. }
  33848. // Fields allows partial responses to be retrieved. See
  33849. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33850. // for more information.
  33851. func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall {
  33852. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33853. return c
  33854. }
  33855. // Context sets the context to be used in this call's Do method. Any
  33856. // pending HTTP request will be aborted if the provided context is
  33857. // canceled.
  33858. func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall {
  33859. c.ctx_ = ctx
  33860. return c
  33861. }
  33862. // Header returns an http.Header that can be modified by the caller to
  33863. // add HTTP headers to the request.
  33864. func (c *PlacementGroupsPatchCall) Header() http.Header {
  33865. if c.header_ == nil {
  33866. c.header_ = make(http.Header)
  33867. }
  33868. return c.header_
  33869. }
  33870. func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  33871. reqHeaders := make(http.Header)
  33872. for k, v := range c.header_ {
  33873. reqHeaders[k] = v
  33874. }
  33875. reqHeaders.Set("User-Agent", c.s.userAgent())
  33876. var body io.Reader = nil
  33877. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  33878. if err != nil {
  33879. return nil, err
  33880. }
  33881. reqHeaders.Set("Content-Type", "application/json")
  33882. c.urlParams_.Set("alt", alt)
  33883. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33884. urls += "?" + c.urlParams_.Encode()
  33885. req, _ := http.NewRequest("PATCH", urls, body)
  33886. req.Header = reqHeaders
  33887. googleapi.Expand(req.URL, map[string]string{
  33888. "profileId": strconv.FormatInt(c.profileId, 10),
  33889. })
  33890. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33891. }
  33892. // Do executes the "dfareporting.placementGroups.patch" call.
  33893. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33894. // status code is an error. Response headers are in either
  33895. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33896. // at all) in error.(*googleapi.Error).Header. Use
  33897. // googleapi.IsNotModified to check whether the returned error was
  33898. // because http.StatusNotModified was returned.
  33899. func (c *PlacementGroupsPatchCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33900. gensupport.SetOptions(c.urlParams_, opts...)
  33901. res, err := c.doRequest("json")
  33902. if res != nil && res.StatusCode == http.StatusNotModified {
  33903. if res.Body != nil {
  33904. res.Body.Close()
  33905. }
  33906. return nil, &googleapi.Error{
  33907. Code: res.StatusCode,
  33908. Header: res.Header,
  33909. }
  33910. }
  33911. if err != nil {
  33912. return nil, err
  33913. }
  33914. defer googleapi.CloseBody(res)
  33915. if err := googleapi.CheckResponse(res); err != nil {
  33916. return nil, err
  33917. }
  33918. ret := &PlacementGroup{
  33919. ServerResponse: googleapi.ServerResponse{
  33920. Header: res.Header,
  33921. HTTPStatusCode: res.StatusCode,
  33922. },
  33923. }
  33924. target := &ret
  33925. if err := gensupport.DecodeResponse(target, res); err != nil {
  33926. return nil, err
  33927. }
  33928. return ret, nil
  33929. // {
  33930. // "description": "Updates an existing placement group. This method supports patch semantics.",
  33931. // "httpMethod": "PATCH",
  33932. // "id": "dfareporting.placementGroups.patch",
  33933. // "parameterOrder": [
  33934. // "profileId",
  33935. // "id"
  33936. // ],
  33937. // "parameters": {
  33938. // "id": {
  33939. // "description": "Placement group ID.",
  33940. // "format": "int64",
  33941. // "location": "query",
  33942. // "required": true,
  33943. // "type": "string"
  33944. // },
  33945. // "profileId": {
  33946. // "description": "User profile ID associated with this request.",
  33947. // "format": "int64",
  33948. // "location": "path",
  33949. // "required": true,
  33950. // "type": "string"
  33951. // }
  33952. // },
  33953. // "path": "userprofiles/{profileId}/placementGroups",
  33954. // "request": {
  33955. // "$ref": "PlacementGroup"
  33956. // },
  33957. // "response": {
  33958. // "$ref": "PlacementGroup"
  33959. // },
  33960. // "scopes": [
  33961. // "https://www.googleapis.com/auth/dfatrafficking"
  33962. // ]
  33963. // }
  33964. }
  33965. // method id "dfareporting.placementGroups.update":
  33966. type PlacementGroupsUpdateCall struct {
  33967. s *Service
  33968. profileId int64
  33969. placementgroup *PlacementGroup
  33970. urlParams_ gensupport.URLParams
  33971. ctx_ context.Context
  33972. header_ http.Header
  33973. }
  33974. // Update: Updates an existing placement group.
  33975. func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall {
  33976. c := &PlacementGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33977. c.profileId = profileId
  33978. c.placementgroup = placementgroup
  33979. return c
  33980. }
  33981. // Fields allows partial responses to be retrieved. See
  33982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33983. // for more information.
  33984. func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall {
  33985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33986. return c
  33987. }
  33988. // Context sets the context to be used in this call's Do method. Any
  33989. // pending HTTP request will be aborted if the provided context is
  33990. // canceled.
  33991. func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall {
  33992. c.ctx_ = ctx
  33993. return c
  33994. }
  33995. // Header returns an http.Header that can be modified by the caller to
  33996. // add HTTP headers to the request.
  33997. func (c *PlacementGroupsUpdateCall) Header() http.Header {
  33998. if c.header_ == nil {
  33999. c.header_ = make(http.Header)
  34000. }
  34001. return c.header_
  34002. }
  34003. func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  34004. reqHeaders := make(http.Header)
  34005. for k, v := range c.header_ {
  34006. reqHeaders[k] = v
  34007. }
  34008. reqHeaders.Set("User-Agent", c.s.userAgent())
  34009. var body io.Reader = nil
  34010. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  34011. if err != nil {
  34012. return nil, err
  34013. }
  34014. reqHeaders.Set("Content-Type", "application/json")
  34015. c.urlParams_.Set("alt", alt)
  34016. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  34017. urls += "?" + c.urlParams_.Encode()
  34018. req, _ := http.NewRequest("PUT", urls, body)
  34019. req.Header = reqHeaders
  34020. googleapi.Expand(req.URL, map[string]string{
  34021. "profileId": strconv.FormatInt(c.profileId, 10),
  34022. })
  34023. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34024. }
  34025. // Do executes the "dfareporting.placementGroups.update" call.
  34026. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  34027. // status code is an error. Response headers are in either
  34028. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  34029. // at all) in error.(*googleapi.Error).Header. Use
  34030. // googleapi.IsNotModified to check whether the returned error was
  34031. // because http.StatusNotModified was returned.
  34032. func (c *PlacementGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  34033. gensupport.SetOptions(c.urlParams_, opts...)
  34034. res, err := c.doRequest("json")
  34035. if res != nil && res.StatusCode == http.StatusNotModified {
  34036. if res.Body != nil {
  34037. res.Body.Close()
  34038. }
  34039. return nil, &googleapi.Error{
  34040. Code: res.StatusCode,
  34041. Header: res.Header,
  34042. }
  34043. }
  34044. if err != nil {
  34045. return nil, err
  34046. }
  34047. defer googleapi.CloseBody(res)
  34048. if err := googleapi.CheckResponse(res); err != nil {
  34049. return nil, err
  34050. }
  34051. ret := &PlacementGroup{
  34052. ServerResponse: googleapi.ServerResponse{
  34053. Header: res.Header,
  34054. HTTPStatusCode: res.StatusCode,
  34055. },
  34056. }
  34057. target := &ret
  34058. if err := gensupport.DecodeResponse(target, res); err != nil {
  34059. return nil, err
  34060. }
  34061. return ret, nil
  34062. // {
  34063. // "description": "Updates an existing placement group.",
  34064. // "httpMethod": "PUT",
  34065. // "id": "dfareporting.placementGroups.update",
  34066. // "parameterOrder": [
  34067. // "profileId"
  34068. // ],
  34069. // "parameters": {
  34070. // "profileId": {
  34071. // "description": "User profile ID associated with this request.",
  34072. // "format": "int64",
  34073. // "location": "path",
  34074. // "required": true,
  34075. // "type": "string"
  34076. // }
  34077. // },
  34078. // "path": "userprofiles/{profileId}/placementGroups",
  34079. // "request": {
  34080. // "$ref": "PlacementGroup"
  34081. // },
  34082. // "response": {
  34083. // "$ref": "PlacementGroup"
  34084. // },
  34085. // "scopes": [
  34086. // "https://www.googleapis.com/auth/dfatrafficking"
  34087. // ]
  34088. // }
  34089. }
  34090. // method id "dfareporting.placementStrategies.delete":
  34091. type PlacementStrategiesDeleteCall struct {
  34092. s *Service
  34093. profileId int64
  34094. id int64
  34095. urlParams_ gensupport.URLParams
  34096. ctx_ context.Context
  34097. header_ http.Header
  34098. }
  34099. // Delete: Deletes an existing placement strategy.
  34100. func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall {
  34101. c := &PlacementStrategiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34102. c.profileId = profileId
  34103. c.id = id
  34104. return c
  34105. }
  34106. // Fields allows partial responses to be retrieved. See
  34107. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34108. // for more information.
  34109. func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall {
  34110. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34111. return c
  34112. }
  34113. // Context sets the context to be used in this call's Do method. Any
  34114. // pending HTTP request will be aborted if the provided context is
  34115. // canceled.
  34116. func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall {
  34117. c.ctx_ = ctx
  34118. return c
  34119. }
  34120. // Header returns an http.Header that can be modified by the caller to
  34121. // add HTTP headers to the request.
  34122. func (c *PlacementStrategiesDeleteCall) Header() http.Header {
  34123. if c.header_ == nil {
  34124. c.header_ = make(http.Header)
  34125. }
  34126. return c.header_
  34127. }
  34128. func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  34129. reqHeaders := make(http.Header)
  34130. for k, v := range c.header_ {
  34131. reqHeaders[k] = v
  34132. }
  34133. reqHeaders.Set("User-Agent", c.s.userAgent())
  34134. var body io.Reader = nil
  34135. c.urlParams_.Set("alt", alt)
  34136. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  34137. urls += "?" + c.urlParams_.Encode()
  34138. req, _ := http.NewRequest("DELETE", urls, body)
  34139. req.Header = reqHeaders
  34140. googleapi.Expand(req.URL, map[string]string{
  34141. "profileId": strconv.FormatInt(c.profileId, 10),
  34142. "id": strconv.FormatInt(c.id, 10),
  34143. })
  34144. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34145. }
  34146. // Do executes the "dfareporting.placementStrategies.delete" call.
  34147. func (c *PlacementStrategiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  34148. gensupport.SetOptions(c.urlParams_, opts...)
  34149. res, err := c.doRequest("json")
  34150. if err != nil {
  34151. return err
  34152. }
  34153. defer googleapi.CloseBody(res)
  34154. if err := googleapi.CheckResponse(res); err != nil {
  34155. return err
  34156. }
  34157. return nil
  34158. // {
  34159. // "description": "Deletes an existing placement strategy.",
  34160. // "httpMethod": "DELETE",
  34161. // "id": "dfareporting.placementStrategies.delete",
  34162. // "parameterOrder": [
  34163. // "profileId",
  34164. // "id"
  34165. // ],
  34166. // "parameters": {
  34167. // "id": {
  34168. // "description": "Placement strategy ID.",
  34169. // "format": "int64",
  34170. // "location": "path",
  34171. // "required": true,
  34172. // "type": "string"
  34173. // },
  34174. // "profileId": {
  34175. // "description": "User profile ID associated with this request.",
  34176. // "format": "int64",
  34177. // "location": "path",
  34178. // "required": true,
  34179. // "type": "string"
  34180. // }
  34181. // },
  34182. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  34183. // "scopes": [
  34184. // "https://www.googleapis.com/auth/dfatrafficking"
  34185. // ]
  34186. // }
  34187. }
  34188. // method id "dfareporting.placementStrategies.get":
  34189. type PlacementStrategiesGetCall struct {
  34190. s *Service
  34191. profileId int64
  34192. id int64
  34193. urlParams_ gensupport.URLParams
  34194. ifNoneMatch_ string
  34195. ctx_ context.Context
  34196. header_ http.Header
  34197. }
  34198. // Get: Gets one placement strategy by ID.
  34199. func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall {
  34200. c := &PlacementStrategiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34201. c.profileId = profileId
  34202. c.id = id
  34203. return c
  34204. }
  34205. // Fields allows partial responses to be retrieved. See
  34206. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34207. // for more information.
  34208. func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall {
  34209. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34210. return c
  34211. }
  34212. // IfNoneMatch sets the optional parameter which makes the operation
  34213. // fail if the object's ETag matches the given value. This is useful for
  34214. // getting updates only after the object has changed since the last
  34215. // request. Use googleapi.IsNotModified to check whether the response
  34216. // error from Do is the result of In-None-Match.
  34217. func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall {
  34218. c.ifNoneMatch_ = entityTag
  34219. return c
  34220. }
  34221. // Context sets the context to be used in this call's Do method. Any
  34222. // pending HTTP request will be aborted if the provided context is
  34223. // canceled.
  34224. func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall {
  34225. c.ctx_ = ctx
  34226. return c
  34227. }
  34228. // Header returns an http.Header that can be modified by the caller to
  34229. // add HTTP headers to the request.
  34230. func (c *PlacementStrategiesGetCall) Header() http.Header {
  34231. if c.header_ == nil {
  34232. c.header_ = make(http.Header)
  34233. }
  34234. return c.header_
  34235. }
  34236. func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) {
  34237. reqHeaders := make(http.Header)
  34238. for k, v := range c.header_ {
  34239. reqHeaders[k] = v
  34240. }
  34241. reqHeaders.Set("User-Agent", c.s.userAgent())
  34242. if c.ifNoneMatch_ != "" {
  34243. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34244. }
  34245. var body io.Reader = nil
  34246. c.urlParams_.Set("alt", alt)
  34247. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  34248. urls += "?" + c.urlParams_.Encode()
  34249. req, _ := http.NewRequest("GET", urls, body)
  34250. req.Header = reqHeaders
  34251. googleapi.Expand(req.URL, map[string]string{
  34252. "profileId": strconv.FormatInt(c.profileId, 10),
  34253. "id": strconv.FormatInt(c.id, 10),
  34254. })
  34255. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34256. }
  34257. // Do executes the "dfareporting.placementStrategies.get" call.
  34258. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34259. // non-2xx status code is an error. Response headers are in either
  34260. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34261. // returned at all) in error.(*googleapi.Error).Header. Use
  34262. // googleapi.IsNotModified to check whether the returned error was
  34263. // because http.StatusNotModified was returned.
  34264. func (c *PlacementStrategiesGetCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34265. gensupport.SetOptions(c.urlParams_, opts...)
  34266. res, err := c.doRequest("json")
  34267. if res != nil && res.StatusCode == http.StatusNotModified {
  34268. if res.Body != nil {
  34269. res.Body.Close()
  34270. }
  34271. return nil, &googleapi.Error{
  34272. Code: res.StatusCode,
  34273. Header: res.Header,
  34274. }
  34275. }
  34276. if err != nil {
  34277. return nil, err
  34278. }
  34279. defer googleapi.CloseBody(res)
  34280. if err := googleapi.CheckResponse(res); err != nil {
  34281. return nil, err
  34282. }
  34283. ret := &PlacementStrategy{
  34284. ServerResponse: googleapi.ServerResponse{
  34285. Header: res.Header,
  34286. HTTPStatusCode: res.StatusCode,
  34287. },
  34288. }
  34289. target := &ret
  34290. if err := gensupport.DecodeResponse(target, res); err != nil {
  34291. return nil, err
  34292. }
  34293. return ret, nil
  34294. // {
  34295. // "description": "Gets one placement strategy by ID.",
  34296. // "httpMethod": "GET",
  34297. // "id": "dfareporting.placementStrategies.get",
  34298. // "parameterOrder": [
  34299. // "profileId",
  34300. // "id"
  34301. // ],
  34302. // "parameters": {
  34303. // "id": {
  34304. // "description": "Placement strategy ID.",
  34305. // "format": "int64",
  34306. // "location": "path",
  34307. // "required": true,
  34308. // "type": "string"
  34309. // },
  34310. // "profileId": {
  34311. // "description": "User profile ID associated with this request.",
  34312. // "format": "int64",
  34313. // "location": "path",
  34314. // "required": true,
  34315. // "type": "string"
  34316. // }
  34317. // },
  34318. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  34319. // "response": {
  34320. // "$ref": "PlacementStrategy"
  34321. // },
  34322. // "scopes": [
  34323. // "https://www.googleapis.com/auth/dfatrafficking"
  34324. // ]
  34325. // }
  34326. }
  34327. // method id "dfareporting.placementStrategies.insert":
  34328. type PlacementStrategiesInsertCall struct {
  34329. s *Service
  34330. profileId int64
  34331. placementstrategy *PlacementStrategy
  34332. urlParams_ gensupport.URLParams
  34333. ctx_ context.Context
  34334. header_ http.Header
  34335. }
  34336. // Insert: Inserts a new placement strategy.
  34337. func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall {
  34338. c := &PlacementStrategiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34339. c.profileId = profileId
  34340. c.placementstrategy = placementstrategy
  34341. return c
  34342. }
  34343. // Fields allows partial responses to be retrieved. See
  34344. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34345. // for more information.
  34346. func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall {
  34347. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34348. return c
  34349. }
  34350. // Context sets the context to be used in this call's Do method. Any
  34351. // pending HTTP request will be aborted if the provided context is
  34352. // canceled.
  34353. func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall {
  34354. c.ctx_ = ctx
  34355. return c
  34356. }
  34357. // Header returns an http.Header that can be modified by the caller to
  34358. // add HTTP headers to the request.
  34359. func (c *PlacementStrategiesInsertCall) Header() http.Header {
  34360. if c.header_ == nil {
  34361. c.header_ = make(http.Header)
  34362. }
  34363. return c.header_
  34364. }
  34365. func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) {
  34366. reqHeaders := make(http.Header)
  34367. for k, v := range c.header_ {
  34368. reqHeaders[k] = v
  34369. }
  34370. reqHeaders.Set("User-Agent", c.s.userAgent())
  34371. var body io.Reader = nil
  34372. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34373. if err != nil {
  34374. return nil, err
  34375. }
  34376. reqHeaders.Set("Content-Type", "application/json")
  34377. c.urlParams_.Set("alt", alt)
  34378. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34379. urls += "?" + c.urlParams_.Encode()
  34380. req, _ := http.NewRequest("POST", urls, body)
  34381. req.Header = reqHeaders
  34382. googleapi.Expand(req.URL, map[string]string{
  34383. "profileId": strconv.FormatInt(c.profileId, 10),
  34384. })
  34385. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34386. }
  34387. // Do executes the "dfareporting.placementStrategies.insert" call.
  34388. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34389. // non-2xx status code is an error. Response headers are in either
  34390. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34391. // returned at all) in error.(*googleapi.Error).Header. Use
  34392. // googleapi.IsNotModified to check whether the returned error was
  34393. // because http.StatusNotModified was returned.
  34394. func (c *PlacementStrategiesInsertCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34395. gensupport.SetOptions(c.urlParams_, opts...)
  34396. res, err := c.doRequest("json")
  34397. if res != nil && res.StatusCode == http.StatusNotModified {
  34398. if res.Body != nil {
  34399. res.Body.Close()
  34400. }
  34401. return nil, &googleapi.Error{
  34402. Code: res.StatusCode,
  34403. Header: res.Header,
  34404. }
  34405. }
  34406. if err != nil {
  34407. return nil, err
  34408. }
  34409. defer googleapi.CloseBody(res)
  34410. if err := googleapi.CheckResponse(res); err != nil {
  34411. return nil, err
  34412. }
  34413. ret := &PlacementStrategy{
  34414. ServerResponse: googleapi.ServerResponse{
  34415. Header: res.Header,
  34416. HTTPStatusCode: res.StatusCode,
  34417. },
  34418. }
  34419. target := &ret
  34420. if err := gensupport.DecodeResponse(target, res); err != nil {
  34421. return nil, err
  34422. }
  34423. return ret, nil
  34424. // {
  34425. // "description": "Inserts a new placement strategy.",
  34426. // "httpMethod": "POST",
  34427. // "id": "dfareporting.placementStrategies.insert",
  34428. // "parameterOrder": [
  34429. // "profileId"
  34430. // ],
  34431. // "parameters": {
  34432. // "profileId": {
  34433. // "description": "User profile ID associated with this request.",
  34434. // "format": "int64",
  34435. // "location": "path",
  34436. // "required": true,
  34437. // "type": "string"
  34438. // }
  34439. // },
  34440. // "path": "userprofiles/{profileId}/placementStrategies",
  34441. // "request": {
  34442. // "$ref": "PlacementStrategy"
  34443. // },
  34444. // "response": {
  34445. // "$ref": "PlacementStrategy"
  34446. // },
  34447. // "scopes": [
  34448. // "https://www.googleapis.com/auth/dfatrafficking"
  34449. // ]
  34450. // }
  34451. }
  34452. // method id "dfareporting.placementStrategies.list":
  34453. type PlacementStrategiesListCall struct {
  34454. s *Service
  34455. profileId int64
  34456. urlParams_ gensupport.URLParams
  34457. ifNoneMatch_ string
  34458. ctx_ context.Context
  34459. header_ http.Header
  34460. }
  34461. // List: Retrieves a list of placement strategies, possibly filtered.
  34462. // This method supports paging.
  34463. func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall {
  34464. c := &PlacementStrategiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34465. c.profileId = profileId
  34466. return c
  34467. }
  34468. // Ids sets the optional parameter "ids": Select only placement
  34469. // strategies with these IDs.
  34470. func (c *PlacementStrategiesListCall) Ids(ids ...int64) *PlacementStrategiesListCall {
  34471. var ids_ []string
  34472. for _, v := range ids {
  34473. ids_ = append(ids_, fmt.Sprint(v))
  34474. }
  34475. c.urlParams_.SetMulti("ids", ids_)
  34476. return c
  34477. }
  34478. // MaxResults sets the optional parameter "maxResults": Maximum number
  34479. // of results to return.
  34480. func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall {
  34481. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34482. return c
  34483. }
  34484. // PageToken sets the optional parameter "pageToken": Value of the
  34485. // nextPageToken from the previous result page.
  34486. func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall {
  34487. c.urlParams_.Set("pageToken", pageToken)
  34488. return c
  34489. }
  34490. // SearchString sets the optional parameter "searchString": Allows
  34491. // searching for objects by name or ID. Wildcards (*) are allowed. For
  34492. // example, "placementstrategy*2015" will return objects with names like
  34493. // "placementstrategy June 2015", "placementstrategy April 2015", or
  34494. // simply "placementstrategy 2015". Most of the searches also add
  34495. // wildcards implicitly at the start and the end of the search string.
  34496. // For example, a search string of "placementstrategy" will match
  34497. // objects with name "my placementstrategy", "placementstrategy 2015",
  34498. // or simply "placementstrategy".
  34499. func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall {
  34500. c.urlParams_.Set("searchString", searchString)
  34501. return c
  34502. }
  34503. // SortField sets the optional parameter "sortField": Field by which to
  34504. // sort the list.
  34505. //
  34506. // Possible values:
  34507. // "ID" (default)
  34508. // "NAME"
  34509. func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall {
  34510. c.urlParams_.Set("sortField", sortField)
  34511. return c
  34512. }
  34513. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  34514. // results.
  34515. //
  34516. // Possible values:
  34517. // "ASCENDING" (default)
  34518. // "DESCENDING"
  34519. func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall {
  34520. c.urlParams_.Set("sortOrder", sortOrder)
  34521. return c
  34522. }
  34523. // Fields allows partial responses to be retrieved. See
  34524. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34525. // for more information.
  34526. func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall {
  34527. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34528. return c
  34529. }
  34530. // IfNoneMatch sets the optional parameter which makes the operation
  34531. // fail if the object's ETag matches the given value. This is useful for
  34532. // getting updates only after the object has changed since the last
  34533. // request. Use googleapi.IsNotModified to check whether the response
  34534. // error from Do is the result of In-None-Match.
  34535. func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall {
  34536. c.ifNoneMatch_ = entityTag
  34537. return c
  34538. }
  34539. // Context sets the context to be used in this call's Do method. Any
  34540. // pending HTTP request will be aborted if the provided context is
  34541. // canceled.
  34542. func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall {
  34543. c.ctx_ = ctx
  34544. return c
  34545. }
  34546. // Header returns an http.Header that can be modified by the caller to
  34547. // add HTTP headers to the request.
  34548. func (c *PlacementStrategiesListCall) Header() http.Header {
  34549. if c.header_ == nil {
  34550. c.header_ = make(http.Header)
  34551. }
  34552. return c.header_
  34553. }
  34554. func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) {
  34555. reqHeaders := make(http.Header)
  34556. for k, v := range c.header_ {
  34557. reqHeaders[k] = v
  34558. }
  34559. reqHeaders.Set("User-Agent", c.s.userAgent())
  34560. if c.ifNoneMatch_ != "" {
  34561. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34562. }
  34563. var body io.Reader = nil
  34564. c.urlParams_.Set("alt", alt)
  34565. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34566. urls += "?" + c.urlParams_.Encode()
  34567. req, _ := http.NewRequest("GET", urls, body)
  34568. req.Header = reqHeaders
  34569. googleapi.Expand(req.URL, map[string]string{
  34570. "profileId": strconv.FormatInt(c.profileId, 10),
  34571. })
  34572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34573. }
  34574. // Do executes the "dfareporting.placementStrategies.list" call.
  34575. // Exactly one of *PlacementStrategiesListResponse or error will be
  34576. // non-nil. Any non-2xx status code is an error. Response headers are in
  34577. // either *PlacementStrategiesListResponse.ServerResponse.Header or (if
  34578. // a response was returned at all) in error.(*googleapi.Error).Header.
  34579. // Use googleapi.IsNotModified to check whether the returned error was
  34580. // because http.StatusNotModified was returned.
  34581. func (c *PlacementStrategiesListCall) Do(opts ...googleapi.CallOption) (*PlacementStrategiesListResponse, error) {
  34582. gensupport.SetOptions(c.urlParams_, opts...)
  34583. res, err := c.doRequest("json")
  34584. if res != nil && res.StatusCode == http.StatusNotModified {
  34585. if res.Body != nil {
  34586. res.Body.Close()
  34587. }
  34588. return nil, &googleapi.Error{
  34589. Code: res.StatusCode,
  34590. Header: res.Header,
  34591. }
  34592. }
  34593. if err != nil {
  34594. return nil, err
  34595. }
  34596. defer googleapi.CloseBody(res)
  34597. if err := googleapi.CheckResponse(res); err != nil {
  34598. return nil, err
  34599. }
  34600. ret := &PlacementStrategiesListResponse{
  34601. ServerResponse: googleapi.ServerResponse{
  34602. Header: res.Header,
  34603. HTTPStatusCode: res.StatusCode,
  34604. },
  34605. }
  34606. target := &ret
  34607. if err := gensupport.DecodeResponse(target, res); err != nil {
  34608. return nil, err
  34609. }
  34610. return ret, nil
  34611. // {
  34612. // "description": "Retrieves a list of placement strategies, possibly filtered. This method supports paging.",
  34613. // "httpMethod": "GET",
  34614. // "id": "dfareporting.placementStrategies.list",
  34615. // "parameterOrder": [
  34616. // "profileId"
  34617. // ],
  34618. // "parameters": {
  34619. // "ids": {
  34620. // "description": "Select only placement strategies with these IDs.",
  34621. // "format": "int64",
  34622. // "location": "query",
  34623. // "repeated": true,
  34624. // "type": "string"
  34625. // },
  34626. // "maxResults": {
  34627. // "default": "1000",
  34628. // "description": "Maximum number of results to return.",
  34629. // "format": "int32",
  34630. // "location": "query",
  34631. // "maximum": "1000",
  34632. // "minimum": "0",
  34633. // "type": "integer"
  34634. // },
  34635. // "pageToken": {
  34636. // "description": "Value of the nextPageToken from the previous result page.",
  34637. // "location": "query",
  34638. // "type": "string"
  34639. // },
  34640. // "profileId": {
  34641. // "description": "User profile ID associated with this request.",
  34642. // "format": "int64",
  34643. // "location": "path",
  34644. // "required": true,
  34645. // "type": "string"
  34646. // },
  34647. // "searchString": {
  34648. // "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\".",
  34649. // "location": "query",
  34650. // "type": "string"
  34651. // },
  34652. // "sortField": {
  34653. // "default": "ID",
  34654. // "description": "Field by which to sort the list.",
  34655. // "enum": [
  34656. // "ID",
  34657. // "NAME"
  34658. // ],
  34659. // "enumDescriptions": [
  34660. // "",
  34661. // ""
  34662. // ],
  34663. // "location": "query",
  34664. // "type": "string"
  34665. // },
  34666. // "sortOrder": {
  34667. // "default": "ASCENDING",
  34668. // "description": "Order of sorted results.",
  34669. // "enum": [
  34670. // "ASCENDING",
  34671. // "DESCENDING"
  34672. // ],
  34673. // "enumDescriptions": [
  34674. // "",
  34675. // ""
  34676. // ],
  34677. // "location": "query",
  34678. // "type": "string"
  34679. // }
  34680. // },
  34681. // "path": "userprofiles/{profileId}/placementStrategies",
  34682. // "response": {
  34683. // "$ref": "PlacementStrategiesListResponse"
  34684. // },
  34685. // "scopes": [
  34686. // "https://www.googleapis.com/auth/dfatrafficking"
  34687. // ]
  34688. // }
  34689. }
  34690. // Pages invokes f for each page of results.
  34691. // A non-nil error returned from f will halt the iteration.
  34692. // The provided context supersedes any context provided to the Context method.
  34693. func (c *PlacementStrategiesListCall) Pages(ctx context.Context, f func(*PlacementStrategiesListResponse) error) error {
  34694. c.ctx_ = ctx
  34695. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34696. for {
  34697. x, err := c.Do()
  34698. if err != nil {
  34699. return err
  34700. }
  34701. if err := f(x); err != nil {
  34702. return err
  34703. }
  34704. if x.NextPageToken == "" {
  34705. return nil
  34706. }
  34707. c.PageToken(x.NextPageToken)
  34708. }
  34709. }
  34710. // method id "dfareporting.placementStrategies.patch":
  34711. type PlacementStrategiesPatchCall struct {
  34712. s *Service
  34713. profileId int64
  34714. placementstrategy *PlacementStrategy
  34715. urlParams_ gensupport.URLParams
  34716. ctx_ context.Context
  34717. header_ http.Header
  34718. }
  34719. // Patch: Updates an existing placement strategy. This method supports
  34720. // patch semantics.
  34721. func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall {
  34722. c := &PlacementStrategiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34723. c.profileId = profileId
  34724. c.urlParams_.Set("id", fmt.Sprint(id))
  34725. c.placementstrategy = placementstrategy
  34726. return c
  34727. }
  34728. // Fields allows partial responses to be retrieved. See
  34729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34730. // for more information.
  34731. func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall {
  34732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34733. return c
  34734. }
  34735. // Context sets the context to be used in this call's Do method. Any
  34736. // pending HTTP request will be aborted if the provided context is
  34737. // canceled.
  34738. func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall {
  34739. c.ctx_ = ctx
  34740. return c
  34741. }
  34742. // Header returns an http.Header that can be modified by the caller to
  34743. // add HTTP headers to the request.
  34744. func (c *PlacementStrategiesPatchCall) Header() http.Header {
  34745. if c.header_ == nil {
  34746. c.header_ = make(http.Header)
  34747. }
  34748. return c.header_
  34749. }
  34750. func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) {
  34751. reqHeaders := make(http.Header)
  34752. for k, v := range c.header_ {
  34753. reqHeaders[k] = v
  34754. }
  34755. reqHeaders.Set("User-Agent", c.s.userAgent())
  34756. var body io.Reader = nil
  34757. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34758. if err != nil {
  34759. return nil, err
  34760. }
  34761. reqHeaders.Set("Content-Type", "application/json")
  34762. c.urlParams_.Set("alt", alt)
  34763. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34764. urls += "?" + c.urlParams_.Encode()
  34765. req, _ := http.NewRequest("PATCH", urls, body)
  34766. req.Header = reqHeaders
  34767. googleapi.Expand(req.URL, map[string]string{
  34768. "profileId": strconv.FormatInt(c.profileId, 10),
  34769. })
  34770. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34771. }
  34772. // Do executes the "dfareporting.placementStrategies.patch" call.
  34773. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34774. // non-2xx status code is an error. Response headers are in either
  34775. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34776. // returned at all) in error.(*googleapi.Error).Header. Use
  34777. // googleapi.IsNotModified to check whether the returned error was
  34778. // because http.StatusNotModified was returned.
  34779. func (c *PlacementStrategiesPatchCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34780. gensupport.SetOptions(c.urlParams_, opts...)
  34781. res, err := c.doRequest("json")
  34782. if res != nil && res.StatusCode == http.StatusNotModified {
  34783. if res.Body != nil {
  34784. res.Body.Close()
  34785. }
  34786. return nil, &googleapi.Error{
  34787. Code: res.StatusCode,
  34788. Header: res.Header,
  34789. }
  34790. }
  34791. if err != nil {
  34792. return nil, err
  34793. }
  34794. defer googleapi.CloseBody(res)
  34795. if err := googleapi.CheckResponse(res); err != nil {
  34796. return nil, err
  34797. }
  34798. ret := &PlacementStrategy{
  34799. ServerResponse: googleapi.ServerResponse{
  34800. Header: res.Header,
  34801. HTTPStatusCode: res.StatusCode,
  34802. },
  34803. }
  34804. target := &ret
  34805. if err := gensupport.DecodeResponse(target, res); err != nil {
  34806. return nil, err
  34807. }
  34808. return ret, nil
  34809. // {
  34810. // "description": "Updates an existing placement strategy. This method supports patch semantics.",
  34811. // "httpMethod": "PATCH",
  34812. // "id": "dfareporting.placementStrategies.patch",
  34813. // "parameterOrder": [
  34814. // "profileId",
  34815. // "id"
  34816. // ],
  34817. // "parameters": {
  34818. // "id": {
  34819. // "description": "Placement strategy ID.",
  34820. // "format": "int64",
  34821. // "location": "query",
  34822. // "required": true,
  34823. // "type": "string"
  34824. // },
  34825. // "profileId": {
  34826. // "description": "User profile ID associated with this request.",
  34827. // "format": "int64",
  34828. // "location": "path",
  34829. // "required": true,
  34830. // "type": "string"
  34831. // }
  34832. // },
  34833. // "path": "userprofiles/{profileId}/placementStrategies",
  34834. // "request": {
  34835. // "$ref": "PlacementStrategy"
  34836. // },
  34837. // "response": {
  34838. // "$ref": "PlacementStrategy"
  34839. // },
  34840. // "scopes": [
  34841. // "https://www.googleapis.com/auth/dfatrafficking"
  34842. // ]
  34843. // }
  34844. }
  34845. // method id "dfareporting.placementStrategies.update":
  34846. type PlacementStrategiesUpdateCall struct {
  34847. s *Service
  34848. profileId int64
  34849. placementstrategy *PlacementStrategy
  34850. urlParams_ gensupport.URLParams
  34851. ctx_ context.Context
  34852. header_ http.Header
  34853. }
  34854. // Update: Updates an existing placement strategy.
  34855. func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall {
  34856. c := &PlacementStrategiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34857. c.profileId = profileId
  34858. c.placementstrategy = placementstrategy
  34859. return c
  34860. }
  34861. // Fields allows partial responses to be retrieved. See
  34862. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34863. // for more information.
  34864. func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall {
  34865. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34866. return c
  34867. }
  34868. // Context sets the context to be used in this call's Do method. Any
  34869. // pending HTTP request will be aborted if the provided context is
  34870. // canceled.
  34871. func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall {
  34872. c.ctx_ = ctx
  34873. return c
  34874. }
  34875. // Header returns an http.Header that can be modified by the caller to
  34876. // add HTTP headers to the request.
  34877. func (c *PlacementStrategiesUpdateCall) Header() http.Header {
  34878. if c.header_ == nil {
  34879. c.header_ = make(http.Header)
  34880. }
  34881. return c.header_
  34882. }
  34883. func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  34884. reqHeaders := make(http.Header)
  34885. for k, v := range c.header_ {
  34886. reqHeaders[k] = v
  34887. }
  34888. reqHeaders.Set("User-Agent", c.s.userAgent())
  34889. var body io.Reader = nil
  34890. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34891. if err != nil {
  34892. return nil, err
  34893. }
  34894. reqHeaders.Set("Content-Type", "application/json")
  34895. c.urlParams_.Set("alt", alt)
  34896. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34897. urls += "?" + c.urlParams_.Encode()
  34898. req, _ := http.NewRequest("PUT", urls, body)
  34899. req.Header = reqHeaders
  34900. googleapi.Expand(req.URL, map[string]string{
  34901. "profileId": strconv.FormatInt(c.profileId, 10),
  34902. })
  34903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34904. }
  34905. // Do executes the "dfareporting.placementStrategies.update" call.
  34906. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34907. // non-2xx status code is an error. Response headers are in either
  34908. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34909. // returned at all) in error.(*googleapi.Error).Header. Use
  34910. // googleapi.IsNotModified to check whether the returned error was
  34911. // because http.StatusNotModified was returned.
  34912. func (c *PlacementStrategiesUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34913. gensupport.SetOptions(c.urlParams_, opts...)
  34914. res, err := c.doRequest("json")
  34915. if res != nil && res.StatusCode == http.StatusNotModified {
  34916. if res.Body != nil {
  34917. res.Body.Close()
  34918. }
  34919. return nil, &googleapi.Error{
  34920. Code: res.StatusCode,
  34921. Header: res.Header,
  34922. }
  34923. }
  34924. if err != nil {
  34925. return nil, err
  34926. }
  34927. defer googleapi.CloseBody(res)
  34928. if err := googleapi.CheckResponse(res); err != nil {
  34929. return nil, err
  34930. }
  34931. ret := &PlacementStrategy{
  34932. ServerResponse: googleapi.ServerResponse{
  34933. Header: res.Header,
  34934. HTTPStatusCode: res.StatusCode,
  34935. },
  34936. }
  34937. target := &ret
  34938. if err := gensupport.DecodeResponse(target, res); err != nil {
  34939. return nil, err
  34940. }
  34941. return ret, nil
  34942. // {
  34943. // "description": "Updates an existing placement strategy.",
  34944. // "httpMethod": "PUT",
  34945. // "id": "dfareporting.placementStrategies.update",
  34946. // "parameterOrder": [
  34947. // "profileId"
  34948. // ],
  34949. // "parameters": {
  34950. // "profileId": {
  34951. // "description": "User profile ID associated with this request.",
  34952. // "format": "int64",
  34953. // "location": "path",
  34954. // "required": true,
  34955. // "type": "string"
  34956. // }
  34957. // },
  34958. // "path": "userprofiles/{profileId}/placementStrategies",
  34959. // "request": {
  34960. // "$ref": "PlacementStrategy"
  34961. // },
  34962. // "response": {
  34963. // "$ref": "PlacementStrategy"
  34964. // },
  34965. // "scopes": [
  34966. // "https://www.googleapis.com/auth/dfatrafficking"
  34967. // ]
  34968. // }
  34969. }
  34970. // method id "dfareporting.placements.generatetags":
  34971. type PlacementsGeneratetagsCall struct {
  34972. s *Service
  34973. profileId int64
  34974. urlParams_ gensupport.URLParams
  34975. ctx_ context.Context
  34976. header_ http.Header
  34977. }
  34978. // Generatetags: Generates tags for a placement.
  34979. func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall {
  34980. c := &PlacementsGeneratetagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34981. c.profileId = profileId
  34982. return c
  34983. }
  34984. // CampaignId sets the optional parameter "campaignId": Generate
  34985. // placements belonging to this campaign. This is a required field.
  34986. func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall {
  34987. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  34988. return c
  34989. }
  34990. // PlacementIds sets the optional parameter "placementIds": Generate
  34991. // tags for these placements.
  34992. func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds ...int64) *PlacementsGeneratetagsCall {
  34993. var placementIds_ []string
  34994. for _, v := range placementIds {
  34995. placementIds_ = append(placementIds_, fmt.Sprint(v))
  34996. }
  34997. c.urlParams_.SetMulti("placementIds", placementIds_)
  34998. return c
  34999. }
  35000. // TagFormats sets the optional parameter "tagFormats": Tag formats to
  35001. // generate for these placements.
  35002. //
  35003. // Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1
  35004. // placements.
  35005. //
  35006. // Possible values:
  35007. // "PLACEMENT_TAG_CLICK_COMMANDS"
  35008. // "PLACEMENT_TAG_IFRAME_ILAYER"
  35009. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  35010. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  35011. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  35012. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  35013. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  35014. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  35015. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  35016. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  35017. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  35018. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  35019. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  35020. // "PLACEMENT_TAG_JAVASCRIPT"
  35021. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  35022. // "PLACEMENT_TAG_STANDARD"
  35023. // "PLACEMENT_TAG_TRACKING"
  35024. // "PLACEMENT_TAG_TRACKING_IFRAME"
  35025. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  35026. func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats ...string) *PlacementsGeneratetagsCall {
  35027. c.urlParams_.SetMulti("tagFormats", append([]string{}, tagFormats...))
  35028. return c
  35029. }
  35030. // Fields allows partial responses to be retrieved. See
  35031. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35032. // for more information.
  35033. func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall {
  35034. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35035. return c
  35036. }
  35037. // Context sets the context to be used in this call's Do method. Any
  35038. // pending HTTP request will be aborted if the provided context is
  35039. // canceled.
  35040. func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall {
  35041. c.ctx_ = ctx
  35042. return c
  35043. }
  35044. // Header returns an http.Header that can be modified by the caller to
  35045. // add HTTP headers to the request.
  35046. func (c *PlacementsGeneratetagsCall) Header() http.Header {
  35047. if c.header_ == nil {
  35048. c.header_ = make(http.Header)
  35049. }
  35050. return c.header_
  35051. }
  35052. func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) {
  35053. reqHeaders := make(http.Header)
  35054. for k, v := range c.header_ {
  35055. reqHeaders[k] = v
  35056. }
  35057. reqHeaders.Set("User-Agent", c.s.userAgent())
  35058. var body io.Reader = nil
  35059. c.urlParams_.Set("alt", alt)
  35060. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags")
  35061. urls += "?" + c.urlParams_.Encode()
  35062. req, _ := http.NewRequest("POST", urls, body)
  35063. req.Header = reqHeaders
  35064. googleapi.Expand(req.URL, map[string]string{
  35065. "profileId": strconv.FormatInt(c.profileId, 10),
  35066. })
  35067. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35068. }
  35069. // Do executes the "dfareporting.placements.generatetags" call.
  35070. // Exactly one of *PlacementsGenerateTagsResponse or error will be
  35071. // non-nil. Any non-2xx status code is an error. Response headers are in
  35072. // either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a
  35073. // response was returned at all) in error.(*googleapi.Error).Header. Use
  35074. // googleapi.IsNotModified to check whether the returned error was
  35075. // because http.StatusNotModified was returned.
  35076. func (c *PlacementsGeneratetagsCall) Do(opts ...googleapi.CallOption) (*PlacementsGenerateTagsResponse, error) {
  35077. gensupport.SetOptions(c.urlParams_, opts...)
  35078. res, err := c.doRequest("json")
  35079. if res != nil && res.StatusCode == http.StatusNotModified {
  35080. if res.Body != nil {
  35081. res.Body.Close()
  35082. }
  35083. return nil, &googleapi.Error{
  35084. Code: res.StatusCode,
  35085. Header: res.Header,
  35086. }
  35087. }
  35088. if err != nil {
  35089. return nil, err
  35090. }
  35091. defer googleapi.CloseBody(res)
  35092. if err := googleapi.CheckResponse(res); err != nil {
  35093. return nil, err
  35094. }
  35095. ret := &PlacementsGenerateTagsResponse{
  35096. ServerResponse: googleapi.ServerResponse{
  35097. Header: res.Header,
  35098. HTTPStatusCode: res.StatusCode,
  35099. },
  35100. }
  35101. target := &ret
  35102. if err := gensupport.DecodeResponse(target, res); err != nil {
  35103. return nil, err
  35104. }
  35105. return ret, nil
  35106. // {
  35107. // "description": "Generates tags for a placement.",
  35108. // "httpMethod": "POST",
  35109. // "id": "dfareporting.placements.generatetags",
  35110. // "parameterOrder": [
  35111. // "profileId"
  35112. // ],
  35113. // "parameters": {
  35114. // "campaignId": {
  35115. // "description": "Generate placements belonging to this campaign. This is a required field.",
  35116. // "format": "int64",
  35117. // "location": "query",
  35118. // "type": "string"
  35119. // },
  35120. // "placementIds": {
  35121. // "description": "Generate tags for these placements.",
  35122. // "format": "int64",
  35123. // "location": "query",
  35124. // "repeated": true,
  35125. // "type": "string"
  35126. // },
  35127. // "profileId": {
  35128. // "description": "User profile ID associated with this request.",
  35129. // "format": "int64",
  35130. // "location": "path",
  35131. // "required": true,
  35132. // "type": "string"
  35133. // },
  35134. // "tagFormats": {
  35135. // "description": "Tag formats to generate for these placements.\n\nNote: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.",
  35136. // "enum": [
  35137. // "PLACEMENT_TAG_CLICK_COMMANDS",
  35138. // "PLACEMENT_TAG_IFRAME_ILAYER",
  35139. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT",
  35140. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY",
  35141. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH",
  35142. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3",
  35143. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4",
  35144. // "PLACEMENT_TAG_INTERNAL_REDIRECT",
  35145. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT",
  35146. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY",
  35147. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT",
  35148. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT",
  35149. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY",
  35150. // "PLACEMENT_TAG_JAVASCRIPT",
  35151. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY",
  35152. // "PLACEMENT_TAG_STANDARD",
  35153. // "PLACEMENT_TAG_TRACKING",
  35154. // "PLACEMENT_TAG_TRACKING_IFRAME",
  35155. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  35156. // ],
  35157. // "enumDescriptions": [
  35158. // "",
  35159. // "",
  35160. // "",
  35161. // "",
  35162. // "",
  35163. // "",
  35164. // "",
  35165. // "",
  35166. // "",
  35167. // "",
  35168. // "",
  35169. // "",
  35170. // "",
  35171. // "",
  35172. // "",
  35173. // "",
  35174. // "",
  35175. // "",
  35176. // ""
  35177. // ],
  35178. // "location": "query",
  35179. // "repeated": true,
  35180. // "type": "string"
  35181. // }
  35182. // },
  35183. // "path": "userprofiles/{profileId}/placements/generatetags",
  35184. // "response": {
  35185. // "$ref": "PlacementsGenerateTagsResponse"
  35186. // },
  35187. // "scopes": [
  35188. // "https://www.googleapis.com/auth/dfatrafficking"
  35189. // ]
  35190. // }
  35191. }
  35192. // method id "dfareporting.placements.get":
  35193. type PlacementsGetCall struct {
  35194. s *Service
  35195. profileId int64
  35196. id int64
  35197. urlParams_ gensupport.URLParams
  35198. ifNoneMatch_ string
  35199. ctx_ context.Context
  35200. header_ http.Header
  35201. }
  35202. // Get: Gets one placement by ID.
  35203. func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall {
  35204. c := &PlacementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35205. c.profileId = profileId
  35206. c.id = id
  35207. return c
  35208. }
  35209. // Fields allows partial responses to be retrieved. See
  35210. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35211. // for more information.
  35212. func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall {
  35213. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35214. return c
  35215. }
  35216. // IfNoneMatch sets the optional parameter which makes the operation
  35217. // fail if the object's ETag matches the given value. This is useful for
  35218. // getting updates only after the object has changed since the last
  35219. // request. Use googleapi.IsNotModified to check whether the response
  35220. // error from Do is the result of In-None-Match.
  35221. func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall {
  35222. c.ifNoneMatch_ = entityTag
  35223. return c
  35224. }
  35225. // Context sets the context to be used in this call's Do method. Any
  35226. // pending HTTP request will be aborted if the provided context is
  35227. // canceled.
  35228. func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall {
  35229. c.ctx_ = ctx
  35230. return c
  35231. }
  35232. // Header returns an http.Header that can be modified by the caller to
  35233. // add HTTP headers to the request.
  35234. func (c *PlacementsGetCall) Header() http.Header {
  35235. if c.header_ == nil {
  35236. c.header_ = make(http.Header)
  35237. }
  35238. return c.header_
  35239. }
  35240. func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) {
  35241. reqHeaders := make(http.Header)
  35242. for k, v := range c.header_ {
  35243. reqHeaders[k] = v
  35244. }
  35245. reqHeaders.Set("User-Agent", c.s.userAgent())
  35246. if c.ifNoneMatch_ != "" {
  35247. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35248. }
  35249. var body io.Reader = nil
  35250. c.urlParams_.Set("alt", alt)
  35251. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}")
  35252. urls += "?" + c.urlParams_.Encode()
  35253. req, _ := http.NewRequest("GET", urls, body)
  35254. req.Header = reqHeaders
  35255. googleapi.Expand(req.URL, map[string]string{
  35256. "profileId": strconv.FormatInt(c.profileId, 10),
  35257. "id": strconv.FormatInt(c.id, 10),
  35258. })
  35259. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35260. }
  35261. // Do executes the "dfareporting.placements.get" call.
  35262. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35263. // status code is an error. Response headers are in either
  35264. // *Placement.ServerResponse.Header or (if a response was returned at
  35265. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35266. // to check whether the returned error was because
  35267. // http.StatusNotModified was returned.
  35268. func (c *PlacementsGetCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35269. gensupport.SetOptions(c.urlParams_, opts...)
  35270. res, err := c.doRequest("json")
  35271. if res != nil && res.StatusCode == http.StatusNotModified {
  35272. if res.Body != nil {
  35273. res.Body.Close()
  35274. }
  35275. return nil, &googleapi.Error{
  35276. Code: res.StatusCode,
  35277. Header: res.Header,
  35278. }
  35279. }
  35280. if err != nil {
  35281. return nil, err
  35282. }
  35283. defer googleapi.CloseBody(res)
  35284. if err := googleapi.CheckResponse(res); err != nil {
  35285. return nil, err
  35286. }
  35287. ret := &Placement{
  35288. ServerResponse: googleapi.ServerResponse{
  35289. Header: res.Header,
  35290. HTTPStatusCode: res.StatusCode,
  35291. },
  35292. }
  35293. target := &ret
  35294. if err := gensupport.DecodeResponse(target, res); err != nil {
  35295. return nil, err
  35296. }
  35297. return ret, nil
  35298. // {
  35299. // "description": "Gets one placement by ID.",
  35300. // "httpMethod": "GET",
  35301. // "id": "dfareporting.placements.get",
  35302. // "parameterOrder": [
  35303. // "profileId",
  35304. // "id"
  35305. // ],
  35306. // "parameters": {
  35307. // "id": {
  35308. // "description": "Placement ID.",
  35309. // "format": "int64",
  35310. // "location": "path",
  35311. // "required": true,
  35312. // "type": "string"
  35313. // },
  35314. // "profileId": {
  35315. // "description": "User profile ID associated with this request.",
  35316. // "format": "int64",
  35317. // "location": "path",
  35318. // "required": true,
  35319. // "type": "string"
  35320. // }
  35321. // },
  35322. // "path": "userprofiles/{profileId}/placements/{id}",
  35323. // "response": {
  35324. // "$ref": "Placement"
  35325. // },
  35326. // "scopes": [
  35327. // "https://www.googleapis.com/auth/dfatrafficking"
  35328. // ]
  35329. // }
  35330. }
  35331. // method id "dfareporting.placements.insert":
  35332. type PlacementsInsertCall struct {
  35333. s *Service
  35334. profileId int64
  35335. placement *Placement
  35336. urlParams_ gensupport.URLParams
  35337. ctx_ context.Context
  35338. header_ http.Header
  35339. }
  35340. // Insert: Inserts a new placement.
  35341. func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall {
  35342. c := &PlacementsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35343. c.profileId = profileId
  35344. c.placement = placement
  35345. return c
  35346. }
  35347. // Fields allows partial responses to be retrieved. See
  35348. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35349. // for more information.
  35350. func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall {
  35351. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35352. return c
  35353. }
  35354. // Context sets the context to be used in this call's Do method. Any
  35355. // pending HTTP request will be aborted if the provided context is
  35356. // canceled.
  35357. func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall {
  35358. c.ctx_ = ctx
  35359. return c
  35360. }
  35361. // Header returns an http.Header that can be modified by the caller to
  35362. // add HTTP headers to the request.
  35363. func (c *PlacementsInsertCall) Header() http.Header {
  35364. if c.header_ == nil {
  35365. c.header_ = make(http.Header)
  35366. }
  35367. return c.header_
  35368. }
  35369. func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) {
  35370. reqHeaders := make(http.Header)
  35371. for k, v := range c.header_ {
  35372. reqHeaders[k] = v
  35373. }
  35374. reqHeaders.Set("User-Agent", c.s.userAgent())
  35375. var body io.Reader = nil
  35376. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  35377. if err != nil {
  35378. return nil, err
  35379. }
  35380. reqHeaders.Set("Content-Type", "application/json")
  35381. c.urlParams_.Set("alt", alt)
  35382. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35383. urls += "?" + c.urlParams_.Encode()
  35384. req, _ := http.NewRequest("POST", urls, body)
  35385. req.Header = reqHeaders
  35386. googleapi.Expand(req.URL, map[string]string{
  35387. "profileId": strconv.FormatInt(c.profileId, 10),
  35388. })
  35389. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35390. }
  35391. // Do executes the "dfareporting.placements.insert" call.
  35392. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35393. // status code is an error. Response headers are in either
  35394. // *Placement.ServerResponse.Header or (if a response was returned at
  35395. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35396. // to check whether the returned error was because
  35397. // http.StatusNotModified was returned.
  35398. func (c *PlacementsInsertCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35399. gensupport.SetOptions(c.urlParams_, opts...)
  35400. res, err := c.doRequest("json")
  35401. if res != nil && res.StatusCode == http.StatusNotModified {
  35402. if res.Body != nil {
  35403. res.Body.Close()
  35404. }
  35405. return nil, &googleapi.Error{
  35406. Code: res.StatusCode,
  35407. Header: res.Header,
  35408. }
  35409. }
  35410. if err != nil {
  35411. return nil, err
  35412. }
  35413. defer googleapi.CloseBody(res)
  35414. if err := googleapi.CheckResponse(res); err != nil {
  35415. return nil, err
  35416. }
  35417. ret := &Placement{
  35418. ServerResponse: googleapi.ServerResponse{
  35419. Header: res.Header,
  35420. HTTPStatusCode: res.StatusCode,
  35421. },
  35422. }
  35423. target := &ret
  35424. if err := gensupport.DecodeResponse(target, res); err != nil {
  35425. return nil, err
  35426. }
  35427. return ret, nil
  35428. // {
  35429. // "description": "Inserts a new placement.",
  35430. // "httpMethod": "POST",
  35431. // "id": "dfareporting.placements.insert",
  35432. // "parameterOrder": [
  35433. // "profileId"
  35434. // ],
  35435. // "parameters": {
  35436. // "profileId": {
  35437. // "description": "User profile ID associated with this request.",
  35438. // "format": "int64",
  35439. // "location": "path",
  35440. // "required": true,
  35441. // "type": "string"
  35442. // }
  35443. // },
  35444. // "path": "userprofiles/{profileId}/placements",
  35445. // "request": {
  35446. // "$ref": "Placement"
  35447. // },
  35448. // "response": {
  35449. // "$ref": "Placement"
  35450. // },
  35451. // "scopes": [
  35452. // "https://www.googleapis.com/auth/dfatrafficking"
  35453. // ]
  35454. // }
  35455. }
  35456. // method id "dfareporting.placements.list":
  35457. type PlacementsListCall struct {
  35458. s *Service
  35459. profileId int64
  35460. urlParams_ gensupport.URLParams
  35461. ifNoneMatch_ string
  35462. ctx_ context.Context
  35463. header_ http.Header
  35464. }
  35465. // List: Retrieves a list of placements, possibly filtered. This method
  35466. // supports paging.
  35467. func (r *PlacementsService) List(profileId int64) *PlacementsListCall {
  35468. c := &PlacementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35469. c.profileId = profileId
  35470. return c
  35471. }
  35472. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  35473. // only placements that belong to these advertisers.
  35474. func (c *PlacementsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementsListCall {
  35475. var advertiserIds_ []string
  35476. for _, v := range advertiserIds {
  35477. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  35478. }
  35479. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  35480. return c
  35481. }
  35482. // Archived sets the optional parameter "archived": Select only archived
  35483. // placements. Don't set this field to select both archived and
  35484. // non-archived placements.
  35485. func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall {
  35486. c.urlParams_.Set("archived", fmt.Sprint(archived))
  35487. return c
  35488. }
  35489. // CampaignIds sets the optional parameter "campaignIds": Select only
  35490. // placements that belong to these campaigns.
  35491. func (c *PlacementsListCall) CampaignIds(campaignIds ...int64) *PlacementsListCall {
  35492. var campaignIds_ []string
  35493. for _, v := range campaignIds {
  35494. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  35495. }
  35496. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  35497. return c
  35498. }
  35499. // Compatibilities sets the optional parameter "compatibilities": Select
  35500. // only placements that are associated with these compatibilities.
  35501. // DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop
  35502. // or on mobile devices for regular or interstitial ads respectively.
  35503. // APP and APP_INTERSTITIAL are for rendering in mobile apps.
  35504. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  35505. // with the VAST standard.
  35506. //
  35507. // Possible values:
  35508. // "APP"
  35509. // "APP_INTERSTITIAL"
  35510. // "DISPLAY"
  35511. // "DISPLAY_INTERSTITIAL"
  35512. // "IN_STREAM_AUDIO"
  35513. // "IN_STREAM_VIDEO"
  35514. func (c *PlacementsListCall) Compatibilities(compatibilities ...string) *PlacementsListCall {
  35515. c.urlParams_.SetMulti("compatibilities", append([]string{}, compatibilities...))
  35516. return c
  35517. }
  35518. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  35519. // Select only placements that are associated with these content
  35520. // categories.
  35521. func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementsListCall {
  35522. var contentCategoryIds_ []string
  35523. for _, v := range contentCategoryIds {
  35524. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  35525. }
  35526. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  35527. return c
  35528. }
  35529. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  35530. // Select only placements that are associated with these directory
  35531. // sites.
  35532. func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementsListCall {
  35533. var directorySiteIds_ []string
  35534. for _, v := range directorySiteIds {
  35535. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  35536. }
  35537. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  35538. return c
  35539. }
  35540. // GroupIds sets the optional parameter "groupIds": Select only
  35541. // placements that belong to these placement groups.
  35542. func (c *PlacementsListCall) GroupIds(groupIds ...int64) *PlacementsListCall {
  35543. var groupIds_ []string
  35544. for _, v := range groupIds {
  35545. groupIds_ = append(groupIds_, fmt.Sprint(v))
  35546. }
  35547. c.urlParams_.SetMulti("groupIds", groupIds_)
  35548. return c
  35549. }
  35550. // Ids sets the optional parameter "ids": Select only placements with
  35551. // these IDs.
  35552. func (c *PlacementsListCall) Ids(ids ...int64) *PlacementsListCall {
  35553. var ids_ []string
  35554. for _, v := range ids {
  35555. ids_ = append(ids_, fmt.Sprint(v))
  35556. }
  35557. c.urlParams_.SetMulti("ids", ids_)
  35558. return c
  35559. }
  35560. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  35561. // placements or placement groups whose end date is on or before the
  35562. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  35563. func (c *PlacementsListCall) MaxEndDate(maxEndDate string) *PlacementsListCall {
  35564. c.urlParams_.Set("maxEndDate", maxEndDate)
  35565. return c
  35566. }
  35567. // MaxResults sets the optional parameter "maxResults": Maximum number
  35568. // of results to return.
  35569. func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall {
  35570. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35571. return c
  35572. }
  35573. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  35574. // placements or placement groups whose start date is on or before the
  35575. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  35576. func (c *PlacementsListCall) MaxStartDate(maxStartDate string) *PlacementsListCall {
  35577. c.urlParams_.Set("maxStartDate", maxStartDate)
  35578. return c
  35579. }
  35580. // MinEndDate sets the optional parameter "minEndDate": Select only
  35581. // placements or placement groups whose end date is on or after the
  35582. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  35583. func (c *PlacementsListCall) MinEndDate(minEndDate string) *PlacementsListCall {
  35584. c.urlParams_.Set("minEndDate", minEndDate)
  35585. return c
  35586. }
  35587. // MinStartDate sets the optional parameter "minStartDate": Select only
  35588. // placements or placement groups whose start date is on or after the
  35589. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  35590. func (c *PlacementsListCall) MinStartDate(minStartDate string) *PlacementsListCall {
  35591. c.urlParams_.Set("minStartDate", minStartDate)
  35592. return c
  35593. }
  35594. // PageToken sets the optional parameter "pageToken": Value of the
  35595. // nextPageToken from the previous result page.
  35596. func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall {
  35597. c.urlParams_.Set("pageToken", pageToken)
  35598. return c
  35599. }
  35600. // PaymentSource sets the optional parameter "paymentSource": Select
  35601. // only placements with this payment source.
  35602. //
  35603. // Possible values:
  35604. // "PLACEMENT_AGENCY_PAID"
  35605. // "PLACEMENT_PUBLISHER_PAID"
  35606. func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall {
  35607. c.urlParams_.Set("paymentSource", paymentSource)
  35608. return c
  35609. }
  35610. // PlacementStrategyIds sets the optional parameter
  35611. // "placementStrategyIds": Select only placements that are associated
  35612. // with these placement strategies.
  35613. func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementsListCall {
  35614. var placementStrategyIds_ []string
  35615. for _, v := range placementStrategyIds {
  35616. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  35617. }
  35618. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  35619. return c
  35620. }
  35621. // PricingTypes sets the optional parameter "pricingTypes": Select only
  35622. // placements with these pricing types.
  35623. //
  35624. // Possible values:
  35625. // "PRICING_TYPE_CPA"
  35626. // "PRICING_TYPE_CPC"
  35627. // "PRICING_TYPE_CPM"
  35628. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  35629. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  35630. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  35631. func (c *PlacementsListCall) PricingTypes(pricingTypes ...string) *PlacementsListCall {
  35632. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  35633. return c
  35634. }
  35635. // SearchString sets the optional parameter "searchString": Allows
  35636. // searching for placements by name or ID. Wildcards (*) are allowed.
  35637. // For example, "placement*2015" will return placements with names like
  35638. // "placement June 2015", "placement May 2015", or simply "placements
  35639. // 2015". Most of the searches also add wildcards implicitly at the
  35640. // start and the end of the search string. For example, a search string
  35641. // of "placement" will match placements with name "my placement",
  35642. // "placement 2015", or simply "placement".
  35643. func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall {
  35644. c.urlParams_.Set("searchString", searchString)
  35645. return c
  35646. }
  35647. // SiteIds sets the optional parameter "siteIds": Select only placements
  35648. // that are associated with these sites.
  35649. func (c *PlacementsListCall) SiteIds(siteIds ...int64) *PlacementsListCall {
  35650. var siteIds_ []string
  35651. for _, v := range siteIds {
  35652. siteIds_ = append(siteIds_, fmt.Sprint(v))
  35653. }
  35654. c.urlParams_.SetMulti("siteIds", siteIds_)
  35655. return c
  35656. }
  35657. // SizeIds sets the optional parameter "sizeIds": Select only placements
  35658. // that are associated with these sizes.
  35659. func (c *PlacementsListCall) SizeIds(sizeIds ...int64) *PlacementsListCall {
  35660. var sizeIds_ []string
  35661. for _, v := range sizeIds {
  35662. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  35663. }
  35664. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  35665. return c
  35666. }
  35667. // SortField sets the optional parameter "sortField": Field by which to
  35668. // sort the list.
  35669. //
  35670. // Possible values:
  35671. // "ID" (default)
  35672. // "NAME"
  35673. func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall {
  35674. c.urlParams_.Set("sortField", sortField)
  35675. return c
  35676. }
  35677. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  35678. // results.
  35679. //
  35680. // Possible values:
  35681. // "ASCENDING" (default)
  35682. // "DESCENDING"
  35683. func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall {
  35684. c.urlParams_.Set("sortOrder", sortOrder)
  35685. return c
  35686. }
  35687. // Fields allows partial responses to be retrieved. See
  35688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35689. // for more information.
  35690. func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall {
  35691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35692. return c
  35693. }
  35694. // IfNoneMatch sets the optional parameter which makes the operation
  35695. // fail if the object's ETag matches the given value. This is useful for
  35696. // getting updates only after the object has changed since the last
  35697. // request. Use googleapi.IsNotModified to check whether the response
  35698. // error from Do is the result of In-None-Match.
  35699. func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall {
  35700. c.ifNoneMatch_ = entityTag
  35701. return c
  35702. }
  35703. // Context sets the context to be used in this call's Do method. Any
  35704. // pending HTTP request will be aborted if the provided context is
  35705. // canceled.
  35706. func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall {
  35707. c.ctx_ = ctx
  35708. return c
  35709. }
  35710. // Header returns an http.Header that can be modified by the caller to
  35711. // add HTTP headers to the request.
  35712. func (c *PlacementsListCall) Header() http.Header {
  35713. if c.header_ == nil {
  35714. c.header_ = make(http.Header)
  35715. }
  35716. return c.header_
  35717. }
  35718. func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) {
  35719. reqHeaders := make(http.Header)
  35720. for k, v := range c.header_ {
  35721. reqHeaders[k] = v
  35722. }
  35723. reqHeaders.Set("User-Agent", c.s.userAgent())
  35724. if c.ifNoneMatch_ != "" {
  35725. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35726. }
  35727. var body io.Reader = nil
  35728. c.urlParams_.Set("alt", alt)
  35729. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35730. urls += "?" + c.urlParams_.Encode()
  35731. req, _ := http.NewRequest("GET", urls, body)
  35732. req.Header = reqHeaders
  35733. googleapi.Expand(req.URL, map[string]string{
  35734. "profileId": strconv.FormatInt(c.profileId, 10),
  35735. })
  35736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35737. }
  35738. // Do executes the "dfareporting.placements.list" call.
  35739. // Exactly one of *PlacementsListResponse or error will be non-nil. Any
  35740. // non-2xx status code is an error. Response headers are in either
  35741. // *PlacementsListResponse.ServerResponse.Header or (if a response was
  35742. // returned at all) in error.(*googleapi.Error).Header. Use
  35743. // googleapi.IsNotModified to check whether the returned error was
  35744. // because http.StatusNotModified was returned.
  35745. func (c *PlacementsListCall) Do(opts ...googleapi.CallOption) (*PlacementsListResponse, error) {
  35746. gensupport.SetOptions(c.urlParams_, opts...)
  35747. res, err := c.doRequest("json")
  35748. if res != nil && res.StatusCode == http.StatusNotModified {
  35749. if res.Body != nil {
  35750. res.Body.Close()
  35751. }
  35752. return nil, &googleapi.Error{
  35753. Code: res.StatusCode,
  35754. Header: res.Header,
  35755. }
  35756. }
  35757. if err != nil {
  35758. return nil, err
  35759. }
  35760. defer googleapi.CloseBody(res)
  35761. if err := googleapi.CheckResponse(res); err != nil {
  35762. return nil, err
  35763. }
  35764. ret := &PlacementsListResponse{
  35765. ServerResponse: googleapi.ServerResponse{
  35766. Header: res.Header,
  35767. HTTPStatusCode: res.StatusCode,
  35768. },
  35769. }
  35770. target := &ret
  35771. if err := gensupport.DecodeResponse(target, res); err != nil {
  35772. return nil, err
  35773. }
  35774. return ret, nil
  35775. // {
  35776. // "description": "Retrieves a list of placements, possibly filtered. This method supports paging.",
  35777. // "httpMethod": "GET",
  35778. // "id": "dfareporting.placements.list",
  35779. // "parameterOrder": [
  35780. // "profileId"
  35781. // ],
  35782. // "parameters": {
  35783. // "advertiserIds": {
  35784. // "description": "Select only placements that belong to these advertisers.",
  35785. // "format": "int64",
  35786. // "location": "query",
  35787. // "repeated": true,
  35788. // "type": "string"
  35789. // },
  35790. // "archived": {
  35791. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  35792. // "location": "query",
  35793. // "type": "boolean"
  35794. // },
  35795. // "campaignIds": {
  35796. // "description": "Select only placements that belong to these campaigns.",
  35797. // "format": "int64",
  35798. // "location": "query",
  35799. // "repeated": true,
  35800. // "type": "string"
  35801. // },
  35802. // "compatibilities": {
  35803. // "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.",
  35804. // "enum": [
  35805. // "APP",
  35806. // "APP_INTERSTITIAL",
  35807. // "DISPLAY",
  35808. // "DISPLAY_INTERSTITIAL",
  35809. // "IN_STREAM_AUDIO",
  35810. // "IN_STREAM_VIDEO"
  35811. // ],
  35812. // "enumDescriptions": [
  35813. // "",
  35814. // "",
  35815. // "",
  35816. // "",
  35817. // "",
  35818. // ""
  35819. // ],
  35820. // "location": "query",
  35821. // "repeated": true,
  35822. // "type": "string"
  35823. // },
  35824. // "contentCategoryIds": {
  35825. // "description": "Select only placements that are associated with these content categories.",
  35826. // "format": "int64",
  35827. // "location": "query",
  35828. // "repeated": true,
  35829. // "type": "string"
  35830. // },
  35831. // "directorySiteIds": {
  35832. // "description": "Select only placements that are associated with these directory sites.",
  35833. // "format": "int64",
  35834. // "location": "query",
  35835. // "repeated": true,
  35836. // "type": "string"
  35837. // },
  35838. // "groupIds": {
  35839. // "description": "Select only placements that belong to these placement groups.",
  35840. // "format": "int64",
  35841. // "location": "query",
  35842. // "repeated": true,
  35843. // "type": "string"
  35844. // },
  35845. // "ids": {
  35846. // "description": "Select only placements with these IDs.",
  35847. // "format": "int64",
  35848. // "location": "query",
  35849. // "repeated": true,
  35850. // "type": "string"
  35851. // },
  35852. // "maxEndDate": {
  35853. // "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\".",
  35854. // "location": "query",
  35855. // "type": "string"
  35856. // },
  35857. // "maxResults": {
  35858. // "default": "1000",
  35859. // "description": "Maximum number of results to return.",
  35860. // "format": "int32",
  35861. // "location": "query",
  35862. // "maximum": "1000",
  35863. // "minimum": "0",
  35864. // "type": "integer"
  35865. // },
  35866. // "maxStartDate": {
  35867. // "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\".",
  35868. // "location": "query",
  35869. // "type": "string"
  35870. // },
  35871. // "minEndDate": {
  35872. // "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\".",
  35873. // "location": "query",
  35874. // "type": "string"
  35875. // },
  35876. // "minStartDate": {
  35877. // "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\".",
  35878. // "location": "query",
  35879. // "type": "string"
  35880. // },
  35881. // "pageToken": {
  35882. // "description": "Value of the nextPageToken from the previous result page.",
  35883. // "location": "query",
  35884. // "type": "string"
  35885. // },
  35886. // "paymentSource": {
  35887. // "description": "Select only placements with this payment source.",
  35888. // "enum": [
  35889. // "PLACEMENT_AGENCY_PAID",
  35890. // "PLACEMENT_PUBLISHER_PAID"
  35891. // ],
  35892. // "enumDescriptions": [
  35893. // "",
  35894. // ""
  35895. // ],
  35896. // "location": "query",
  35897. // "type": "string"
  35898. // },
  35899. // "placementStrategyIds": {
  35900. // "description": "Select only placements that are associated with these placement strategies.",
  35901. // "format": "int64",
  35902. // "location": "query",
  35903. // "repeated": true,
  35904. // "type": "string"
  35905. // },
  35906. // "pricingTypes": {
  35907. // "description": "Select only placements with these pricing types.",
  35908. // "enum": [
  35909. // "PRICING_TYPE_CPA",
  35910. // "PRICING_TYPE_CPC",
  35911. // "PRICING_TYPE_CPM",
  35912. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  35913. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  35914. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  35915. // ],
  35916. // "enumDescriptions": [
  35917. // "",
  35918. // "",
  35919. // "",
  35920. // "",
  35921. // "",
  35922. // ""
  35923. // ],
  35924. // "location": "query",
  35925. // "repeated": true,
  35926. // "type": "string"
  35927. // },
  35928. // "profileId": {
  35929. // "description": "User profile ID associated with this request.",
  35930. // "format": "int64",
  35931. // "location": "path",
  35932. // "required": true,
  35933. // "type": "string"
  35934. // },
  35935. // "searchString": {
  35936. // "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\".",
  35937. // "location": "query",
  35938. // "type": "string"
  35939. // },
  35940. // "siteIds": {
  35941. // "description": "Select only placements that are associated with these sites.",
  35942. // "format": "int64",
  35943. // "location": "query",
  35944. // "repeated": true,
  35945. // "type": "string"
  35946. // },
  35947. // "sizeIds": {
  35948. // "description": "Select only placements that are associated with these sizes.",
  35949. // "format": "int64",
  35950. // "location": "query",
  35951. // "repeated": true,
  35952. // "type": "string"
  35953. // },
  35954. // "sortField": {
  35955. // "default": "ID",
  35956. // "description": "Field by which to sort the list.",
  35957. // "enum": [
  35958. // "ID",
  35959. // "NAME"
  35960. // ],
  35961. // "enumDescriptions": [
  35962. // "",
  35963. // ""
  35964. // ],
  35965. // "location": "query",
  35966. // "type": "string"
  35967. // },
  35968. // "sortOrder": {
  35969. // "default": "ASCENDING",
  35970. // "description": "Order of sorted results.",
  35971. // "enum": [
  35972. // "ASCENDING",
  35973. // "DESCENDING"
  35974. // ],
  35975. // "enumDescriptions": [
  35976. // "",
  35977. // ""
  35978. // ],
  35979. // "location": "query",
  35980. // "type": "string"
  35981. // }
  35982. // },
  35983. // "path": "userprofiles/{profileId}/placements",
  35984. // "response": {
  35985. // "$ref": "PlacementsListResponse"
  35986. // },
  35987. // "scopes": [
  35988. // "https://www.googleapis.com/auth/dfatrafficking"
  35989. // ]
  35990. // }
  35991. }
  35992. // Pages invokes f for each page of results.
  35993. // A non-nil error returned from f will halt the iteration.
  35994. // The provided context supersedes any context provided to the Context method.
  35995. func (c *PlacementsListCall) Pages(ctx context.Context, f func(*PlacementsListResponse) error) error {
  35996. c.ctx_ = ctx
  35997. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35998. for {
  35999. x, err := c.Do()
  36000. if err != nil {
  36001. return err
  36002. }
  36003. if err := f(x); err != nil {
  36004. return err
  36005. }
  36006. if x.NextPageToken == "" {
  36007. return nil
  36008. }
  36009. c.PageToken(x.NextPageToken)
  36010. }
  36011. }
  36012. // method id "dfareporting.placements.patch":
  36013. type PlacementsPatchCall struct {
  36014. s *Service
  36015. profileId int64
  36016. placement *Placement
  36017. urlParams_ gensupport.URLParams
  36018. ctx_ context.Context
  36019. header_ http.Header
  36020. }
  36021. // Patch: Updates an existing placement. This method supports patch
  36022. // semantics.
  36023. func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall {
  36024. c := &PlacementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36025. c.profileId = profileId
  36026. c.urlParams_.Set("id", fmt.Sprint(id))
  36027. c.placement = placement
  36028. return c
  36029. }
  36030. // Fields allows partial responses to be retrieved. See
  36031. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36032. // for more information.
  36033. func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall {
  36034. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36035. return c
  36036. }
  36037. // Context sets the context to be used in this call's Do method. Any
  36038. // pending HTTP request will be aborted if the provided context is
  36039. // canceled.
  36040. func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall {
  36041. c.ctx_ = ctx
  36042. return c
  36043. }
  36044. // Header returns an http.Header that can be modified by the caller to
  36045. // add HTTP headers to the request.
  36046. func (c *PlacementsPatchCall) Header() http.Header {
  36047. if c.header_ == nil {
  36048. c.header_ = make(http.Header)
  36049. }
  36050. return c.header_
  36051. }
  36052. func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) {
  36053. reqHeaders := make(http.Header)
  36054. for k, v := range c.header_ {
  36055. reqHeaders[k] = v
  36056. }
  36057. reqHeaders.Set("User-Agent", c.s.userAgent())
  36058. var body io.Reader = nil
  36059. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36060. if err != nil {
  36061. return nil, err
  36062. }
  36063. reqHeaders.Set("Content-Type", "application/json")
  36064. c.urlParams_.Set("alt", alt)
  36065. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36066. urls += "?" + c.urlParams_.Encode()
  36067. req, _ := http.NewRequest("PATCH", urls, body)
  36068. req.Header = reqHeaders
  36069. googleapi.Expand(req.URL, map[string]string{
  36070. "profileId": strconv.FormatInt(c.profileId, 10),
  36071. })
  36072. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36073. }
  36074. // Do executes the "dfareporting.placements.patch" call.
  36075. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36076. // status code is an error. Response headers are in either
  36077. // *Placement.ServerResponse.Header or (if a response was returned at
  36078. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36079. // to check whether the returned error was because
  36080. // http.StatusNotModified was returned.
  36081. func (c *PlacementsPatchCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36082. gensupport.SetOptions(c.urlParams_, opts...)
  36083. res, err := c.doRequest("json")
  36084. if res != nil && res.StatusCode == http.StatusNotModified {
  36085. if res.Body != nil {
  36086. res.Body.Close()
  36087. }
  36088. return nil, &googleapi.Error{
  36089. Code: res.StatusCode,
  36090. Header: res.Header,
  36091. }
  36092. }
  36093. if err != nil {
  36094. return nil, err
  36095. }
  36096. defer googleapi.CloseBody(res)
  36097. if err := googleapi.CheckResponse(res); err != nil {
  36098. return nil, err
  36099. }
  36100. ret := &Placement{
  36101. ServerResponse: googleapi.ServerResponse{
  36102. Header: res.Header,
  36103. HTTPStatusCode: res.StatusCode,
  36104. },
  36105. }
  36106. target := &ret
  36107. if err := gensupport.DecodeResponse(target, res); err != nil {
  36108. return nil, err
  36109. }
  36110. return ret, nil
  36111. // {
  36112. // "description": "Updates an existing placement. This method supports patch semantics.",
  36113. // "httpMethod": "PATCH",
  36114. // "id": "dfareporting.placements.patch",
  36115. // "parameterOrder": [
  36116. // "profileId",
  36117. // "id"
  36118. // ],
  36119. // "parameters": {
  36120. // "id": {
  36121. // "description": "Placement ID.",
  36122. // "format": "int64",
  36123. // "location": "query",
  36124. // "required": true,
  36125. // "type": "string"
  36126. // },
  36127. // "profileId": {
  36128. // "description": "User profile ID associated with this request.",
  36129. // "format": "int64",
  36130. // "location": "path",
  36131. // "required": true,
  36132. // "type": "string"
  36133. // }
  36134. // },
  36135. // "path": "userprofiles/{profileId}/placements",
  36136. // "request": {
  36137. // "$ref": "Placement"
  36138. // },
  36139. // "response": {
  36140. // "$ref": "Placement"
  36141. // },
  36142. // "scopes": [
  36143. // "https://www.googleapis.com/auth/dfatrafficking"
  36144. // ]
  36145. // }
  36146. }
  36147. // method id "dfareporting.placements.update":
  36148. type PlacementsUpdateCall struct {
  36149. s *Service
  36150. profileId int64
  36151. placement *Placement
  36152. urlParams_ gensupport.URLParams
  36153. ctx_ context.Context
  36154. header_ http.Header
  36155. }
  36156. // Update: Updates an existing placement.
  36157. func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall {
  36158. c := &PlacementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36159. c.profileId = profileId
  36160. c.placement = placement
  36161. return c
  36162. }
  36163. // Fields allows partial responses to be retrieved. See
  36164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36165. // for more information.
  36166. func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall {
  36167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36168. return c
  36169. }
  36170. // Context sets the context to be used in this call's Do method. Any
  36171. // pending HTTP request will be aborted if the provided context is
  36172. // canceled.
  36173. func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall {
  36174. c.ctx_ = ctx
  36175. return c
  36176. }
  36177. // Header returns an http.Header that can be modified by the caller to
  36178. // add HTTP headers to the request.
  36179. func (c *PlacementsUpdateCall) Header() http.Header {
  36180. if c.header_ == nil {
  36181. c.header_ = make(http.Header)
  36182. }
  36183. return c.header_
  36184. }
  36185. func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) {
  36186. reqHeaders := make(http.Header)
  36187. for k, v := range c.header_ {
  36188. reqHeaders[k] = v
  36189. }
  36190. reqHeaders.Set("User-Agent", c.s.userAgent())
  36191. var body io.Reader = nil
  36192. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  36193. if err != nil {
  36194. return nil, err
  36195. }
  36196. reqHeaders.Set("Content-Type", "application/json")
  36197. c.urlParams_.Set("alt", alt)
  36198. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  36199. urls += "?" + c.urlParams_.Encode()
  36200. req, _ := http.NewRequest("PUT", urls, body)
  36201. req.Header = reqHeaders
  36202. googleapi.Expand(req.URL, map[string]string{
  36203. "profileId": strconv.FormatInt(c.profileId, 10),
  36204. })
  36205. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36206. }
  36207. // Do executes the "dfareporting.placements.update" call.
  36208. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  36209. // status code is an error. Response headers are in either
  36210. // *Placement.ServerResponse.Header or (if a response was returned at
  36211. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36212. // to check whether the returned error was because
  36213. // http.StatusNotModified was returned.
  36214. func (c *PlacementsUpdateCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  36215. gensupport.SetOptions(c.urlParams_, opts...)
  36216. res, err := c.doRequest("json")
  36217. if res != nil && res.StatusCode == http.StatusNotModified {
  36218. if res.Body != nil {
  36219. res.Body.Close()
  36220. }
  36221. return nil, &googleapi.Error{
  36222. Code: res.StatusCode,
  36223. Header: res.Header,
  36224. }
  36225. }
  36226. if err != nil {
  36227. return nil, err
  36228. }
  36229. defer googleapi.CloseBody(res)
  36230. if err := googleapi.CheckResponse(res); err != nil {
  36231. return nil, err
  36232. }
  36233. ret := &Placement{
  36234. ServerResponse: googleapi.ServerResponse{
  36235. Header: res.Header,
  36236. HTTPStatusCode: res.StatusCode,
  36237. },
  36238. }
  36239. target := &ret
  36240. if err := gensupport.DecodeResponse(target, res); err != nil {
  36241. return nil, err
  36242. }
  36243. return ret, nil
  36244. // {
  36245. // "description": "Updates an existing placement.",
  36246. // "httpMethod": "PUT",
  36247. // "id": "dfareporting.placements.update",
  36248. // "parameterOrder": [
  36249. // "profileId"
  36250. // ],
  36251. // "parameters": {
  36252. // "profileId": {
  36253. // "description": "User profile ID associated with this request.",
  36254. // "format": "int64",
  36255. // "location": "path",
  36256. // "required": true,
  36257. // "type": "string"
  36258. // }
  36259. // },
  36260. // "path": "userprofiles/{profileId}/placements",
  36261. // "request": {
  36262. // "$ref": "Placement"
  36263. // },
  36264. // "response": {
  36265. // "$ref": "Placement"
  36266. // },
  36267. // "scopes": [
  36268. // "https://www.googleapis.com/auth/dfatrafficking"
  36269. // ]
  36270. // }
  36271. }
  36272. // method id "dfareporting.platformTypes.get":
  36273. type PlatformTypesGetCall struct {
  36274. s *Service
  36275. profileId int64
  36276. id int64
  36277. urlParams_ gensupport.URLParams
  36278. ifNoneMatch_ string
  36279. ctx_ context.Context
  36280. header_ http.Header
  36281. }
  36282. // Get: Gets one platform type by ID.
  36283. func (r *PlatformTypesService) Get(profileId int64, id int64) *PlatformTypesGetCall {
  36284. c := &PlatformTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36285. c.profileId = profileId
  36286. c.id = id
  36287. return c
  36288. }
  36289. // Fields allows partial responses to be retrieved. See
  36290. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36291. // for more information.
  36292. func (c *PlatformTypesGetCall) Fields(s ...googleapi.Field) *PlatformTypesGetCall {
  36293. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36294. return c
  36295. }
  36296. // IfNoneMatch sets the optional parameter which makes the operation
  36297. // fail if the object's ETag matches the given value. This is useful for
  36298. // getting updates only after the object has changed since the last
  36299. // request. Use googleapi.IsNotModified to check whether the response
  36300. // error from Do is the result of In-None-Match.
  36301. func (c *PlatformTypesGetCall) IfNoneMatch(entityTag string) *PlatformTypesGetCall {
  36302. c.ifNoneMatch_ = entityTag
  36303. return c
  36304. }
  36305. // Context sets the context to be used in this call's Do method. Any
  36306. // pending HTTP request will be aborted if the provided context is
  36307. // canceled.
  36308. func (c *PlatformTypesGetCall) Context(ctx context.Context) *PlatformTypesGetCall {
  36309. c.ctx_ = ctx
  36310. return c
  36311. }
  36312. // Header returns an http.Header that can be modified by the caller to
  36313. // add HTTP headers to the request.
  36314. func (c *PlatformTypesGetCall) Header() http.Header {
  36315. if c.header_ == nil {
  36316. c.header_ = make(http.Header)
  36317. }
  36318. return c.header_
  36319. }
  36320. func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) {
  36321. reqHeaders := make(http.Header)
  36322. for k, v := range c.header_ {
  36323. reqHeaders[k] = v
  36324. }
  36325. reqHeaders.Set("User-Agent", c.s.userAgent())
  36326. if c.ifNoneMatch_ != "" {
  36327. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36328. }
  36329. var body io.Reader = nil
  36330. c.urlParams_.Set("alt", alt)
  36331. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes/{id}")
  36332. urls += "?" + c.urlParams_.Encode()
  36333. req, _ := http.NewRequest("GET", urls, body)
  36334. req.Header = reqHeaders
  36335. googleapi.Expand(req.URL, map[string]string{
  36336. "profileId": strconv.FormatInt(c.profileId, 10),
  36337. "id": strconv.FormatInt(c.id, 10),
  36338. })
  36339. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36340. }
  36341. // Do executes the "dfareporting.platformTypes.get" call.
  36342. // Exactly one of *PlatformType or error will be non-nil. Any non-2xx
  36343. // status code is an error. Response headers are in either
  36344. // *PlatformType.ServerResponse.Header or (if a response was returned at
  36345. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36346. // to check whether the returned error was because
  36347. // http.StatusNotModified was returned.
  36348. func (c *PlatformTypesGetCall) Do(opts ...googleapi.CallOption) (*PlatformType, error) {
  36349. gensupport.SetOptions(c.urlParams_, opts...)
  36350. res, err := c.doRequest("json")
  36351. if res != nil && res.StatusCode == http.StatusNotModified {
  36352. if res.Body != nil {
  36353. res.Body.Close()
  36354. }
  36355. return nil, &googleapi.Error{
  36356. Code: res.StatusCode,
  36357. Header: res.Header,
  36358. }
  36359. }
  36360. if err != nil {
  36361. return nil, err
  36362. }
  36363. defer googleapi.CloseBody(res)
  36364. if err := googleapi.CheckResponse(res); err != nil {
  36365. return nil, err
  36366. }
  36367. ret := &PlatformType{
  36368. ServerResponse: googleapi.ServerResponse{
  36369. Header: res.Header,
  36370. HTTPStatusCode: res.StatusCode,
  36371. },
  36372. }
  36373. target := &ret
  36374. if err := gensupport.DecodeResponse(target, res); err != nil {
  36375. return nil, err
  36376. }
  36377. return ret, nil
  36378. // {
  36379. // "description": "Gets one platform type by ID.",
  36380. // "httpMethod": "GET",
  36381. // "id": "dfareporting.platformTypes.get",
  36382. // "parameterOrder": [
  36383. // "profileId",
  36384. // "id"
  36385. // ],
  36386. // "parameters": {
  36387. // "id": {
  36388. // "description": "Platform type ID.",
  36389. // "format": "int64",
  36390. // "location": "path",
  36391. // "required": true,
  36392. // "type": "string"
  36393. // },
  36394. // "profileId": {
  36395. // "description": "User profile ID associated with this request.",
  36396. // "format": "int64",
  36397. // "location": "path",
  36398. // "required": true,
  36399. // "type": "string"
  36400. // }
  36401. // },
  36402. // "path": "userprofiles/{profileId}/platformTypes/{id}",
  36403. // "response": {
  36404. // "$ref": "PlatformType"
  36405. // },
  36406. // "scopes": [
  36407. // "https://www.googleapis.com/auth/dfatrafficking"
  36408. // ]
  36409. // }
  36410. }
  36411. // method id "dfareporting.platformTypes.list":
  36412. type PlatformTypesListCall struct {
  36413. s *Service
  36414. profileId int64
  36415. urlParams_ gensupport.URLParams
  36416. ifNoneMatch_ string
  36417. ctx_ context.Context
  36418. header_ http.Header
  36419. }
  36420. // List: Retrieves a list of platform types.
  36421. func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall {
  36422. c := &PlatformTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36423. c.profileId = profileId
  36424. return c
  36425. }
  36426. // Fields allows partial responses to be retrieved. See
  36427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36428. // for more information.
  36429. func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall {
  36430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36431. return c
  36432. }
  36433. // IfNoneMatch sets the optional parameter which makes the operation
  36434. // fail if the object's ETag matches the given value. This is useful for
  36435. // getting updates only after the object has changed since the last
  36436. // request. Use googleapi.IsNotModified to check whether the response
  36437. // error from Do is the result of In-None-Match.
  36438. func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall {
  36439. c.ifNoneMatch_ = entityTag
  36440. return c
  36441. }
  36442. // Context sets the context to be used in this call's Do method. Any
  36443. // pending HTTP request will be aborted if the provided context is
  36444. // canceled.
  36445. func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall {
  36446. c.ctx_ = ctx
  36447. return c
  36448. }
  36449. // Header returns an http.Header that can be modified by the caller to
  36450. // add HTTP headers to the request.
  36451. func (c *PlatformTypesListCall) Header() http.Header {
  36452. if c.header_ == nil {
  36453. c.header_ = make(http.Header)
  36454. }
  36455. return c.header_
  36456. }
  36457. func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) {
  36458. reqHeaders := make(http.Header)
  36459. for k, v := range c.header_ {
  36460. reqHeaders[k] = v
  36461. }
  36462. reqHeaders.Set("User-Agent", c.s.userAgent())
  36463. if c.ifNoneMatch_ != "" {
  36464. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36465. }
  36466. var body io.Reader = nil
  36467. c.urlParams_.Set("alt", alt)
  36468. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes")
  36469. urls += "?" + c.urlParams_.Encode()
  36470. req, _ := http.NewRequest("GET", urls, body)
  36471. req.Header = reqHeaders
  36472. googleapi.Expand(req.URL, map[string]string{
  36473. "profileId": strconv.FormatInt(c.profileId, 10),
  36474. })
  36475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36476. }
  36477. // Do executes the "dfareporting.platformTypes.list" call.
  36478. // Exactly one of *PlatformTypesListResponse or error will be non-nil.
  36479. // Any non-2xx status code is an error. Response headers are in either
  36480. // *PlatformTypesListResponse.ServerResponse.Header or (if a response
  36481. // was returned at all) in error.(*googleapi.Error).Header. Use
  36482. // googleapi.IsNotModified to check whether the returned error was
  36483. // because http.StatusNotModified was returned.
  36484. func (c *PlatformTypesListCall) Do(opts ...googleapi.CallOption) (*PlatformTypesListResponse, error) {
  36485. gensupport.SetOptions(c.urlParams_, opts...)
  36486. res, err := c.doRequest("json")
  36487. if res != nil && res.StatusCode == http.StatusNotModified {
  36488. if res.Body != nil {
  36489. res.Body.Close()
  36490. }
  36491. return nil, &googleapi.Error{
  36492. Code: res.StatusCode,
  36493. Header: res.Header,
  36494. }
  36495. }
  36496. if err != nil {
  36497. return nil, err
  36498. }
  36499. defer googleapi.CloseBody(res)
  36500. if err := googleapi.CheckResponse(res); err != nil {
  36501. return nil, err
  36502. }
  36503. ret := &PlatformTypesListResponse{
  36504. ServerResponse: googleapi.ServerResponse{
  36505. Header: res.Header,
  36506. HTTPStatusCode: res.StatusCode,
  36507. },
  36508. }
  36509. target := &ret
  36510. if err := gensupport.DecodeResponse(target, res); err != nil {
  36511. return nil, err
  36512. }
  36513. return ret, nil
  36514. // {
  36515. // "description": "Retrieves a list of platform types.",
  36516. // "httpMethod": "GET",
  36517. // "id": "dfareporting.platformTypes.list",
  36518. // "parameterOrder": [
  36519. // "profileId"
  36520. // ],
  36521. // "parameters": {
  36522. // "profileId": {
  36523. // "description": "User profile ID associated with this request.",
  36524. // "format": "int64",
  36525. // "location": "path",
  36526. // "required": true,
  36527. // "type": "string"
  36528. // }
  36529. // },
  36530. // "path": "userprofiles/{profileId}/platformTypes",
  36531. // "response": {
  36532. // "$ref": "PlatformTypesListResponse"
  36533. // },
  36534. // "scopes": [
  36535. // "https://www.googleapis.com/auth/dfatrafficking"
  36536. // ]
  36537. // }
  36538. }
  36539. // method id "dfareporting.postalCodes.get":
  36540. type PostalCodesGetCall struct {
  36541. s *Service
  36542. profileId int64
  36543. code string
  36544. urlParams_ gensupport.URLParams
  36545. ifNoneMatch_ string
  36546. ctx_ context.Context
  36547. header_ http.Header
  36548. }
  36549. // Get: Gets one postal code by ID.
  36550. func (r *PostalCodesService) Get(profileId int64, code string) *PostalCodesGetCall {
  36551. c := &PostalCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36552. c.profileId = profileId
  36553. c.code = code
  36554. return c
  36555. }
  36556. // Fields allows partial responses to be retrieved. See
  36557. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36558. // for more information.
  36559. func (c *PostalCodesGetCall) Fields(s ...googleapi.Field) *PostalCodesGetCall {
  36560. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36561. return c
  36562. }
  36563. // IfNoneMatch sets the optional parameter which makes the operation
  36564. // fail if the object's ETag matches the given value. This is useful for
  36565. // getting updates only after the object has changed since the last
  36566. // request. Use googleapi.IsNotModified to check whether the response
  36567. // error from Do is the result of In-None-Match.
  36568. func (c *PostalCodesGetCall) IfNoneMatch(entityTag string) *PostalCodesGetCall {
  36569. c.ifNoneMatch_ = entityTag
  36570. return c
  36571. }
  36572. // Context sets the context to be used in this call's Do method. Any
  36573. // pending HTTP request will be aborted if the provided context is
  36574. // canceled.
  36575. func (c *PostalCodesGetCall) Context(ctx context.Context) *PostalCodesGetCall {
  36576. c.ctx_ = ctx
  36577. return c
  36578. }
  36579. // Header returns an http.Header that can be modified by the caller to
  36580. // add HTTP headers to the request.
  36581. func (c *PostalCodesGetCall) Header() http.Header {
  36582. if c.header_ == nil {
  36583. c.header_ = make(http.Header)
  36584. }
  36585. return c.header_
  36586. }
  36587. func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) {
  36588. reqHeaders := make(http.Header)
  36589. for k, v := range c.header_ {
  36590. reqHeaders[k] = v
  36591. }
  36592. reqHeaders.Set("User-Agent", c.s.userAgent())
  36593. if c.ifNoneMatch_ != "" {
  36594. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36595. }
  36596. var body io.Reader = nil
  36597. c.urlParams_.Set("alt", alt)
  36598. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes/{code}")
  36599. urls += "?" + c.urlParams_.Encode()
  36600. req, _ := http.NewRequest("GET", urls, body)
  36601. req.Header = reqHeaders
  36602. googleapi.Expand(req.URL, map[string]string{
  36603. "profileId": strconv.FormatInt(c.profileId, 10),
  36604. "code": c.code,
  36605. })
  36606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36607. }
  36608. // Do executes the "dfareporting.postalCodes.get" call.
  36609. // Exactly one of *PostalCode or error will be non-nil. Any non-2xx
  36610. // status code is an error. Response headers are in either
  36611. // *PostalCode.ServerResponse.Header or (if a response was returned at
  36612. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36613. // to check whether the returned error was because
  36614. // http.StatusNotModified was returned.
  36615. func (c *PostalCodesGetCall) Do(opts ...googleapi.CallOption) (*PostalCode, error) {
  36616. gensupport.SetOptions(c.urlParams_, opts...)
  36617. res, err := c.doRequest("json")
  36618. if res != nil && res.StatusCode == http.StatusNotModified {
  36619. if res.Body != nil {
  36620. res.Body.Close()
  36621. }
  36622. return nil, &googleapi.Error{
  36623. Code: res.StatusCode,
  36624. Header: res.Header,
  36625. }
  36626. }
  36627. if err != nil {
  36628. return nil, err
  36629. }
  36630. defer googleapi.CloseBody(res)
  36631. if err := googleapi.CheckResponse(res); err != nil {
  36632. return nil, err
  36633. }
  36634. ret := &PostalCode{
  36635. ServerResponse: googleapi.ServerResponse{
  36636. Header: res.Header,
  36637. HTTPStatusCode: res.StatusCode,
  36638. },
  36639. }
  36640. target := &ret
  36641. if err := gensupport.DecodeResponse(target, res); err != nil {
  36642. return nil, err
  36643. }
  36644. return ret, nil
  36645. // {
  36646. // "description": "Gets one postal code by ID.",
  36647. // "httpMethod": "GET",
  36648. // "id": "dfareporting.postalCodes.get",
  36649. // "parameterOrder": [
  36650. // "profileId",
  36651. // "code"
  36652. // ],
  36653. // "parameters": {
  36654. // "code": {
  36655. // "description": "Postal code ID.",
  36656. // "location": "path",
  36657. // "required": true,
  36658. // "type": "string"
  36659. // },
  36660. // "profileId": {
  36661. // "description": "User profile ID associated with this request.",
  36662. // "format": "int64",
  36663. // "location": "path",
  36664. // "required": true,
  36665. // "type": "string"
  36666. // }
  36667. // },
  36668. // "path": "userprofiles/{profileId}/postalCodes/{code}",
  36669. // "response": {
  36670. // "$ref": "PostalCode"
  36671. // },
  36672. // "scopes": [
  36673. // "https://www.googleapis.com/auth/dfatrafficking"
  36674. // ]
  36675. // }
  36676. }
  36677. // method id "dfareporting.postalCodes.list":
  36678. type PostalCodesListCall struct {
  36679. s *Service
  36680. profileId int64
  36681. urlParams_ gensupport.URLParams
  36682. ifNoneMatch_ string
  36683. ctx_ context.Context
  36684. header_ http.Header
  36685. }
  36686. // List: Retrieves a list of postal codes.
  36687. func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall {
  36688. c := &PostalCodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36689. c.profileId = profileId
  36690. return c
  36691. }
  36692. // Fields allows partial responses to be retrieved. See
  36693. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36694. // for more information.
  36695. func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall {
  36696. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36697. return c
  36698. }
  36699. // IfNoneMatch sets the optional parameter which makes the operation
  36700. // fail if the object's ETag matches the given value. This is useful for
  36701. // getting updates only after the object has changed since the last
  36702. // request. Use googleapi.IsNotModified to check whether the response
  36703. // error from Do is the result of In-None-Match.
  36704. func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall {
  36705. c.ifNoneMatch_ = entityTag
  36706. return c
  36707. }
  36708. // Context sets the context to be used in this call's Do method. Any
  36709. // pending HTTP request will be aborted if the provided context is
  36710. // canceled.
  36711. func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall {
  36712. c.ctx_ = ctx
  36713. return c
  36714. }
  36715. // Header returns an http.Header that can be modified by the caller to
  36716. // add HTTP headers to the request.
  36717. func (c *PostalCodesListCall) Header() http.Header {
  36718. if c.header_ == nil {
  36719. c.header_ = make(http.Header)
  36720. }
  36721. return c.header_
  36722. }
  36723. func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) {
  36724. reqHeaders := make(http.Header)
  36725. for k, v := range c.header_ {
  36726. reqHeaders[k] = v
  36727. }
  36728. reqHeaders.Set("User-Agent", c.s.userAgent())
  36729. if c.ifNoneMatch_ != "" {
  36730. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36731. }
  36732. var body io.Reader = nil
  36733. c.urlParams_.Set("alt", alt)
  36734. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes")
  36735. urls += "?" + c.urlParams_.Encode()
  36736. req, _ := http.NewRequest("GET", urls, body)
  36737. req.Header = reqHeaders
  36738. googleapi.Expand(req.URL, map[string]string{
  36739. "profileId": strconv.FormatInt(c.profileId, 10),
  36740. })
  36741. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36742. }
  36743. // Do executes the "dfareporting.postalCodes.list" call.
  36744. // Exactly one of *PostalCodesListResponse or error will be non-nil. Any
  36745. // non-2xx status code is an error. Response headers are in either
  36746. // *PostalCodesListResponse.ServerResponse.Header or (if a response was
  36747. // returned at all) in error.(*googleapi.Error).Header. Use
  36748. // googleapi.IsNotModified to check whether the returned error was
  36749. // because http.StatusNotModified was returned.
  36750. func (c *PostalCodesListCall) Do(opts ...googleapi.CallOption) (*PostalCodesListResponse, error) {
  36751. gensupport.SetOptions(c.urlParams_, opts...)
  36752. res, err := c.doRequest("json")
  36753. if res != nil && res.StatusCode == http.StatusNotModified {
  36754. if res.Body != nil {
  36755. res.Body.Close()
  36756. }
  36757. return nil, &googleapi.Error{
  36758. Code: res.StatusCode,
  36759. Header: res.Header,
  36760. }
  36761. }
  36762. if err != nil {
  36763. return nil, err
  36764. }
  36765. defer googleapi.CloseBody(res)
  36766. if err := googleapi.CheckResponse(res); err != nil {
  36767. return nil, err
  36768. }
  36769. ret := &PostalCodesListResponse{
  36770. ServerResponse: googleapi.ServerResponse{
  36771. Header: res.Header,
  36772. HTTPStatusCode: res.StatusCode,
  36773. },
  36774. }
  36775. target := &ret
  36776. if err := gensupport.DecodeResponse(target, res); err != nil {
  36777. return nil, err
  36778. }
  36779. return ret, nil
  36780. // {
  36781. // "description": "Retrieves a list of postal codes.",
  36782. // "httpMethod": "GET",
  36783. // "id": "dfareporting.postalCodes.list",
  36784. // "parameterOrder": [
  36785. // "profileId"
  36786. // ],
  36787. // "parameters": {
  36788. // "profileId": {
  36789. // "description": "User profile ID associated with this request.",
  36790. // "format": "int64",
  36791. // "location": "path",
  36792. // "required": true,
  36793. // "type": "string"
  36794. // }
  36795. // },
  36796. // "path": "userprofiles/{profileId}/postalCodes",
  36797. // "response": {
  36798. // "$ref": "PostalCodesListResponse"
  36799. // },
  36800. // "scopes": [
  36801. // "https://www.googleapis.com/auth/dfatrafficking"
  36802. // ]
  36803. // }
  36804. }
  36805. // method id "dfareporting.projects.get":
  36806. type ProjectsGetCall struct {
  36807. s *Service
  36808. profileId int64
  36809. id int64
  36810. urlParams_ gensupport.URLParams
  36811. ifNoneMatch_ string
  36812. ctx_ context.Context
  36813. header_ http.Header
  36814. }
  36815. // Get: Gets one project by ID.
  36816. func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall {
  36817. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36818. c.profileId = profileId
  36819. c.id = id
  36820. return c
  36821. }
  36822. // Fields allows partial responses to be retrieved. See
  36823. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36824. // for more information.
  36825. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  36826. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36827. return c
  36828. }
  36829. // IfNoneMatch sets the optional parameter which makes the operation
  36830. // fail if the object's ETag matches the given value. This is useful for
  36831. // getting updates only after the object has changed since the last
  36832. // request. Use googleapi.IsNotModified to check whether the response
  36833. // error from Do is the result of In-None-Match.
  36834. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  36835. c.ifNoneMatch_ = entityTag
  36836. return c
  36837. }
  36838. // Context sets the context to be used in this call's Do method. Any
  36839. // pending HTTP request will be aborted if the provided context is
  36840. // canceled.
  36841. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  36842. c.ctx_ = ctx
  36843. return c
  36844. }
  36845. // Header returns an http.Header that can be modified by the caller to
  36846. // add HTTP headers to the request.
  36847. func (c *ProjectsGetCall) Header() http.Header {
  36848. if c.header_ == nil {
  36849. c.header_ = make(http.Header)
  36850. }
  36851. return c.header_
  36852. }
  36853. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  36854. reqHeaders := make(http.Header)
  36855. for k, v := range c.header_ {
  36856. reqHeaders[k] = v
  36857. }
  36858. reqHeaders.Set("User-Agent", c.s.userAgent())
  36859. if c.ifNoneMatch_ != "" {
  36860. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36861. }
  36862. var body io.Reader = nil
  36863. c.urlParams_.Set("alt", alt)
  36864. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{id}")
  36865. urls += "?" + c.urlParams_.Encode()
  36866. req, _ := http.NewRequest("GET", urls, body)
  36867. req.Header = reqHeaders
  36868. googleapi.Expand(req.URL, map[string]string{
  36869. "profileId": strconv.FormatInt(c.profileId, 10),
  36870. "id": strconv.FormatInt(c.id, 10),
  36871. })
  36872. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36873. }
  36874. // Do executes the "dfareporting.projects.get" call.
  36875. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  36876. // code is an error. Response headers are in either
  36877. // *Project.ServerResponse.Header or (if a response was returned at all)
  36878. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  36879. // check whether the returned error was because http.StatusNotModified
  36880. // was returned.
  36881. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  36882. gensupport.SetOptions(c.urlParams_, opts...)
  36883. res, err := c.doRequest("json")
  36884. if res != nil && res.StatusCode == http.StatusNotModified {
  36885. if res.Body != nil {
  36886. res.Body.Close()
  36887. }
  36888. return nil, &googleapi.Error{
  36889. Code: res.StatusCode,
  36890. Header: res.Header,
  36891. }
  36892. }
  36893. if err != nil {
  36894. return nil, err
  36895. }
  36896. defer googleapi.CloseBody(res)
  36897. if err := googleapi.CheckResponse(res); err != nil {
  36898. return nil, err
  36899. }
  36900. ret := &Project{
  36901. ServerResponse: googleapi.ServerResponse{
  36902. Header: res.Header,
  36903. HTTPStatusCode: res.StatusCode,
  36904. },
  36905. }
  36906. target := &ret
  36907. if err := gensupport.DecodeResponse(target, res); err != nil {
  36908. return nil, err
  36909. }
  36910. return ret, nil
  36911. // {
  36912. // "description": "Gets one project by ID.",
  36913. // "httpMethod": "GET",
  36914. // "id": "dfareporting.projects.get",
  36915. // "parameterOrder": [
  36916. // "profileId",
  36917. // "id"
  36918. // ],
  36919. // "parameters": {
  36920. // "id": {
  36921. // "description": "Project ID.",
  36922. // "format": "int64",
  36923. // "location": "path",
  36924. // "required": true,
  36925. // "type": "string"
  36926. // },
  36927. // "profileId": {
  36928. // "description": "User profile ID associated with this request.",
  36929. // "format": "int64",
  36930. // "location": "path",
  36931. // "required": true,
  36932. // "type": "string"
  36933. // }
  36934. // },
  36935. // "path": "userprofiles/{profileId}/projects/{id}",
  36936. // "response": {
  36937. // "$ref": "Project"
  36938. // },
  36939. // "scopes": [
  36940. // "https://www.googleapis.com/auth/dfatrafficking"
  36941. // ]
  36942. // }
  36943. }
  36944. // method id "dfareporting.projects.list":
  36945. type ProjectsListCall struct {
  36946. s *Service
  36947. profileId int64
  36948. urlParams_ gensupport.URLParams
  36949. ifNoneMatch_ string
  36950. ctx_ context.Context
  36951. header_ http.Header
  36952. }
  36953. // List: Retrieves a list of projects, possibly filtered. This method
  36954. // supports paging.
  36955. func (r *ProjectsService) List(profileId int64) *ProjectsListCall {
  36956. c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36957. c.profileId = profileId
  36958. return c
  36959. }
  36960. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  36961. // only projects with these advertiser IDs.
  36962. func (c *ProjectsListCall) AdvertiserIds(advertiserIds ...int64) *ProjectsListCall {
  36963. var advertiserIds_ []string
  36964. for _, v := range advertiserIds {
  36965. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  36966. }
  36967. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  36968. return c
  36969. }
  36970. // Ids sets the optional parameter "ids": Select only projects with
  36971. // these IDs.
  36972. func (c *ProjectsListCall) Ids(ids ...int64) *ProjectsListCall {
  36973. var ids_ []string
  36974. for _, v := range ids {
  36975. ids_ = append(ids_, fmt.Sprint(v))
  36976. }
  36977. c.urlParams_.SetMulti("ids", ids_)
  36978. return c
  36979. }
  36980. // MaxResults sets the optional parameter "maxResults": Maximum number
  36981. // of results to return.
  36982. func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall {
  36983. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36984. return c
  36985. }
  36986. // PageToken sets the optional parameter "pageToken": Value of the
  36987. // nextPageToken from the previous result page.
  36988. func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
  36989. c.urlParams_.Set("pageToken", pageToken)
  36990. return c
  36991. }
  36992. // SearchString sets the optional parameter "searchString": Allows
  36993. // searching for projects by name or ID. Wildcards (*) are allowed. For
  36994. // example, "project*2015" will return projects with names like "project
  36995. // June 2015", "project April 2015", or simply "project 2015". Most of
  36996. // the searches also add wildcards implicitly at the start and the end
  36997. // of the search string. For example, a search string of "project" will
  36998. // match projects with name "my project", "project 2015", or simply
  36999. // "project".
  37000. func (c *ProjectsListCall) SearchString(searchString string) *ProjectsListCall {
  37001. c.urlParams_.Set("searchString", searchString)
  37002. return c
  37003. }
  37004. // SortField sets the optional parameter "sortField": Field by which to
  37005. // sort the list.
  37006. //
  37007. // Possible values:
  37008. // "ID" (default)
  37009. // "NAME"
  37010. func (c *ProjectsListCall) SortField(sortField string) *ProjectsListCall {
  37011. c.urlParams_.Set("sortField", sortField)
  37012. return c
  37013. }
  37014. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  37015. // results.
  37016. //
  37017. // Possible values:
  37018. // "ASCENDING" (default)
  37019. // "DESCENDING"
  37020. func (c *ProjectsListCall) SortOrder(sortOrder string) *ProjectsListCall {
  37021. c.urlParams_.Set("sortOrder", sortOrder)
  37022. return c
  37023. }
  37024. // Fields allows partial responses to be retrieved. See
  37025. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37026. // for more information.
  37027. func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  37028. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37029. return c
  37030. }
  37031. // IfNoneMatch sets the optional parameter which makes the operation
  37032. // fail if the object's ETag matches the given value. This is useful for
  37033. // getting updates only after the object has changed since the last
  37034. // request. Use googleapi.IsNotModified to check whether the response
  37035. // error from Do is the result of In-None-Match.
  37036. func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  37037. c.ifNoneMatch_ = entityTag
  37038. return c
  37039. }
  37040. // Context sets the context to be used in this call's Do method. Any
  37041. // pending HTTP request will be aborted if the provided context is
  37042. // canceled.
  37043. func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  37044. c.ctx_ = ctx
  37045. return c
  37046. }
  37047. // Header returns an http.Header that can be modified by the caller to
  37048. // add HTTP headers to the request.
  37049. func (c *ProjectsListCall) Header() http.Header {
  37050. if c.header_ == nil {
  37051. c.header_ = make(http.Header)
  37052. }
  37053. return c.header_
  37054. }
  37055. func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  37056. reqHeaders := make(http.Header)
  37057. for k, v := range c.header_ {
  37058. reqHeaders[k] = v
  37059. }
  37060. reqHeaders.Set("User-Agent", c.s.userAgent())
  37061. if c.ifNoneMatch_ != "" {
  37062. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37063. }
  37064. var body io.Reader = nil
  37065. c.urlParams_.Set("alt", alt)
  37066. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects")
  37067. urls += "?" + c.urlParams_.Encode()
  37068. req, _ := http.NewRequest("GET", urls, body)
  37069. req.Header = reqHeaders
  37070. googleapi.Expand(req.URL, map[string]string{
  37071. "profileId": strconv.FormatInt(c.profileId, 10),
  37072. })
  37073. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37074. }
  37075. // Do executes the "dfareporting.projects.list" call.
  37076. // Exactly one of *ProjectsListResponse or error will be non-nil. Any
  37077. // non-2xx status code is an error. Response headers are in either
  37078. // *ProjectsListResponse.ServerResponse.Header or (if a response was
  37079. // returned at all) in error.(*googleapi.Error).Header. Use
  37080. // googleapi.IsNotModified to check whether the returned error was
  37081. // because http.StatusNotModified was returned.
  37082. func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectsListResponse, error) {
  37083. gensupport.SetOptions(c.urlParams_, opts...)
  37084. res, err := c.doRequest("json")
  37085. if res != nil && res.StatusCode == http.StatusNotModified {
  37086. if res.Body != nil {
  37087. res.Body.Close()
  37088. }
  37089. return nil, &googleapi.Error{
  37090. Code: res.StatusCode,
  37091. Header: res.Header,
  37092. }
  37093. }
  37094. if err != nil {
  37095. return nil, err
  37096. }
  37097. defer googleapi.CloseBody(res)
  37098. if err := googleapi.CheckResponse(res); err != nil {
  37099. return nil, err
  37100. }
  37101. ret := &ProjectsListResponse{
  37102. ServerResponse: googleapi.ServerResponse{
  37103. Header: res.Header,
  37104. HTTPStatusCode: res.StatusCode,
  37105. },
  37106. }
  37107. target := &ret
  37108. if err := gensupport.DecodeResponse(target, res); err != nil {
  37109. return nil, err
  37110. }
  37111. return ret, nil
  37112. // {
  37113. // "description": "Retrieves a list of projects, possibly filtered. This method supports paging.",
  37114. // "httpMethod": "GET",
  37115. // "id": "dfareporting.projects.list",
  37116. // "parameterOrder": [
  37117. // "profileId"
  37118. // ],
  37119. // "parameters": {
  37120. // "advertiserIds": {
  37121. // "description": "Select only projects with these advertiser IDs.",
  37122. // "format": "int64",
  37123. // "location": "query",
  37124. // "repeated": true,
  37125. // "type": "string"
  37126. // },
  37127. // "ids": {
  37128. // "description": "Select only projects with these IDs.",
  37129. // "format": "int64",
  37130. // "location": "query",
  37131. // "repeated": true,
  37132. // "type": "string"
  37133. // },
  37134. // "maxResults": {
  37135. // "default": "1000",
  37136. // "description": "Maximum number of results to return.",
  37137. // "format": "int32",
  37138. // "location": "query",
  37139. // "maximum": "1000",
  37140. // "minimum": "0",
  37141. // "type": "integer"
  37142. // },
  37143. // "pageToken": {
  37144. // "description": "Value of the nextPageToken from the previous result page.",
  37145. // "location": "query",
  37146. // "type": "string"
  37147. // },
  37148. // "profileId": {
  37149. // "description": "User profile ID associated with this request.",
  37150. // "format": "int64",
  37151. // "location": "path",
  37152. // "required": true,
  37153. // "type": "string"
  37154. // },
  37155. // "searchString": {
  37156. // "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\".",
  37157. // "location": "query",
  37158. // "type": "string"
  37159. // },
  37160. // "sortField": {
  37161. // "default": "ID",
  37162. // "description": "Field by which to sort the list.",
  37163. // "enum": [
  37164. // "ID",
  37165. // "NAME"
  37166. // ],
  37167. // "enumDescriptions": [
  37168. // "",
  37169. // ""
  37170. // ],
  37171. // "location": "query",
  37172. // "type": "string"
  37173. // },
  37174. // "sortOrder": {
  37175. // "default": "ASCENDING",
  37176. // "description": "Order of sorted results.",
  37177. // "enum": [
  37178. // "ASCENDING",
  37179. // "DESCENDING"
  37180. // ],
  37181. // "enumDescriptions": [
  37182. // "",
  37183. // ""
  37184. // ],
  37185. // "location": "query",
  37186. // "type": "string"
  37187. // }
  37188. // },
  37189. // "path": "userprofiles/{profileId}/projects",
  37190. // "response": {
  37191. // "$ref": "ProjectsListResponse"
  37192. // },
  37193. // "scopes": [
  37194. // "https://www.googleapis.com/auth/dfatrafficking"
  37195. // ]
  37196. // }
  37197. }
  37198. // Pages invokes f for each page of results.
  37199. // A non-nil error returned from f will halt the iteration.
  37200. // The provided context supersedes any context provided to the Context method.
  37201. func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ProjectsListResponse) error) error {
  37202. c.ctx_ = ctx
  37203. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37204. for {
  37205. x, err := c.Do()
  37206. if err != nil {
  37207. return err
  37208. }
  37209. if err := f(x); err != nil {
  37210. return err
  37211. }
  37212. if x.NextPageToken == "" {
  37213. return nil
  37214. }
  37215. c.PageToken(x.NextPageToken)
  37216. }
  37217. }
  37218. // method id "dfareporting.regions.list":
  37219. type RegionsListCall struct {
  37220. s *Service
  37221. profileId int64
  37222. urlParams_ gensupport.URLParams
  37223. ifNoneMatch_ string
  37224. ctx_ context.Context
  37225. header_ http.Header
  37226. }
  37227. // List: Retrieves a list of regions.
  37228. func (r *RegionsService) List(profileId int64) *RegionsListCall {
  37229. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37230. c.profileId = profileId
  37231. return c
  37232. }
  37233. // Fields allows partial responses to be retrieved. See
  37234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37235. // for more information.
  37236. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  37237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37238. return c
  37239. }
  37240. // IfNoneMatch sets the optional parameter which makes the operation
  37241. // fail if the object's ETag matches the given value. This is useful for
  37242. // getting updates only after the object has changed since the last
  37243. // request. Use googleapi.IsNotModified to check whether the response
  37244. // error from Do is the result of In-None-Match.
  37245. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  37246. c.ifNoneMatch_ = entityTag
  37247. return c
  37248. }
  37249. // Context sets the context to be used in this call's Do method. Any
  37250. // pending HTTP request will be aborted if the provided context is
  37251. // canceled.
  37252. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  37253. c.ctx_ = ctx
  37254. return c
  37255. }
  37256. // Header returns an http.Header that can be modified by the caller to
  37257. // add HTTP headers to the request.
  37258. func (c *RegionsListCall) Header() http.Header {
  37259. if c.header_ == nil {
  37260. c.header_ = make(http.Header)
  37261. }
  37262. return c.header_
  37263. }
  37264. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  37265. reqHeaders := make(http.Header)
  37266. for k, v := range c.header_ {
  37267. reqHeaders[k] = v
  37268. }
  37269. reqHeaders.Set("User-Agent", c.s.userAgent())
  37270. if c.ifNoneMatch_ != "" {
  37271. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37272. }
  37273. var body io.Reader = nil
  37274. c.urlParams_.Set("alt", alt)
  37275. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/regions")
  37276. urls += "?" + c.urlParams_.Encode()
  37277. req, _ := http.NewRequest("GET", urls, body)
  37278. req.Header = reqHeaders
  37279. googleapi.Expand(req.URL, map[string]string{
  37280. "profileId": strconv.FormatInt(c.profileId, 10),
  37281. })
  37282. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37283. }
  37284. // Do executes the "dfareporting.regions.list" call.
  37285. // Exactly one of *RegionsListResponse or error will be non-nil. Any
  37286. // non-2xx status code is an error. Response headers are in either
  37287. // *RegionsListResponse.ServerResponse.Header or (if a response was
  37288. // returned at all) in error.(*googleapi.Error).Header. Use
  37289. // googleapi.IsNotModified to check whether the returned error was
  37290. // because http.StatusNotModified was returned.
  37291. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionsListResponse, error) {
  37292. gensupport.SetOptions(c.urlParams_, opts...)
  37293. res, err := c.doRequest("json")
  37294. if res != nil && res.StatusCode == http.StatusNotModified {
  37295. if res.Body != nil {
  37296. res.Body.Close()
  37297. }
  37298. return nil, &googleapi.Error{
  37299. Code: res.StatusCode,
  37300. Header: res.Header,
  37301. }
  37302. }
  37303. if err != nil {
  37304. return nil, err
  37305. }
  37306. defer googleapi.CloseBody(res)
  37307. if err := googleapi.CheckResponse(res); err != nil {
  37308. return nil, err
  37309. }
  37310. ret := &RegionsListResponse{
  37311. ServerResponse: googleapi.ServerResponse{
  37312. Header: res.Header,
  37313. HTTPStatusCode: res.StatusCode,
  37314. },
  37315. }
  37316. target := &ret
  37317. if err := gensupport.DecodeResponse(target, res); err != nil {
  37318. return nil, err
  37319. }
  37320. return ret, nil
  37321. // {
  37322. // "description": "Retrieves a list of regions.",
  37323. // "httpMethod": "GET",
  37324. // "id": "dfareporting.regions.list",
  37325. // "parameterOrder": [
  37326. // "profileId"
  37327. // ],
  37328. // "parameters": {
  37329. // "profileId": {
  37330. // "description": "User profile ID associated with this request.",
  37331. // "format": "int64",
  37332. // "location": "path",
  37333. // "required": true,
  37334. // "type": "string"
  37335. // }
  37336. // },
  37337. // "path": "userprofiles/{profileId}/regions",
  37338. // "response": {
  37339. // "$ref": "RegionsListResponse"
  37340. // },
  37341. // "scopes": [
  37342. // "https://www.googleapis.com/auth/dfatrafficking"
  37343. // ]
  37344. // }
  37345. }
  37346. // method id "dfareporting.remarketingListShares.get":
  37347. type RemarketingListSharesGetCall struct {
  37348. s *Service
  37349. profileId int64
  37350. remarketingListId int64
  37351. urlParams_ gensupport.URLParams
  37352. ifNoneMatch_ string
  37353. ctx_ context.Context
  37354. header_ http.Header
  37355. }
  37356. // Get: Gets one remarketing list share by remarketing list ID.
  37357. func (r *RemarketingListSharesService) Get(profileId int64, remarketingListId int64) *RemarketingListSharesGetCall {
  37358. c := &RemarketingListSharesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37359. c.profileId = profileId
  37360. c.remarketingListId = remarketingListId
  37361. return c
  37362. }
  37363. // Fields allows partial responses to be retrieved. See
  37364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37365. // for more information.
  37366. func (c *RemarketingListSharesGetCall) Fields(s ...googleapi.Field) *RemarketingListSharesGetCall {
  37367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37368. return c
  37369. }
  37370. // IfNoneMatch sets the optional parameter which makes the operation
  37371. // fail if the object's ETag matches the given value. This is useful for
  37372. // getting updates only after the object has changed since the last
  37373. // request. Use googleapi.IsNotModified to check whether the response
  37374. // error from Do is the result of In-None-Match.
  37375. func (c *RemarketingListSharesGetCall) IfNoneMatch(entityTag string) *RemarketingListSharesGetCall {
  37376. c.ifNoneMatch_ = entityTag
  37377. return c
  37378. }
  37379. // Context sets the context to be used in this call's Do method. Any
  37380. // pending HTTP request will be aborted if the provided context is
  37381. // canceled.
  37382. func (c *RemarketingListSharesGetCall) Context(ctx context.Context) *RemarketingListSharesGetCall {
  37383. c.ctx_ = ctx
  37384. return c
  37385. }
  37386. // Header returns an http.Header that can be modified by the caller to
  37387. // add HTTP headers to the request.
  37388. func (c *RemarketingListSharesGetCall) Header() http.Header {
  37389. if c.header_ == nil {
  37390. c.header_ = make(http.Header)
  37391. }
  37392. return c.header_
  37393. }
  37394. func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, error) {
  37395. reqHeaders := make(http.Header)
  37396. for k, v := range c.header_ {
  37397. reqHeaders[k] = v
  37398. }
  37399. reqHeaders.Set("User-Agent", c.s.userAgent())
  37400. if c.ifNoneMatch_ != "" {
  37401. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37402. }
  37403. var body io.Reader = nil
  37404. c.urlParams_.Set("alt", alt)
  37405. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares/{remarketingListId}")
  37406. urls += "?" + c.urlParams_.Encode()
  37407. req, _ := http.NewRequest("GET", urls, body)
  37408. req.Header = reqHeaders
  37409. googleapi.Expand(req.URL, map[string]string{
  37410. "profileId": strconv.FormatInt(c.profileId, 10),
  37411. "remarketingListId": strconv.FormatInt(c.remarketingListId, 10),
  37412. })
  37413. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37414. }
  37415. // Do executes the "dfareporting.remarketingListShares.get" call.
  37416. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  37417. // non-2xx status code is an error. Response headers are in either
  37418. // *RemarketingListShare.ServerResponse.Header or (if a response was
  37419. // returned at all) in error.(*googleapi.Error).Header. Use
  37420. // googleapi.IsNotModified to check whether the returned error was
  37421. // because http.StatusNotModified was returned.
  37422. func (c *RemarketingListSharesGetCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  37423. gensupport.SetOptions(c.urlParams_, opts...)
  37424. res, err := c.doRequest("json")
  37425. if res != nil && res.StatusCode == http.StatusNotModified {
  37426. if res.Body != nil {
  37427. res.Body.Close()
  37428. }
  37429. return nil, &googleapi.Error{
  37430. Code: res.StatusCode,
  37431. Header: res.Header,
  37432. }
  37433. }
  37434. if err != nil {
  37435. return nil, err
  37436. }
  37437. defer googleapi.CloseBody(res)
  37438. if err := googleapi.CheckResponse(res); err != nil {
  37439. return nil, err
  37440. }
  37441. ret := &RemarketingListShare{
  37442. ServerResponse: googleapi.ServerResponse{
  37443. Header: res.Header,
  37444. HTTPStatusCode: res.StatusCode,
  37445. },
  37446. }
  37447. target := &ret
  37448. if err := gensupport.DecodeResponse(target, res); err != nil {
  37449. return nil, err
  37450. }
  37451. return ret, nil
  37452. // {
  37453. // "description": "Gets one remarketing list share by remarketing list ID.",
  37454. // "httpMethod": "GET",
  37455. // "id": "dfareporting.remarketingListShares.get",
  37456. // "parameterOrder": [
  37457. // "profileId",
  37458. // "remarketingListId"
  37459. // ],
  37460. // "parameters": {
  37461. // "profileId": {
  37462. // "description": "User profile ID associated with this request.",
  37463. // "format": "int64",
  37464. // "location": "path",
  37465. // "required": true,
  37466. // "type": "string"
  37467. // },
  37468. // "remarketingListId": {
  37469. // "description": "Remarketing list ID.",
  37470. // "format": "int64",
  37471. // "location": "path",
  37472. // "required": true,
  37473. // "type": "string"
  37474. // }
  37475. // },
  37476. // "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}",
  37477. // "response": {
  37478. // "$ref": "RemarketingListShare"
  37479. // },
  37480. // "scopes": [
  37481. // "https://www.googleapis.com/auth/dfatrafficking"
  37482. // ]
  37483. // }
  37484. }
  37485. // method id "dfareporting.remarketingListShares.patch":
  37486. type RemarketingListSharesPatchCall struct {
  37487. s *Service
  37488. profileId int64
  37489. remarketinglistshare *RemarketingListShare
  37490. urlParams_ gensupport.URLParams
  37491. ctx_ context.Context
  37492. header_ http.Header
  37493. }
  37494. // Patch: Updates an existing remarketing list share. This method
  37495. // supports patch semantics.
  37496. func (r *RemarketingListSharesService) Patch(profileId int64, remarketingListId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesPatchCall {
  37497. c := &RemarketingListSharesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37498. c.profileId = profileId
  37499. c.urlParams_.Set("remarketingListId", fmt.Sprint(remarketingListId))
  37500. c.remarketinglistshare = remarketinglistshare
  37501. return c
  37502. }
  37503. // Fields allows partial responses to be retrieved. See
  37504. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37505. // for more information.
  37506. func (c *RemarketingListSharesPatchCall) Fields(s ...googleapi.Field) *RemarketingListSharesPatchCall {
  37507. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37508. return c
  37509. }
  37510. // Context sets the context to be used in this call's Do method. Any
  37511. // pending HTTP request will be aborted if the provided context is
  37512. // canceled.
  37513. func (c *RemarketingListSharesPatchCall) Context(ctx context.Context) *RemarketingListSharesPatchCall {
  37514. c.ctx_ = ctx
  37515. return c
  37516. }
  37517. // Header returns an http.Header that can be modified by the caller to
  37518. // add HTTP headers to the request.
  37519. func (c *RemarketingListSharesPatchCall) Header() http.Header {
  37520. if c.header_ == nil {
  37521. c.header_ = make(http.Header)
  37522. }
  37523. return c.header_
  37524. }
  37525. func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) {
  37526. reqHeaders := make(http.Header)
  37527. for k, v := range c.header_ {
  37528. reqHeaders[k] = v
  37529. }
  37530. reqHeaders.Set("User-Agent", c.s.userAgent())
  37531. var body io.Reader = nil
  37532. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  37533. if err != nil {
  37534. return nil, err
  37535. }
  37536. reqHeaders.Set("Content-Type", "application/json")
  37537. c.urlParams_.Set("alt", alt)
  37538. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  37539. urls += "?" + c.urlParams_.Encode()
  37540. req, _ := http.NewRequest("PATCH", urls, body)
  37541. req.Header = reqHeaders
  37542. googleapi.Expand(req.URL, map[string]string{
  37543. "profileId": strconv.FormatInt(c.profileId, 10),
  37544. })
  37545. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37546. }
  37547. // Do executes the "dfareporting.remarketingListShares.patch" call.
  37548. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  37549. // non-2xx status code is an error. Response headers are in either
  37550. // *RemarketingListShare.ServerResponse.Header or (if a response was
  37551. // returned at all) in error.(*googleapi.Error).Header. Use
  37552. // googleapi.IsNotModified to check whether the returned error was
  37553. // because http.StatusNotModified was returned.
  37554. func (c *RemarketingListSharesPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  37555. gensupport.SetOptions(c.urlParams_, opts...)
  37556. res, err := c.doRequest("json")
  37557. if res != nil && res.StatusCode == http.StatusNotModified {
  37558. if res.Body != nil {
  37559. res.Body.Close()
  37560. }
  37561. return nil, &googleapi.Error{
  37562. Code: res.StatusCode,
  37563. Header: res.Header,
  37564. }
  37565. }
  37566. if err != nil {
  37567. return nil, err
  37568. }
  37569. defer googleapi.CloseBody(res)
  37570. if err := googleapi.CheckResponse(res); err != nil {
  37571. return nil, err
  37572. }
  37573. ret := &RemarketingListShare{
  37574. ServerResponse: googleapi.ServerResponse{
  37575. Header: res.Header,
  37576. HTTPStatusCode: res.StatusCode,
  37577. },
  37578. }
  37579. target := &ret
  37580. if err := gensupport.DecodeResponse(target, res); err != nil {
  37581. return nil, err
  37582. }
  37583. return ret, nil
  37584. // {
  37585. // "description": "Updates an existing remarketing list share. This method supports patch semantics.",
  37586. // "httpMethod": "PATCH",
  37587. // "id": "dfareporting.remarketingListShares.patch",
  37588. // "parameterOrder": [
  37589. // "profileId",
  37590. // "remarketingListId"
  37591. // ],
  37592. // "parameters": {
  37593. // "profileId": {
  37594. // "description": "User profile ID associated with this request.",
  37595. // "format": "int64",
  37596. // "location": "path",
  37597. // "required": true,
  37598. // "type": "string"
  37599. // },
  37600. // "remarketingListId": {
  37601. // "description": "Remarketing list ID.",
  37602. // "format": "int64",
  37603. // "location": "query",
  37604. // "required": true,
  37605. // "type": "string"
  37606. // }
  37607. // },
  37608. // "path": "userprofiles/{profileId}/remarketingListShares",
  37609. // "request": {
  37610. // "$ref": "RemarketingListShare"
  37611. // },
  37612. // "response": {
  37613. // "$ref": "RemarketingListShare"
  37614. // },
  37615. // "scopes": [
  37616. // "https://www.googleapis.com/auth/dfatrafficking"
  37617. // ]
  37618. // }
  37619. }
  37620. // method id "dfareporting.remarketingListShares.update":
  37621. type RemarketingListSharesUpdateCall struct {
  37622. s *Service
  37623. profileId int64
  37624. remarketinglistshare *RemarketingListShare
  37625. urlParams_ gensupport.URLParams
  37626. ctx_ context.Context
  37627. header_ http.Header
  37628. }
  37629. // Update: Updates an existing remarketing list share.
  37630. func (r *RemarketingListSharesService) Update(profileId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesUpdateCall {
  37631. c := &RemarketingListSharesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37632. c.profileId = profileId
  37633. c.remarketinglistshare = remarketinglistshare
  37634. return c
  37635. }
  37636. // Fields allows partial responses to be retrieved. See
  37637. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37638. // for more information.
  37639. func (c *RemarketingListSharesUpdateCall) Fields(s ...googleapi.Field) *RemarketingListSharesUpdateCall {
  37640. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37641. return c
  37642. }
  37643. // Context sets the context to be used in this call's Do method. Any
  37644. // pending HTTP request will be aborted if the provided context is
  37645. // canceled.
  37646. func (c *RemarketingListSharesUpdateCall) Context(ctx context.Context) *RemarketingListSharesUpdateCall {
  37647. c.ctx_ = ctx
  37648. return c
  37649. }
  37650. // Header returns an http.Header that can be modified by the caller to
  37651. // add HTTP headers to the request.
  37652. func (c *RemarketingListSharesUpdateCall) Header() http.Header {
  37653. if c.header_ == nil {
  37654. c.header_ = make(http.Header)
  37655. }
  37656. return c.header_
  37657. }
  37658. func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) {
  37659. reqHeaders := make(http.Header)
  37660. for k, v := range c.header_ {
  37661. reqHeaders[k] = v
  37662. }
  37663. reqHeaders.Set("User-Agent", c.s.userAgent())
  37664. var body io.Reader = nil
  37665. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  37666. if err != nil {
  37667. return nil, err
  37668. }
  37669. reqHeaders.Set("Content-Type", "application/json")
  37670. c.urlParams_.Set("alt", alt)
  37671. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  37672. urls += "?" + c.urlParams_.Encode()
  37673. req, _ := http.NewRequest("PUT", urls, body)
  37674. req.Header = reqHeaders
  37675. googleapi.Expand(req.URL, map[string]string{
  37676. "profileId": strconv.FormatInt(c.profileId, 10),
  37677. })
  37678. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37679. }
  37680. // Do executes the "dfareporting.remarketingListShares.update" call.
  37681. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  37682. // non-2xx status code is an error. Response headers are in either
  37683. // *RemarketingListShare.ServerResponse.Header or (if a response was
  37684. // returned at all) in error.(*googleapi.Error).Header. Use
  37685. // googleapi.IsNotModified to check whether the returned error was
  37686. // because http.StatusNotModified was returned.
  37687. func (c *RemarketingListSharesUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  37688. gensupport.SetOptions(c.urlParams_, opts...)
  37689. res, err := c.doRequest("json")
  37690. if res != nil && res.StatusCode == http.StatusNotModified {
  37691. if res.Body != nil {
  37692. res.Body.Close()
  37693. }
  37694. return nil, &googleapi.Error{
  37695. Code: res.StatusCode,
  37696. Header: res.Header,
  37697. }
  37698. }
  37699. if err != nil {
  37700. return nil, err
  37701. }
  37702. defer googleapi.CloseBody(res)
  37703. if err := googleapi.CheckResponse(res); err != nil {
  37704. return nil, err
  37705. }
  37706. ret := &RemarketingListShare{
  37707. ServerResponse: googleapi.ServerResponse{
  37708. Header: res.Header,
  37709. HTTPStatusCode: res.StatusCode,
  37710. },
  37711. }
  37712. target := &ret
  37713. if err := gensupport.DecodeResponse(target, res); err != nil {
  37714. return nil, err
  37715. }
  37716. return ret, nil
  37717. // {
  37718. // "description": "Updates an existing remarketing list share.",
  37719. // "httpMethod": "PUT",
  37720. // "id": "dfareporting.remarketingListShares.update",
  37721. // "parameterOrder": [
  37722. // "profileId"
  37723. // ],
  37724. // "parameters": {
  37725. // "profileId": {
  37726. // "description": "User profile ID associated with this request.",
  37727. // "format": "int64",
  37728. // "location": "path",
  37729. // "required": true,
  37730. // "type": "string"
  37731. // }
  37732. // },
  37733. // "path": "userprofiles/{profileId}/remarketingListShares",
  37734. // "request": {
  37735. // "$ref": "RemarketingListShare"
  37736. // },
  37737. // "response": {
  37738. // "$ref": "RemarketingListShare"
  37739. // },
  37740. // "scopes": [
  37741. // "https://www.googleapis.com/auth/dfatrafficking"
  37742. // ]
  37743. // }
  37744. }
  37745. // method id "dfareporting.remarketingLists.get":
  37746. type RemarketingListsGetCall struct {
  37747. s *Service
  37748. profileId int64
  37749. id int64
  37750. urlParams_ gensupport.URLParams
  37751. ifNoneMatch_ string
  37752. ctx_ context.Context
  37753. header_ http.Header
  37754. }
  37755. // Get: Gets one remarketing list by ID.
  37756. func (r *RemarketingListsService) Get(profileId int64, id int64) *RemarketingListsGetCall {
  37757. c := &RemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37758. c.profileId = profileId
  37759. c.id = id
  37760. return c
  37761. }
  37762. // Fields allows partial responses to be retrieved. See
  37763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37764. // for more information.
  37765. func (c *RemarketingListsGetCall) Fields(s ...googleapi.Field) *RemarketingListsGetCall {
  37766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37767. return c
  37768. }
  37769. // IfNoneMatch sets the optional parameter which makes the operation
  37770. // fail if the object's ETag matches the given value. This is useful for
  37771. // getting updates only after the object has changed since the last
  37772. // request. Use googleapi.IsNotModified to check whether the response
  37773. // error from Do is the result of In-None-Match.
  37774. func (c *RemarketingListsGetCall) IfNoneMatch(entityTag string) *RemarketingListsGetCall {
  37775. c.ifNoneMatch_ = entityTag
  37776. return c
  37777. }
  37778. // Context sets the context to be used in this call's Do method. Any
  37779. // pending HTTP request will be aborted if the provided context is
  37780. // canceled.
  37781. func (c *RemarketingListsGetCall) Context(ctx context.Context) *RemarketingListsGetCall {
  37782. c.ctx_ = ctx
  37783. return c
  37784. }
  37785. // Header returns an http.Header that can be modified by the caller to
  37786. // add HTTP headers to the request.
  37787. func (c *RemarketingListsGetCall) Header() http.Header {
  37788. if c.header_ == nil {
  37789. c.header_ = make(http.Header)
  37790. }
  37791. return c.header_
  37792. }
  37793. func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  37794. reqHeaders := make(http.Header)
  37795. for k, v := range c.header_ {
  37796. reqHeaders[k] = v
  37797. }
  37798. reqHeaders.Set("User-Agent", c.s.userAgent())
  37799. if c.ifNoneMatch_ != "" {
  37800. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37801. }
  37802. var body io.Reader = nil
  37803. c.urlParams_.Set("alt", alt)
  37804. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists/{id}")
  37805. urls += "?" + c.urlParams_.Encode()
  37806. req, _ := http.NewRequest("GET", urls, body)
  37807. req.Header = reqHeaders
  37808. googleapi.Expand(req.URL, map[string]string{
  37809. "profileId": strconv.FormatInt(c.profileId, 10),
  37810. "id": strconv.FormatInt(c.id, 10),
  37811. })
  37812. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37813. }
  37814. // Do executes the "dfareporting.remarketingLists.get" call.
  37815. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  37816. // status code is an error. Response headers are in either
  37817. // *RemarketingList.ServerResponse.Header or (if a response was returned
  37818. // at all) in error.(*googleapi.Error).Header. Use
  37819. // googleapi.IsNotModified to check whether the returned error was
  37820. // because http.StatusNotModified was returned.
  37821. func (c *RemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  37822. gensupport.SetOptions(c.urlParams_, opts...)
  37823. res, err := c.doRequest("json")
  37824. if res != nil && res.StatusCode == http.StatusNotModified {
  37825. if res.Body != nil {
  37826. res.Body.Close()
  37827. }
  37828. return nil, &googleapi.Error{
  37829. Code: res.StatusCode,
  37830. Header: res.Header,
  37831. }
  37832. }
  37833. if err != nil {
  37834. return nil, err
  37835. }
  37836. defer googleapi.CloseBody(res)
  37837. if err := googleapi.CheckResponse(res); err != nil {
  37838. return nil, err
  37839. }
  37840. ret := &RemarketingList{
  37841. ServerResponse: googleapi.ServerResponse{
  37842. Header: res.Header,
  37843. HTTPStatusCode: res.StatusCode,
  37844. },
  37845. }
  37846. target := &ret
  37847. if err := gensupport.DecodeResponse(target, res); err != nil {
  37848. return nil, err
  37849. }
  37850. return ret, nil
  37851. // {
  37852. // "description": "Gets one remarketing list by ID.",
  37853. // "httpMethod": "GET",
  37854. // "id": "dfareporting.remarketingLists.get",
  37855. // "parameterOrder": [
  37856. // "profileId",
  37857. // "id"
  37858. // ],
  37859. // "parameters": {
  37860. // "id": {
  37861. // "description": "Remarketing list ID.",
  37862. // "format": "int64",
  37863. // "location": "path",
  37864. // "required": true,
  37865. // "type": "string"
  37866. // },
  37867. // "profileId": {
  37868. // "description": "User profile ID associated with this request.",
  37869. // "format": "int64",
  37870. // "location": "path",
  37871. // "required": true,
  37872. // "type": "string"
  37873. // }
  37874. // },
  37875. // "path": "userprofiles/{profileId}/remarketingLists/{id}",
  37876. // "response": {
  37877. // "$ref": "RemarketingList"
  37878. // },
  37879. // "scopes": [
  37880. // "https://www.googleapis.com/auth/dfatrafficking"
  37881. // ]
  37882. // }
  37883. }
  37884. // method id "dfareporting.remarketingLists.insert":
  37885. type RemarketingListsInsertCall struct {
  37886. s *Service
  37887. profileId int64
  37888. remarketinglist *RemarketingList
  37889. urlParams_ gensupport.URLParams
  37890. ctx_ context.Context
  37891. header_ http.Header
  37892. }
  37893. // Insert: Inserts a new remarketing list.
  37894. func (r *RemarketingListsService) Insert(profileId int64, remarketinglist *RemarketingList) *RemarketingListsInsertCall {
  37895. c := &RemarketingListsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37896. c.profileId = profileId
  37897. c.remarketinglist = remarketinglist
  37898. return c
  37899. }
  37900. // Fields allows partial responses to be retrieved. See
  37901. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37902. // for more information.
  37903. func (c *RemarketingListsInsertCall) Fields(s ...googleapi.Field) *RemarketingListsInsertCall {
  37904. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37905. return c
  37906. }
  37907. // Context sets the context to be used in this call's Do method. Any
  37908. // pending HTTP request will be aborted if the provided context is
  37909. // canceled.
  37910. func (c *RemarketingListsInsertCall) Context(ctx context.Context) *RemarketingListsInsertCall {
  37911. c.ctx_ = ctx
  37912. return c
  37913. }
  37914. // Header returns an http.Header that can be modified by the caller to
  37915. // add HTTP headers to the request.
  37916. func (c *RemarketingListsInsertCall) Header() http.Header {
  37917. if c.header_ == nil {
  37918. c.header_ = make(http.Header)
  37919. }
  37920. return c.header_
  37921. }
  37922. func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) {
  37923. reqHeaders := make(http.Header)
  37924. for k, v := range c.header_ {
  37925. reqHeaders[k] = v
  37926. }
  37927. reqHeaders.Set("User-Agent", c.s.userAgent())
  37928. var body io.Reader = nil
  37929. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  37930. if err != nil {
  37931. return nil, err
  37932. }
  37933. reqHeaders.Set("Content-Type", "application/json")
  37934. c.urlParams_.Set("alt", alt)
  37935. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  37936. urls += "?" + c.urlParams_.Encode()
  37937. req, _ := http.NewRequest("POST", urls, body)
  37938. req.Header = reqHeaders
  37939. googleapi.Expand(req.URL, map[string]string{
  37940. "profileId": strconv.FormatInt(c.profileId, 10),
  37941. })
  37942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37943. }
  37944. // Do executes the "dfareporting.remarketingLists.insert" call.
  37945. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  37946. // status code is an error. Response headers are in either
  37947. // *RemarketingList.ServerResponse.Header or (if a response was returned
  37948. // at all) in error.(*googleapi.Error).Header. Use
  37949. // googleapi.IsNotModified to check whether the returned error was
  37950. // because http.StatusNotModified was returned.
  37951. func (c *RemarketingListsInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  37952. gensupport.SetOptions(c.urlParams_, opts...)
  37953. res, err := c.doRequest("json")
  37954. if res != nil && res.StatusCode == http.StatusNotModified {
  37955. if res.Body != nil {
  37956. res.Body.Close()
  37957. }
  37958. return nil, &googleapi.Error{
  37959. Code: res.StatusCode,
  37960. Header: res.Header,
  37961. }
  37962. }
  37963. if err != nil {
  37964. return nil, err
  37965. }
  37966. defer googleapi.CloseBody(res)
  37967. if err := googleapi.CheckResponse(res); err != nil {
  37968. return nil, err
  37969. }
  37970. ret := &RemarketingList{
  37971. ServerResponse: googleapi.ServerResponse{
  37972. Header: res.Header,
  37973. HTTPStatusCode: res.StatusCode,
  37974. },
  37975. }
  37976. target := &ret
  37977. if err := gensupport.DecodeResponse(target, res); err != nil {
  37978. return nil, err
  37979. }
  37980. return ret, nil
  37981. // {
  37982. // "description": "Inserts a new remarketing list.",
  37983. // "httpMethod": "POST",
  37984. // "id": "dfareporting.remarketingLists.insert",
  37985. // "parameterOrder": [
  37986. // "profileId"
  37987. // ],
  37988. // "parameters": {
  37989. // "profileId": {
  37990. // "description": "User profile ID associated with this request.",
  37991. // "format": "int64",
  37992. // "location": "path",
  37993. // "required": true,
  37994. // "type": "string"
  37995. // }
  37996. // },
  37997. // "path": "userprofiles/{profileId}/remarketingLists",
  37998. // "request": {
  37999. // "$ref": "RemarketingList"
  38000. // },
  38001. // "response": {
  38002. // "$ref": "RemarketingList"
  38003. // },
  38004. // "scopes": [
  38005. // "https://www.googleapis.com/auth/dfatrafficking"
  38006. // ]
  38007. // }
  38008. }
  38009. // method id "dfareporting.remarketingLists.list":
  38010. type RemarketingListsListCall struct {
  38011. s *Service
  38012. profileId int64
  38013. urlParams_ gensupport.URLParams
  38014. ifNoneMatch_ string
  38015. ctx_ context.Context
  38016. header_ http.Header
  38017. }
  38018. // List: Retrieves a list of remarketing lists, possibly filtered. This
  38019. // method supports paging.
  38020. func (r *RemarketingListsService) List(profileId int64, advertiserId int64) *RemarketingListsListCall {
  38021. c := &RemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38022. c.profileId = profileId
  38023. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  38024. return c
  38025. }
  38026. // Active sets the optional parameter "active": Select only active or
  38027. // only inactive remarketing lists.
  38028. func (c *RemarketingListsListCall) Active(active bool) *RemarketingListsListCall {
  38029. c.urlParams_.Set("active", fmt.Sprint(active))
  38030. return c
  38031. }
  38032. // FloodlightActivityId sets the optional parameter
  38033. // "floodlightActivityId": Select only remarketing lists that have this
  38034. // floodlight activity ID.
  38035. func (c *RemarketingListsListCall) FloodlightActivityId(floodlightActivityId int64) *RemarketingListsListCall {
  38036. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  38037. return c
  38038. }
  38039. // MaxResults sets the optional parameter "maxResults": Maximum number
  38040. // of results to return.
  38041. func (c *RemarketingListsListCall) MaxResults(maxResults int64) *RemarketingListsListCall {
  38042. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38043. return c
  38044. }
  38045. // Name sets the optional parameter "name": Allows searching for objects
  38046. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  38047. // list*2015" will return objects with names like "remarketing list June
  38048. // 2015", "remarketing list April 2015", or simply "remarketing list
  38049. // 2015". Most of the searches also add wildcards implicitly at the
  38050. // start and the end of the search string. For example, a search string
  38051. // of "remarketing list" will match objects with name "my remarketing
  38052. // list", "remarketing list 2015", or simply "remarketing list".
  38053. func (c *RemarketingListsListCall) Name(name string) *RemarketingListsListCall {
  38054. c.urlParams_.Set("name", name)
  38055. return c
  38056. }
  38057. // PageToken sets the optional parameter "pageToken": Value of the
  38058. // nextPageToken from the previous result page.
  38059. func (c *RemarketingListsListCall) PageToken(pageToken string) *RemarketingListsListCall {
  38060. c.urlParams_.Set("pageToken", pageToken)
  38061. return c
  38062. }
  38063. // SortField sets the optional parameter "sortField": Field by which to
  38064. // sort the list.
  38065. //
  38066. // Possible values:
  38067. // "ID" (default)
  38068. // "NAME"
  38069. func (c *RemarketingListsListCall) SortField(sortField string) *RemarketingListsListCall {
  38070. c.urlParams_.Set("sortField", sortField)
  38071. return c
  38072. }
  38073. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  38074. // results.
  38075. //
  38076. // Possible values:
  38077. // "ASCENDING" (default)
  38078. // "DESCENDING"
  38079. func (c *RemarketingListsListCall) SortOrder(sortOrder string) *RemarketingListsListCall {
  38080. c.urlParams_.Set("sortOrder", sortOrder)
  38081. return c
  38082. }
  38083. // Fields allows partial responses to be retrieved. See
  38084. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38085. // for more information.
  38086. func (c *RemarketingListsListCall) Fields(s ...googleapi.Field) *RemarketingListsListCall {
  38087. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38088. return c
  38089. }
  38090. // IfNoneMatch sets the optional parameter which makes the operation
  38091. // fail if the object's ETag matches the given value. This is useful for
  38092. // getting updates only after the object has changed since the last
  38093. // request. Use googleapi.IsNotModified to check whether the response
  38094. // error from Do is the result of In-None-Match.
  38095. func (c *RemarketingListsListCall) IfNoneMatch(entityTag string) *RemarketingListsListCall {
  38096. c.ifNoneMatch_ = entityTag
  38097. return c
  38098. }
  38099. // Context sets the context to be used in this call's Do method. Any
  38100. // pending HTTP request will be aborted if the provided context is
  38101. // canceled.
  38102. func (c *RemarketingListsListCall) Context(ctx context.Context) *RemarketingListsListCall {
  38103. c.ctx_ = ctx
  38104. return c
  38105. }
  38106. // Header returns an http.Header that can be modified by the caller to
  38107. // add HTTP headers to the request.
  38108. func (c *RemarketingListsListCall) Header() http.Header {
  38109. if c.header_ == nil {
  38110. c.header_ = make(http.Header)
  38111. }
  38112. return c.header_
  38113. }
  38114. func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  38115. reqHeaders := make(http.Header)
  38116. for k, v := range c.header_ {
  38117. reqHeaders[k] = v
  38118. }
  38119. reqHeaders.Set("User-Agent", c.s.userAgent())
  38120. if c.ifNoneMatch_ != "" {
  38121. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38122. }
  38123. var body io.Reader = nil
  38124. c.urlParams_.Set("alt", alt)
  38125. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38126. urls += "?" + c.urlParams_.Encode()
  38127. req, _ := http.NewRequest("GET", urls, body)
  38128. req.Header = reqHeaders
  38129. googleapi.Expand(req.URL, map[string]string{
  38130. "profileId": strconv.FormatInt(c.profileId, 10),
  38131. })
  38132. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38133. }
  38134. // Do executes the "dfareporting.remarketingLists.list" call.
  38135. // Exactly one of *RemarketingListsListResponse or error will be
  38136. // non-nil. Any non-2xx status code is an error. Response headers are in
  38137. // either *RemarketingListsListResponse.ServerResponse.Header or (if a
  38138. // response was returned at all) in error.(*googleapi.Error).Header. Use
  38139. // googleapi.IsNotModified to check whether the returned error was
  38140. // because http.StatusNotModified was returned.
  38141. func (c *RemarketingListsListCall) Do(opts ...googleapi.CallOption) (*RemarketingListsListResponse, error) {
  38142. gensupport.SetOptions(c.urlParams_, opts...)
  38143. res, err := c.doRequest("json")
  38144. if res != nil && res.StatusCode == http.StatusNotModified {
  38145. if res.Body != nil {
  38146. res.Body.Close()
  38147. }
  38148. return nil, &googleapi.Error{
  38149. Code: res.StatusCode,
  38150. Header: res.Header,
  38151. }
  38152. }
  38153. if err != nil {
  38154. return nil, err
  38155. }
  38156. defer googleapi.CloseBody(res)
  38157. if err := googleapi.CheckResponse(res); err != nil {
  38158. return nil, err
  38159. }
  38160. ret := &RemarketingListsListResponse{
  38161. ServerResponse: googleapi.ServerResponse{
  38162. Header: res.Header,
  38163. HTTPStatusCode: res.StatusCode,
  38164. },
  38165. }
  38166. target := &ret
  38167. if err := gensupport.DecodeResponse(target, res); err != nil {
  38168. return nil, err
  38169. }
  38170. return ret, nil
  38171. // {
  38172. // "description": "Retrieves a list of remarketing lists, possibly filtered. This method supports paging.",
  38173. // "httpMethod": "GET",
  38174. // "id": "dfareporting.remarketingLists.list",
  38175. // "parameterOrder": [
  38176. // "profileId",
  38177. // "advertiserId"
  38178. // ],
  38179. // "parameters": {
  38180. // "active": {
  38181. // "description": "Select only active or only inactive remarketing lists.",
  38182. // "location": "query",
  38183. // "type": "boolean"
  38184. // },
  38185. // "advertiserId": {
  38186. // "description": "Select only remarketing lists owned by this advertiser.",
  38187. // "format": "int64",
  38188. // "location": "query",
  38189. // "required": true,
  38190. // "type": "string"
  38191. // },
  38192. // "floodlightActivityId": {
  38193. // "description": "Select only remarketing lists that have this floodlight activity ID.",
  38194. // "format": "int64",
  38195. // "location": "query",
  38196. // "type": "string"
  38197. // },
  38198. // "maxResults": {
  38199. // "default": "1000",
  38200. // "description": "Maximum number of results to return.",
  38201. // "format": "int32",
  38202. // "location": "query",
  38203. // "maximum": "1000",
  38204. // "minimum": "0",
  38205. // "type": "integer"
  38206. // },
  38207. // "name": {
  38208. // "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\".",
  38209. // "location": "query",
  38210. // "type": "string"
  38211. // },
  38212. // "pageToken": {
  38213. // "description": "Value of the nextPageToken from the previous result page.",
  38214. // "location": "query",
  38215. // "type": "string"
  38216. // },
  38217. // "profileId": {
  38218. // "description": "User profile ID associated with this request.",
  38219. // "format": "int64",
  38220. // "location": "path",
  38221. // "required": true,
  38222. // "type": "string"
  38223. // },
  38224. // "sortField": {
  38225. // "default": "ID",
  38226. // "description": "Field by which to sort the list.",
  38227. // "enum": [
  38228. // "ID",
  38229. // "NAME"
  38230. // ],
  38231. // "enumDescriptions": [
  38232. // "",
  38233. // ""
  38234. // ],
  38235. // "location": "query",
  38236. // "type": "string"
  38237. // },
  38238. // "sortOrder": {
  38239. // "default": "ASCENDING",
  38240. // "description": "Order of sorted results.",
  38241. // "enum": [
  38242. // "ASCENDING",
  38243. // "DESCENDING"
  38244. // ],
  38245. // "enumDescriptions": [
  38246. // "",
  38247. // ""
  38248. // ],
  38249. // "location": "query",
  38250. // "type": "string"
  38251. // }
  38252. // },
  38253. // "path": "userprofiles/{profileId}/remarketingLists",
  38254. // "response": {
  38255. // "$ref": "RemarketingListsListResponse"
  38256. // },
  38257. // "scopes": [
  38258. // "https://www.googleapis.com/auth/dfatrafficking"
  38259. // ]
  38260. // }
  38261. }
  38262. // Pages invokes f for each page of results.
  38263. // A non-nil error returned from f will halt the iteration.
  38264. // The provided context supersedes any context provided to the Context method.
  38265. func (c *RemarketingListsListCall) Pages(ctx context.Context, f func(*RemarketingListsListResponse) error) error {
  38266. c.ctx_ = ctx
  38267. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38268. for {
  38269. x, err := c.Do()
  38270. if err != nil {
  38271. return err
  38272. }
  38273. if err := f(x); err != nil {
  38274. return err
  38275. }
  38276. if x.NextPageToken == "" {
  38277. return nil
  38278. }
  38279. c.PageToken(x.NextPageToken)
  38280. }
  38281. }
  38282. // method id "dfareporting.remarketingLists.patch":
  38283. type RemarketingListsPatchCall struct {
  38284. s *Service
  38285. profileId int64
  38286. remarketinglist *RemarketingList
  38287. urlParams_ gensupport.URLParams
  38288. ctx_ context.Context
  38289. header_ http.Header
  38290. }
  38291. // Patch: Updates an existing remarketing list. This method supports
  38292. // patch semantics.
  38293. func (r *RemarketingListsService) Patch(profileId int64, id int64, remarketinglist *RemarketingList) *RemarketingListsPatchCall {
  38294. c := &RemarketingListsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38295. c.profileId = profileId
  38296. c.urlParams_.Set("id", fmt.Sprint(id))
  38297. c.remarketinglist = remarketinglist
  38298. return c
  38299. }
  38300. // Fields allows partial responses to be retrieved. See
  38301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38302. // for more information.
  38303. func (c *RemarketingListsPatchCall) Fields(s ...googleapi.Field) *RemarketingListsPatchCall {
  38304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38305. return c
  38306. }
  38307. // Context sets the context to be used in this call's Do method. Any
  38308. // pending HTTP request will be aborted if the provided context is
  38309. // canceled.
  38310. func (c *RemarketingListsPatchCall) Context(ctx context.Context) *RemarketingListsPatchCall {
  38311. c.ctx_ = ctx
  38312. return c
  38313. }
  38314. // Header returns an http.Header that can be modified by the caller to
  38315. // add HTTP headers to the request.
  38316. func (c *RemarketingListsPatchCall) Header() http.Header {
  38317. if c.header_ == nil {
  38318. c.header_ = make(http.Header)
  38319. }
  38320. return c.header_
  38321. }
  38322. func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) {
  38323. reqHeaders := make(http.Header)
  38324. for k, v := range c.header_ {
  38325. reqHeaders[k] = v
  38326. }
  38327. reqHeaders.Set("User-Agent", c.s.userAgent())
  38328. var body io.Reader = nil
  38329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  38330. if err != nil {
  38331. return nil, err
  38332. }
  38333. reqHeaders.Set("Content-Type", "application/json")
  38334. c.urlParams_.Set("alt", alt)
  38335. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38336. urls += "?" + c.urlParams_.Encode()
  38337. req, _ := http.NewRequest("PATCH", urls, body)
  38338. req.Header = reqHeaders
  38339. googleapi.Expand(req.URL, map[string]string{
  38340. "profileId": strconv.FormatInt(c.profileId, 10),
  38341. })
  38342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38343. }
  38344. // Do executes the "dfareporting.remarketingLists.patch" call.
  38345. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38346. // status code is an error. Response headers are in either
  38347. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38348. // at all) in error.(*googleapi.Error).Header. Use
  38349. // googleapi.IsNotModified to check whether the returned error was
  38350. // because http.StatusNotModified was returned.
  38351. func (c *RemarketingListsPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38352. gensupport.SetOptions(c.urlParams_, opts...)
  38353. res, err := c.doRequest("json")
  38354. if res != nil && res.StatusCode == http.StatusNotModified {
  38355. if res.Body != nil {
  38356. res.Body.Close()
  38357. }
  38358. return nil, &googleapi.Error{
  38359. Code: res.StatusCode,
  38360. Header: res.Header,
  38361. }
  38362. }
  38363. if err != nil {
  38364. return nil, err
  38365. }
  38366. defer googleapi.CloseBody(res)
  38367. if err := googleapi.CheckResponse(res); err != nil {
  38368. return nil, err
  38369. }
  38370. ret := &RemarketingList{
  38371. ServerResponse: googleapi.ServerResponse{
  38372. Header: res.Header,
  38373. HTTPStatusCode: res.StatusCode,
  38374. },
  38375. }
  38376. target := &ret
  38377. if err := gensupport.DecodeResponse(target, res); err != nil {
  38378. return nil, err
  38379. }
  38380. return ret, nil
  38381. // {
  38382. // "description": "Updates an existing remarketing list. This method supports patch semantics.",
  38383. // "httpMethod": "PATCH",
  38384. // "id": "dfareporting.remarketingLists.patch",
  38385. // "parameterOrder": [
  38386. // "profileId",
  38387. // "id"
  38388. // ],
  38389. // "parameters": {
  38390. // "id": {
  38391. // "description": "Remarketing list ID.",
  38392. // "format": "int64",
  38393. // "location": "query",
  38394. // "required": true,
  38395. // "type": "string"
  38396. // },
  38397. // "profileId": {
  38398. // "description": "User profile ID associated with this request.",
  38399. // "format": "int64",
  38400. // "location": "path",
  38401. // "required": true,
  38402. // "type": "string"
  38403. // }
  38404. // },
  38405. // "path": "userprofiles/{profileId}/remarketingLists",
  38406. // "request": {
  38407. // "$ref": "RemarketingList"
  38408. // },
  38409. // "response": {
  38410. // "$ref": "RemarketingList"
  38411. // },
  38412. // "scopes": [
  38413. // "https://www.googleapis.com/auth/dfatrafficking"
  38414. // ]
  38415. // }
  38416. }
  38417. // method id "dfareporting.remarketingLists.update":
  38418. type RemarketingListsUpdateCall struct {
  38419. s *Service
  38420. profileId int64
  38421. remarketinglist *RemarketingList
  38422. urlParams_ gensupport.URLParams
  38423. ctx_ context.Context
  38424. header_ http.Header
  38425. }
  38426. // Update: Updates an existing remarketing list.
  38427. func (r *RemarketingListsService) Update(profileId int64, remarketinglist *RemarketingList) *RemarketingListsUpdateCall {
  38428. c := &RemarketingListsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38429. c.profileId = profileId
  38430. c.remarketinglist = remarketinglist
  38431. return c
  38432. }
  38433. // Fields allows partial responses to be retrieved. See
  38434. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38435. // for more information.
  38436. func (c *RemarketingListsUpdateCall) Fields(s ...googleapi.Field) *RemarketingListsUpdateCall {
  38437. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38438. return c
  38439. }
  38440. // Context sets the context to be used in this call's Do method. Any
  38441. // pending HTTP request will be aborted if the provided context is
  38442. // canceled.
  38443. func (c *RemarketingListsUpdateCall) Context(ctx context.Context) *RemarketingListsUpdateCall {
  38444. c.ctx_ = ctx
  38445. return c
  38446. }
  38447. // Header returns an http.Header that can be modified by the caller to
  38448. // add HTTP headers to the request.
  38449. func (c *RemarketingListsUpdateCall) Header() http.Header {
  38450. if c.header_ == nil {
  38451. c.header_ = make(http.Header)
  38452. }
  38453. return c.header_
  38454. }
  38455. func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) {
  38456. reqHeaders := make(http.Header)
  38457. for k, v := range c.header_ {
  38458. reqHeaders[k] = v
  38459. }
  38460. reqHeaders.Set("User-Agent", c.s.userAgent())
  38461. var body io.Reader = nil
  38462. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  38463. if err != nil {
  38464. return nil, err
  38465. }
  38466. reqHeaders.Set("Content-Type", "application/json")
  38467. c.urlParams_.Set("alt", alt)
  38468. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38469. urls += "?" + c.urlParams_.Encode()
  38470. req, _ := http.NewRequest("PUT", urls, body)
  38471. req.Header = reqHeaders
  38472. googleapi.Expand(req.URL, map[string]string{
  38473. "profileId": strconv.FormatInt(c.profileId, 10),
  38474. })
  38475. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38476. }
  38477. // Do executes the "dfareporting.remarketingLists.update" call.
  38478. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38479. // status code is an error. Response headers are in either
  38480. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38481. // at all) in error.(*googleapi.Error).Header. Use
  38482. // googleapi.IsNotModified to check whether the returned error was
  38483. // because http.StatusNotModified was returned.
  38484. func (c *RemarketingListsUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38485. gensupport.SetOptions(c.urlParams_, opts...)
  38486. res, err := c.doRequest("json")
  38487. if res != nil && res.StatusCode == http.StatusNotModified {
  38488. if res.Body != nil {
  38489. res.Body.Close()
  38490. }
  38491. return nil, &googleapi.Error{
  38492. Code: res.StatusCode,
  38493. Header: res.Header,
  38494. }
  38495. }
  38496. if err != nil {
  38497. return nil, err
  38498. }
  38499. defer googleapi.CloseBody(res)
  38500. if err := googleapi.CheckResponse(res); err != nil {
  38501. return nil, err
  38502. }
  38503. ret := &RemarketingList{
  38504. ServerResponse: googleapi.ServerResponse{
  38505. Header: res.Header,
  38506. HTTPStatusCode: res.StatusCode,
  38507. },
  38508. }
  38509. target := &ret
  38510. if err := gensupport.DecodeResponse(target, res); err != nil {
  38511. return nil, err
  38512. }
  38513. return ret, nil
  38514. // {
  38515. // "description": "Updates an existing remarketing list.",
  38516. // "httpMethod": "PUT",
  38517. // "id": "dfareporting.remarketingLists.update",
  38518. // "parameterOrder": [
  38519. // "profileId"
  38520. // ],
  38521. // "parameters": {
  38522. // "profileId": {
  38523. // "description": "User profile ID associated with this request.",
  38524. // "format": "int64",
  38525. // "location": "path",
  38526. // "required": true,
  38527. // "type": "string"
  38528. // }
  38529. // },
  38530. // "path": "userprofiles/{profileId}/remarketingLists",
  38531. // "request": {
  38532. // "$ref": "RemarketingList"
  38533. // },
  38534. // "response": {
  38535. // "$ref": "RemarketingList"
  38536. // },
  38537. // "scopes": [
  38538. // "https://www.googleapis.com/auth/dfatrafficking"
  38539. // ]
  38540. // }
  38541. }
  38542. // method id "dfareporting.reports.delete":
  38543. type ReportsDeleteCall struct {
  38544. s *Service
  38545. profileId int64
  38546. reportId int64
  38547. urlParams_ gensupport.URLParams
  38548. ctx_ context.Context
  38549. header_ http.Header
  38550. }
  38551. // Delete: Deletes a report by its ID.
  38552. func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall {
  38553. c := &ReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38554. c.profileId = profileId
  38555. c.reportId = reportId
  38556. return c
  38557. }
  38558. // Fields allows partial responses to be retrieved. See
  38559. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38560. // for more information.
  38561. func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall {
  38562. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38563. return c
  38564. }
  38565. // Context sets the context to be used in this call's Do method. Any
  38566. // pending HTTP request will be aborted if the provided context is
  38567. // canceled.
  38568. func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall {
  38569. c.ctx_ = ctx
  38570. return c
  38571. }
  38572. // Header returns an http.Header that can be modified by the caller to
  38573. // add HTTP headers to the request.
  38574. func (c *ReportsDeleteCall) Header() http.Header {
  38575. if c.header_ == nil {
  38576. c.header_ = make(http.Header)
  38577. }
  38578. return c.header_
  38579. }
  38580. func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  38581. reqHeaders := make(http.Header)
  38582. for k, v := range c.header_ {
  38583. reqHeaders[k] = v
  38584. }
  38585. reqHeaders.Set("User-Agent", c.s.userAgent())
  38586. var body io.Reader = nil
  38587. c.urlParams_.Set("alt", alt)
  38588. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  38589. urls += "?" + c.urlParams_.Encode()
  38590. req, _ := http.NewRequest("DELETE", urls, body)
  38591. req.Header = reqHeaders
  38592. googleapi.Expand(req.URL, map[string]string{
  38593. "profileId": strconv.FormatInt(c.profileId, 10),
  38594. "reportId": strconv.FormatInt(c.reportId, 10),
  38595. })
  38596. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38597. }
  38598. // Do executes the "dfareporting.reports.delete" call.
  38599. func (c *ReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  38600. gensupport.SetOptions(c.urlParams_, opts...)
  38601. res, err := c.doRequest("json")
  38602. if err != nil {
  38603. return err
  38604. }
  38605. defer googleapi.CloseBody(res)
  38606. if err := googleapi.CheckResponse(res); err != nil {
  38607. return err
  38608. }
  38609. return nil
  38610. // {
  38611. // "description": "Deletes a report by its ID.",
  38612. // "httpMethod": "DELETE",
  38613. // "id": "dfareporting.reports.delete",
  38614. // "parameterOrder": [
  38615. // "profileId",
  38616. // "reportId"
  38617. // ],
  38618. // "parameters": {
  38619. // "profileId": {
  38620. // "description": "The DFA user profile ID.",
  38621. // "format": "int64",
  38622. // "location": "path",
  38623. // "required": true,
  38624. // "type": "string"
  38625. // },
  38626. // "reportId": {
  38627. // "description": "The ID of the report.",
  38628. // "format": "int64",
  38629. // "location": "path",
  38630. // "required": true,
  38631. // "type": "string"
  38632. // }
  38633. // },
  38634. // "path": "userprofiles/{profileId}/reports/{reportId}",
  38635. // "scopes": [
  38636. // "https://www.googleapis.com/auth/dfareporting"
  38637. // ]
  38638. // }
  38639. }
  38640. // method id "dfareporting.reports.get":
  38641. type ReportsGetCall struct {
  38642. s *Service
  38643. profileId int64
  38644. reportId int64
  38645. urlParams_ gensupport.URLParams
  38646. ifNoneMatch_ string
  38647. ctx_ context.Context
  38648. header_ http.Header
  38649. }
  38650. // Get: Retrieves a report by its ID.
  38651. func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall {
  38652. c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38653. c.profileId = profileId
  38654. c.reportId = reportId
  38655. return c
  38656. }
  38657. // Fields allows partial responses to be retrieved. See
  38658. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38659. // for more information.
  38660. func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
  38661. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38662. return c
  38663. }
  38664. // IfNoneMatch sets the optional parameter which makes the operation
  38665. // fail if the object's ETag matches the given value. This is useful for
  38666. // getting updates only after the object has changed since the last
  38667. // request. Use googleapi.IsNotModified to check whether the response
  38668. // error from Do is the result of In-None-Match.
  38669. func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
  38670. c.ifNoneMatch_ = entityTag
  38671. return c
  38672. }
  38673. // Context sets the context to be used in this call's Do method. Any
  38674. // pending HTTP request will be aborted if the provided context is
  38675. // canceled.
  38676. func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
  38677. c.ctx_ = ctx
  38678. return c
  38679. }
  38680. // Header returns an http.Header that can be modified by the caller to
  38681. // add HTTP headers to the request.
  38682. func (c *ReportsGetCall) Header() http.Header {
  38683. if c.header_ == nil {
  38684. c.header_ = make(http.Header)
  38685. }
  38686. return c.header_
  38687. }
  38688. func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
  38689. reqHeaders := make(http.Header)
  38690. for k, v := range c.header_ {
  38691. reqHeaders[k] = v
  38692. }
  38693. reqHeaders.Set("User-Agent", c.s.userAgent())
  38694. if c.ifNoneMatch_ != "" {
  38695. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38696. }
  38697. var body io.Reader = nil
  38698. c.urlParams_.Set("alt", alt)
  38699. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  38700. urls += "?" + c.urlParams_.Encode()
  38701. req, _ := http.NewRequest("GET", urls, body)
  38702. req.Header = reqHeaders
  38703. googleapi.Expand(req.URL, map[string]string{
  38704. "profileId": strconv.FormatInt(c.profileId, 10),
  38705. "reportId": strconv.FormatInt(c.reportId, 10),
  38706. })
  38707. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38708. }
  38709. // Do executes the "dfareporting.reports.get" call.
  38710. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  38711. // code is an error. Response headers are in either
  38712. // *Report.ServerResponse.Header or (if a response was returned at all)
  38713. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38714. // check whether the returned error was because http.StatusNotModified
  38715. // was returned.
  38716. func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  38717. gensupport.SetOptions(c.urlParams_, opts...)
  38718. res, err := c.doRequest("json")
  38719. if res != nil && res.StatusCode == http.StatusNotModified {
  38720. if res.Body != nil {
  38721. res.Body.Close()
  38722. }
  38723. return nil, &googleapi.Error{
  38724. Code: res.StatusCode,
  38725. Header: res.Header,
  38726. }
  38727. }
  38728. if err != nil {
  38729. return nil, err
  38730. }
  38731. defer googleapi.CloseBody(res)
  38732. if err := googleapi.CheckResponse(res); err != nil {
  38733. return nil, err
  38734. }
  38735. ret := &Report{
  38736. ServerResponse: googleapi.ServerResponse{
  38737. Header: res.Header,
  38738. HTTPStatusCode: res.StatusCode,
  38739. },
  38740. }
  38741. target := &ret
  38742. if err := gensupport.DecodeResponse(target, res); err != nil {
  38743. return nil, err
  38744. }
  38745. return ret, nil
  38746. // {
  38747. // "description": "Retrieves a report by its ID.",
  38748. // "httpMethod": "GET",
  38749. // "id": "dfareporting.reports.get",
  38750. // "parameterOrder": [
  38751. // "profileId",
  38752. // "reportId"
  38753. // ],
  38754. // "parameters": {
  38755. // "profileId": {
  38756. // "description": "The DFA user profile ID.",
  38757. // "format": "int64",
  38758. // "location": "path",
  38759. // "required": true,
  38760. // "type": "string"
  38761. // },
  38762. // "reportId": {
  38763. // "description": "The ID of the report.",
  38764. // "format": "int64",
  38765. // "location": "path",
  38766. // "required": true,
  38767. // "type": "string"
  38768. // }
  38769. // },
  38770. // "path": "userprofiles/{profileId}/reports/{reportId}",
  38771. // "response": {
  38772. // "$ref": "Report"
  38773. // },
  38774. // "scopes": [
  38775. // "https://www.googleapis.com/auth/dfareporting"
  38776. // ]
  38777. // }
  38778. }
  38779. // method id "dfareporting.reports.insert":
  38780. type ReportsInsertCall struct {
  38781. s *Service
  38782. profileId int64
  38783. report *Report
  38784. urlParams_ gensupport.URLParams
  38785. ctx_ context.Context
  38786. header_ http.Header
  38787. }
  38788. // Insert: Creates a report.
  38789. func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall {
  38790. c := &ReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38791. c.profileId = profileId
  38792. c.report = report
  38793. return c
  38794. }
  38795. // Fields allows partial responses to be retrieved. See
  38796. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38797. // for more information.
  38798. func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall {
  38799. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38800. return c
  38801. }
  38802. // Context sets the context to be used in this call's Do method. Any
  38803. // pending HTTP request will be aborted if the provided context is
  38804. // canceled.
  38805. func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall {
  38806. c.ctx_ = ctx
  38807. return c
  38808. }
  38809. // Header returns an http.Header that can be modified by the caller to
  38810. // add HTTP headers to the request.
  38811. func (c *ReportsInsertCall) Header() http.Header {
  38812. if c.header_ == nil {
  38813. c.header_ = make(http.Header)
  38814. }
  38815. return c.header_
  38816. }
  38817. func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  38818. reqHeaders := make(http.Header)
  38819. for k, v := range c.header_ {
  38820. reqHeaders[k] = v
  38821. }
  38822. reqHeaders.Set("User-Agent", c.s.userAgent())
  38823. var body io.Reader = nil
  38824. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  38825. if err != nil {
  38826. return nil, err
  38827. }
  38828. reqHeaders.Set("Content-Type", "application/json")
  38829. c.urlParams_.Set("alt", alt)
  38830. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  38831. urls += "?" + c.urlParams_.Encode()
  38832. req, _ := http.NewRequest("POST", urls, body)
  38833. req.Header = reqHeaders
  38834. googleapi.Expand(req.URL, map[string]string{
  38835. "profileId": strconv.FormatInt(c.profileId, 10),
  38836. })
  38837. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38838. }
  38839. // Do executes the "dfareporting.reports.insert" call.
  38840. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  38841. // code is an error. Response headers are in either
  38842. // *Report.ServerResponse.Header or (if a response was returned at all)
  38843. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38844. // check whether the returned error was because http.StatusNotModified
  38845. // was returned.
  38846. func (c *ReportsInsertCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  38847. gensupport.SetOptions(c.urlParams_, opts...)
  38848. res, err := c.doRequest("json")
  38849. if res != nil && res.StatusCode == http.StatusNotModified {
  38850. if res.Body != nil {
  38851. res.Body.Close()
  38852. }
  38853. return nil, &googleapi.Error{
  38854. Code: res.StatusCode,
  38855. Header: res.Header,
  38856. }
  38857. }
  38858. if err != nil {
  38859. return nil, err
  38860. }
  38861. defer googleapi.CloseBody(res)
  38862. if err := googleapi.CheckResponse(res); err != nil {
  38863. return nil, err
  38864. }
  38865. ret := &Report{
  38866. ServerResponse: googleapi.ServerResponse{
  38867. Header: res.Header,
  38868. HTTPStatusCode: res.StatusCode,
  38869. },
  38870. }
  38871. target := &ret
  38872. if err := gensupport.DecodeResponse(target, res); err != nil {
  38873. return nil, err
  38874. }
  38875. return ret, nil
  38876. // {
  38877. // "description": "Creates a report.",
  38878. // "httpMethod": "POST",
  38879. // "id": "dfareporting.reports.insert",
  38880. // "parameterOrder": [
  38881. // "profileId"
  38882. // ],
  38883. // "parameters": {
  38884. // "profileId": {
  38885. // "description": "The DFA user profile ID.",
  38886. // "format": "int64",
  38887. // "location": "path",
  38888. // "required": true,
  38889. // "type": "string"
  38890. // }
  38891. // },
  38892. // "path": "userprofiles/{profileId}/reports",
  38893. // "request": {
  38894. // "$ref": "Report"
  38895. // },
  38896. // "response": {
  38897. // "$ref": "Report"
  38898. // },
  38899. // "scopes": [
  38900. // "https://www.googleapis.com/auth/dfareporting"
  38901. // ]
  38902. // }
  38903. }
  38904. // method id "dfareporting.reports.list":
  38905. type ReportsListCall struct {
  38906. s *Service
  38907. profileId int64
  38908. urlParams_ gensupport.URLParams
  38909. ifNoneMatch_ string
  38910. ctx_ context.Context
  38911. header_ http.Header
  38912. }
  38913. // List: Retrieves list of reports.
  38914. func (r *ReportsService) List(profileId int64) *ReportsListCall {
  38915. c := &ReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38916. c.profileId = profileId
  38917. return c
  38918. }
  38919. // MaxResults sets the optional parameter "maxResults": Maximum number
  38920. // of results to return.
  38921. func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall {
  38922. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38923. return c
  38924. }
  38925. // PageToken sets the optional parameter "pageToken": The value of the
  38926. // nextToken from the previous result page.
  38927. func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall {
  38928. c.urlParams_.Set("pageToken", pageToken)
  38929. return c
  38930. }
  38931. // Scope sets the optional parameter "scope": The scope that defines
  38932. // which results are returned.
  38933. //
  38934. // Possible values:
  38935. // "ALL" - All reports in account.
  38936. // "MINE" (default) - My reports.
  38937. func (c *ReportsListCall) Scope(scope string) *ReportsListCall {
  38938. c.urlParams_.Set("scope", scope)
  38939. return c
  38940. }
  38941. // SortField sets the optional parameter "sortField": The field by which
  38942. // to sort the list.
  38943. //
  38944. // Possible values:
  38945. // "ID" - Sort by report ID.
  38946. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field.
  38947. // "NAME" - Sort by name of reports.
  38948. func (c *ReportsListCall) SortField(sortField string) *ReportsListCall {
  38949. c.urlParams_.Set("sortField", sortField)
  38950. return c
  38951. }
  38952. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  38953. // results.
  38954. //
  38955. // Possible values:
  38956. // "ASCENDING" - Ascending order.
  38957. // "DESCENDING" (default) - Descending order.
  38958. func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall {
  38959. c.urlParams_.Set("sortOrder", sortOrder)
  38960. return c
  38961. }
  38962. // Fields allows partial responses to be retrieved. See
  38963. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38964. // for more information.
  38965. func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall {
  38966. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38967. return c
  38968. }
  38969. // IfNoneMatch sets the optional parameter which makes the operation
  38970. // fail if the object's ETag matches the given value. This is useful for
  38971. // getting updates only after the object has changed since the last
  38972. // request. Use googleapi.IsNotModified to check whether the response
  38973. // error from Do is the result of In-None-Match.
  38974. func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall {
  38975. c.ifNoneMatch_ = entityTag
  38976. return c
  38977. }
  38978. // Context sets the context to be used in this call's Do method. Any
  38979. // pending HTTP request will be aborted if the provided context is
  38980. // canceled.
  38981. func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall {
  38982. c.ctx_ = ctx
  38983. return c
  38984. }
  38985. // Header returns an http.Header that can be modified by the caller to
  38986. // add HTTP headers to the request.
  38987. func (c *ReportsListCall) Header() http.Header {
  38988. if c.header_ == nil {
  38989. c.header_ = make(http.Header)
  38990. }
  38991. return c.header_
  38992. }
  38993. func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) {
  38994. reqHeaders := make(http.Header)
  38995. for k, v := range c.header_ {
  38996. reqHeaders[k] = v
  38997. }
  38998. reqHeaders.Set("User-Agent", c.s.userAgent())
  38999. if c.ifNoneMatch_ != "" {
  39000. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39001. }
  39002. var body io.Reader = nil
  39003. c.urlParams_.Set("alt", alt)
  39004. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  39005. urls += "?" + c.urlParams_.Encode()
  39006. req, _ := http.NewRequest("GET", urls, body)
  39007. req.Header = reqHeaders
  39008. googleapi.Expand(req.URL, map[string]string{
  39009. "profileId": strconv.FormatInt(c.profileId, 10),
  39010. })
  39011. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39012. }
  39013. // Do executes the "dfareporting.reports.list" call.
  39014. // Exactly one of *ReportList or error will be non-nil. Any non-2xx
  39015. // status code is an error. Response headers are in either
  39016. // *ReportList.ServerResponse.Header or (if a response was returned at
  39017. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39018. // to check whether the returned error was because
  39019. // http.StatusNotModified was returned.
  39020. func (c *ReportsListCall) Do(opts ...googleapi.CallOption) (*ReportList, error) {
  39021. gensupport.SetOptions(c.urlParams_, opts...)
  39022. res, err := c.doRequest("json")
  39023. if res != nil && res.StatusCode == http.StatusNotModified {
  39024. if res.Body != nil {
  39025. res.Body.Close()
  39026. }
  39027. return nil, &googleapi.Error{
  39028. Code: res.StatusCode,
  39029. Header: res.Header,
  39030. }
  39031. }
  39032. if err != nil {
  39033. return nil, err
  39034. }
  39035. defer googleapi.CloseBody(res)
  39036. if err := googleapi.CheckResponse(res); err != nil {
  39037. return nil, err
  39038. }
  39039. ret := &ReportList{
  39040. ServerResponse: googleapi.ServerResponse{
  39041. Header: res.Header,
  39042. HTTPStatusCode: res.StatusCode,
  39043. },
  39044. }
  39045. target := &ret
  39046. if err := gensupport.DecodeResponse(target, res); err != nil {
  39047. return nil, err
  39048. }
  39049. return ret, nil
  39050. // {
  39051. // "description": "Retrieves list of reports.",
  39052. // "httpMethod": "GET",
  39053. // "id": "dfareporting.reports.list",
  39054. // "parameterOrder": [
  39055. // "profileId"
  39056. // ],
  39057. // "parameters": {
  39058. // "maxResults": {
  39059. // "default": "10",
  39060. // "description": "Maximum number of results to return.",
  39061. // "format": "int32",
  39062. // "location": "query",
  39063. // "maximum": "10",
  39064. // "minimum": "0",
  39065. // "type": "integer"
  39066. // },
  39067. // "pageToken": {
  39068. // "description": "The value of the nextToken from the previous result page.",
  39069. // "location": "query",
  39070. // "type": "string"
  39071. // },
  39072. // "profileId": {
  39073. // "description": "The DFA user profile ID.",
  39074. // "format": "int64",
  39075. // "location": "path",
  39076. // "required": true,
  39077. // "type": "string"
  39078. // },
  39079. // "scope": {
  39080. // "default": "MINE",
  39081. // "description": "The scope that defines which results are returned.",
  39082. // "enum": [
  39083. // "ALL",
  39084. // "MINE"
  39085. // ],
  39086. // "enumDescriptions": [
  39087. // "All reports in account.",
  39088. // "My reports."
  39089. // ],
  39090. // "location": "query",
  39091. // "type": "string"
  39092. // },
  39093. // "sortField": {
  39094. // "default": "LAST_MODIFIED_TIME",
  39095. // "description": "The field by which to sort the list.",
  39096. // "enum": [
  39097. // "ID",
  39098. // "LAST_MODIFIED_TIME",
  39099. // "NAME"
  39100. // ],
  39101. // "enumDescriptions": [
  39102. // "Sort by report ID.",
  39103. // "Sort by 'lastModifiedTime' field.",
  39104. // "Sort by name of reports."
  39105. // ],
  39106. // "location": "query",
  39107. // "type": "string"
  39108. // },
  39109. // "sortOrder": {
  39110. // "default": "DESCENDING",
  39111. // "description": "Order of sorted results.",
  39112. // "enum": [
  39113. // "ASCENDING",
  39114. // "DESCENDING"
  39115. // ],
  39116. // "enumDescriptions": [
  39117. // "Ascending order.",
  39118. // "Descending order."
  39119. // ],
  39120. // "location": "query",
  39121. // "type": "string"
  39122. // }
  39123. // },
  39124. // "path": "userprofiles/{profileId}/reports",
  39125. // "response": {
  39126. // "$ref": "ReportList"
  39127. // },
  39128. // "scopes": [
  39129. // "https://www.googleapis.com/auth/dfareporting"
  39130. // ]
  39131. // }
  39132. }
  39133. // Pages invokes f for each page of results.
  39134. // A non-nil error returned from f will halt the iteration.
  39135. // The provided context supersedes any context provided to the Context method.
  39136. func (c *ReportsListCall) Pages(ctx context.Context, f func(*ReportList) error) error {
  39137. c.ctx_ = ctx
  39138. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39139. for {
  39140. x, err := c.Do()
  39141. if err != nil {
  39142. return err
  39143. }
  39144. if err := f(x); err != nil {
  39145. return err
  39146. }
  39147. if x.NextPageToken == "" {
  39148. return nil
  39149. }
  39150. c.PageToken(x.NextPageToken)
  39151. }
  39152. }
  39153. // method id "dfareporting.reports.patch":
  39154. type ReportsPatchCall struct {
  39155. s *Service
  39156. profileId int64
  39157. reportId int64
  39158. report *Report
  39159. urlParams_ gensupport.URLParams
  39160. ctx_ context.Context
  39161. header_ http.Header
  39162. }
  39163. // Patch: Updates a report. This method supports patch semantics.
  39164. func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall {
  39165. c := &ReportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39166. c.profileId = profileId
  39167. c.reportId = reportId
  39168. c.report = report
  39169. return c
  39170. }
  39171. // Fields allows partial responses to be retrieved. See
  39172. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39173. // for more information.
  39174. func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall {
  39175. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39176. return c
  39177. }
  39178. // Context sets the context to be used in this call's Do method. Any
  39179. // pending HTTP request will be aborted if the provided context is
  39180. // canceled.
  39181. func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall {
  39182. c.ctx_ = ctx
  39183. return c
  39184. }
  39185. // Header returns an http.Header that can be modified by the caller to
  39186. // add HTTP headers to the request.
  39187. func (c *ReportsPatchCall) Header() http.Header {
  39188. if c.header_ == nil {
  39189. c.header_ = make(http.Header)
  39190. }
  39191. return c.header_
  39192. }
  39193. func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, error) {
  39194. reqHeaders := make(http.Header)
  39195. for k, v := range c.header_ {
  39196. reqHeaders[k] = v
  39197. }
  39198. reqHeaders.Set("User-Agent", c.s.userAgent())
  39199. var body io.Reader = nil
  39200. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39201. if err != nil {
  39202. return nil, err
  39203. }
  39204. reqHeaders.Set("Content-Type", "application/json")
  39205. c.urlParams_.Set("alt", alt)
  39206. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39207. urls += "?" + c.urlParams_.Encode()
  39208. req, _ := http.NewRequest("PATCH", urls, body)
  39209. req.Header = reqHeaders
  39210. googleapi.Expand(req.URL, map[string]string{
  39211. "profileId": strconv.FormatInt(c.profileId, 10),
  39212. "reportId": strconv.FormatInt(c.reportId, 10),
  39213. })
  39214. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39215. }
  39216. // Do executes the "dfareporting.reports.patch" call.
  39217. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39218. // code is an error. Response headers are in either
  39219. // *Report.ServerResponse.Header or (if a response was returned at all)
  39220. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39221. // check whether the returned error was because http.StatusNotModified
  39222. // was returned.
  39223. func (c *ReportsPatchCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39224. gensupport.SetOptions(c.urlParams_, opts...)
  39225. res, err := c.doRequest("json")
  39226. if res != nil && res.StatusCode == http.StatusNotModified {
  39227. if res.Body != nil {
  39228. res.Body.Close()
  39229. }
  39230. return nil, &googleapi.Error{
  39231. Code: res.StatusCode,
  39232. Header: res.Header,
  39233. }
  39234. }
  39235. if err != nil {
  39236. return nil, err
  39237. }
  39238. defer googleapi.CloseBody(res)
  39239. if err := googleapi.CheckResponse(res); err != nil {
  39240. return nil, err
  39241. }
  39242. ret := &Report{
  39243. ServerResponse: googleapi.ServerResponse{
  39244. Header: res.Header,
  39245. HTTPStatusCode: res.StatusCode,
  39246. },
  39247. }
  39248. target := &ret
  39249. if err := gensupport.DecodeResponse(target, res); err != nil {
  39250. return nil, err
  39251. }
  39252. return ret, nil
  39253. // {
  39254. // "description": "Updates a report. This method supports patch semantics.",
  39255. // "httpMethod": "PATCH",
  39256. // "id": "dfareporting.reports.patch",
  39257. // "parameterOrder": [
  39258. // "profileId",
  39259. // "reportId"
  39260. // ],
  39261. // "parameters": {
  39262. // "profileId": {
  39263. // "description": "The DFA user profile ID.",
  39264. // "format": "int64",
  39265. // "location": "path",
  39266. // "required": true,
  39267. // "type": "string"
  39268. // },
  39269. // "reportId": {
  39270. // "description": "The ID of the report.",
  39271. // "format": "int64",
  39272. // "location": "path",
  39273. // "required": true,
  39274. // "type": "string"
  39275. // }
  39276. // },
  39277. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39278. // "request": {
  39279. // "$ref": "Report"
  39280. // },
  39281. // "response": {
  39282. // "$ref": "Report"
  39283. // },
  39284. // "scopes": [
  39285. // "https://www.googleapis.com/auth/dfareporting"
  39286. // ]
  39287. // }
  39288. }
  39289. // method id "dfareporting.reports.run":
  39290. type ReportsRunCall struct {
  39291. s *Service
  39292. profileId int64
  39293. reportId int64
  39294. urlParams_ gensupport.URLParams
  39295. ctx_ context.Context
  39296. header_ http.Header
  39297. }
  39298. // Run: Runs a report.
  39299. func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall {
  39300. c := &ReportsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39301. c.profileId = profileId
  39302. c.reportId = reportId
  39303. return c
  39304. }
  39305. // Synchronous sets the optional parameter "synchronous": If set and
  39306. // true, tries to run the report synchronously.
  39307. func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall {
  39308. c.urlParams_.Set("synchronous", fmt.Sprint(synchronous))
  39309. return c
  39310. }
  39311. // Fields allows partial responses to be retrieved. See
  39312. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39313. // for more information.
  39314. func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall {
  39315. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39316. return c
  39317. }
  39318. // Context sets the context to be used in this call's Do method. Any
  39319. // pending HTTP request will be aborted if the provided context is
  39320. // canceled.
  39321. func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall {
  39322. c.ctx_ = ctx
  39323. return c
  39324. }
  39325. // Header returns an http.Header that can be modified by the caller to
  39326. // add HTTP headers to the request.
  39327. func (c *ReportsRunCall) Header() http.Header {
  39328. if c.header_ == nil {
  39329. c.header_ = make(http.Header)
  39330. }
  39331. return c.header_
  39332. }
  39333. func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) {
  39334. reqHeaders := make(http.Header)
  39335. for k, v := range c.header_ {
  39336. reqHeaders[k] = v
  39337. }
  39338. reqHeaders.Set("User-Agent", c.s.userAgent())
  39339. var body io.Reader = nil
  39340. c.urlParams_.Set("alt", alt)
  39341. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run")
  39342. urls += "?" + c.urlParams_.Encode()
  39343. req, _ := http.NewRequest("POST", urls, body)
  39344. req.Header = reqHeaders
  39345. googleapi.Expand(req.URL, map[string]string{
  39346. "profileId": strconv.FormatInt(c.profileId, 10),
  39347. "reportId": strconv.FormatInt(c.reportId, 10),
  39348. })
  39349. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39350. }
  39351. // Do executes the "dfareporting.reports.run" call.
  39352. // Exactly one of *File or error will be non-nil. Any non-2xx status
  39353. // code is an error. Response headers are in either
  39354. // *File.ServerResponse.Header or (if a response was returned at all) in
  39355. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39356. // whether the returned error was because http.StatusNotModified was
  39357. // returned.
  39358. func (c *ReportsRunCall) Do(opts ...googleapi.CallOption) (*File, error) {
  39359. gensupport.SetOptions(c.urlParams_, opts...)
  39360. res, err := c.doRequest("json")
  39361. if res != nil && res.StatusCode == http.StatusNotModified {
  39362. if res.Body != nil {
  39363. res.Body.Close()
  39364. }
  39365. return nil, &googleapi.Error{
  39366. Code: res.StatusCode,
  39367. Header: res.Header,
  39368. }
  39369. }
  39370. if err != nil {
  39371. return nil, err
  39372. }
  39373. defer googleapi.CloseBody(res)
  39374. if err := googleapi.CheckResponse(res); err != nil {
  39375. return nil, err
  39376. }
  39377. ret := &File{
  39378. ServerResponse: googleapi.ServerResponse{
  39379. Header: res.Header,
  39380. HTTPStatusCode: res.StatusCode,
  39381. },
  39382. }
  39383. target := &ret
  39384. if err := gensupport.DecodeResponse(target, res); err != nil {
  39385. return nil, err
  39386. }
  39387. return ret, nil
  39388. // {
  39389. // "description": "Runs a report.",
  39390. // "httpMethod": "POST",
  39391. // "id": "dfareporting.reports.run",
  39392. // "parameterOrder": [
  39393. // "profileId",
  39394. // "reportId"
  39395. // ],
  39396. // "parameters": {
  39397. // "profileId": {
  39398. // "description": "The DFA profile ID.",
  39399. // "format": "int64",
  39400. // "location": "path",
  39401. // "required": true,
  39402. // "type": "string"
  39403. // },
  39404. // "reportId": {
  39405. // "description": "The ID of the report.",
  39406. // "format": "int64",
  39407. // "location": "path",
  39408. // "required": true,
  39409. // "type": "string"
  39410. // },
  39411. // "synchronous": {
  39412. // "default": "false",
  39413. // "description": "If set and true, tries to run the report synchronously.",
  39414. // "location": "query",
  39415. // "type": "boolean"
  39416. // }
  39417. // },
  39418. // "path": "userprofiles/{profileId}/reports/{reportId}/run",
  39419. // "response": {
  39420. // "$ref": "File"
  39421. // },
  39422. // "scopes": [
  39423. // "https://www.googleapis.com/auth/dfareporting"
  39424. // ]
  39425. // }
  39426. }
  39427. // method id "dfareporting.reports.update":
  39428. type ReportsUpdateCall struct {
  39429. s *Service
  39430. profileId int64
  39431. reportId int64
  39432. report *Report
  39433. urlParams_ gensupport.URLParams
  39434. ctx_ context.Context
  39435. header_ http.Header
  39436. }
  39437. // Update: Updates a report.
  39438. func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall {
  39439. c := &ReportsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39440. c.profileId = profileId
  39441. c.reportId = reportId
  39442. c.report = report
  39443. return c
  39444. }
  39445. // Fields allows partial responses to be retrieved. See
  39446. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39447. // for more information.
  39448. func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall {
  39449. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39450. return c
  39451. }
  39452. // Context sets the context to be used in this call's Do method. Any
  39453. // pending HTTP request will be aborted if the provided context is
  39454. // canceled.
  39455. func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall {
  39456. c.ctx_ = ctx
  39457. return c
  39458. }
  39459. // Header returns an http.Header that can be modified by the caller to
  39460. // add HTTP headers to the request.
  39461. func (c *ReportsUpdateCall) Header() http.Header {
  39462. if c.header_ == nil {
  39463. c.header_ = make(http.Header)
  39464. }
  39465. return c.header_
  39466. }
  39467. func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, error) {
  39468. reqHeaders := make(http.Header)
  39469. for k, v := range c.header_ {
  39470. reqHeaders[k] = v
  39471. }
  39472. reqHeaders.Set("User-Agent", c.s.userAgent())
  39473. var body io.Reader = nil
  39474. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39475. if err != nil {
  39476. return nil, err
  39477. }
  39478. reqHeaders.Set("Content-Type", "application/json")
  39479. c.urlParams_.Set("alt", alt)
  39480. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39481. urls += "?" + c.urlParams_.Encode()
  39482. req, _ := http.NewRequest("PUT", urls, body)
  39483. req.Header = reqHeaders
  39484. googleapi.Expand(req.URL, map[string]string{
  39485. "profileId": strconv.FormatInt(c.profileId, 10),
  39486. "reportId": strconv.FormatInt(c.reportId, 10),
  39487. })
  39488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39489. }
  39490. // Do executes the "dfareporting.reports.update" call.
  39491. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39492. // code is an error. Response headers are in either
  39493. // *Report.ServerResponse.Header or (if a response was returned at all)
  39494. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39495. // check whether the returned error was because http.StatusNotModified
  39496. // was returned.
  39497. func (c *ReportsUpdateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39498. gensupport.SetOptions(c.urlParams_, opts...)
  39499. res, err := c.doRequest("json")
  39500. if res != nil && res.StatusCode == http.StatusNotModified {
  39501. if res.Body != nil {
  39502. res.Body.Close()
  39503. }
  39504. return nil, &googleapi.Error{
  39505. Code: res.StatusCode,
  39506. Header: res.Header,
  39507. }
  39508. }
  39509. if err != nil {
  39510. return nil, err
  39511. }
  39512. defer googleapi.CloseBody(res)
  39513. if err := googleapi.CheckResponse(res); err != nil {
  39514. return nil, err
  39515. }
  39516. ret := &Report{
  39517. ServerResponse: googleapi.ServerResponse{
  39518. Header: res.Header,
  39519. HTTPStatusCode: res.StatusCode,
  39520. },
  39521. }
  39522. target := &ret
  39523. if err := gensupport.DecodeResponse(target, res); err != nil {
  39524. return nil, err
  39525. }
  39526. return ret, nil
  39527. // {
  39528. // "description": "Updates a report.",
  39529. // "httpMethod": "PUT",
  39530. // "id": "dfareporting.reports.update",
  39531. // "parameterOrder": [
  39532. // "profileId",
  39533. // "reportId"
  39534. // ],
  39535. // "parameters": {
  39536. // "profileId": {
  39537. // "description": "The DFA user profile ID.",
  39538. // "format": "int64",
  39539. // "location": "path",
  39540. // "required": true,
  39541. // "type": "string"
  39542. // },
  39543. // "reportId": {
  39544. // "description": "The ID of the report.",
  39545. // "format": "int64",
  39546. // "location": "path",
  39547. // "required": true,
  39548. // "type": "string"
  39549. // }
  39550. // },
  39551. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39552. // "request": {
  39553. // "$ref": "Report"
  39554. // },
  39555. // "response": {
  39556. // "$ref": "Report"
  39557. // },
  39558. // "scopes": [
  39559. // "https://www.googleapis.com/auth/dfareporting"
  39560. // ]
  39561. // }
  39562. }
  39563. // method id "dfareporting.reports.compatibleFields.query":
  39564. type ReportsCompatibleFieldsQueryCall struct {
  39565. s *Service
  39566. profileId int64
  39567. report *Report
  39568. urlParams_ gensupport.URLParams
  39569. ctx_ context.Context
  39570. header_ http.Header
  39571. }
  39572. // Query: Returns the fields that are compatible to be selected in the
  39573. // respective sections of a report criteria, given the fields already
  39574. // selected in the input report and user permissions.
  39575. func (r *ReportsCompatibleFieldsService) Query(profileId int64, report *Report) *ReportsCompatibleFieldsQueryCall {
  39576. c := &ReportsCompatibleFieldsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39577. c.profileId = profileId
  39578. c.report = report
  39579. return c
  39580. }
  39581. // Fields allows partial responses to be retrieved. See
  39582. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39583. // for more information.
  39584. func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall {
  39585. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39586. return c
  39587. }
  39588. // Context sets the context to be used in this call's Do method. Any
  39589. // pending HTTP request will be aborted if the provided context is
  39590. // canceled.
  39591. func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall {
  39592. c.ctx_ = ctx
  39593. return c
  39594. }
  39595. // Header returns an http.Header that can be modified by the caller to
  39596. // add HTTP headers to the request.
  39597. func (c *ReportsCompatibleFieldsQueryCall) Header() http.Header {
  39598. if c.header_ == nil {
  39599. c.header_ = make(http.Header)
  39600. }
  39601. return c.header_
  39602. }
  39603. func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, error) {
  39604. reqHeaders := make(http.Header)
  39605. for k, v := range c.header_ {
  39606. reqHeaders[k] = v
  39607. }
  39608. reqHeaders.Set("User-Agent", c.s.userAgent())
  39609. var body io.Reader = nil
  39610. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39611. if err != nil {
  39612. return nil, err
  39613. }
  39614. reqHeaders.Set("Content-Type", "application/json")
  39615. c.urlParams_.Set("alt", alt)
  39616. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query")
  39617. urls += "?" + c.urlParams_.Encode()
  39618. req, _ := http.NewRequest("POST", urls, body)
  39619. req.Header = reqHeaders
  39620. googleapi.Expand(req.URL, map[string]string{
  39621. "profileId": strconv.FormatInt(c.profileId, 10),
  39622. })
  39623. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39624. }
  39625. // Do executes the "dfareporting.reports.compatibleFields.query" call.
  39626. // Exactly one of *CompatibleFields or error will be non-nil. Any
  39627. // non-2xx status code is an error. Response headers are in either
  39628. // *CompatibleFields.ServerResponse.Header or (if a response was
  39629. // returned at all) in error.(*googleapi.Error).Header. Use
  39630. // googleapi.IsNotModified to check whether the returned error was
  39631. // because http.StatusNotModified was returned.
  39632. func (c *ReportsCompatibleFieldsQueryCall) Do(opts ...googleapi.CallOption) (*CompatibleFields, error) {
  39633. gensupport.SetOptions(c.urlParams_, opts...)
  39634. res, err := c.doRequest("json")
  39635. if res != nil && res.StatusCode == http.StatusNotModified {
  39636. if res.Body != nil {
  39637. res.Body.Close()
  39638. }
  39639. return nil, &googleapi.Error{
  39640. Code: res.StatusCode,
  39641. Header: res.Header,
  39642. }
  39643. }
  39644. if err != nil {
  39645. return nil, err
  39646. }
  39647. defer googleapi.CloseBody(res)
  39648. if err := googleapi.CheckResponse(res); err != nil {
  39649. return nil, err
  39650. }
  39651. ret := &CompatibleFields{
  39652. ServerResponse: googleapi.ServerResponse{
  39653. Header: res.Header,
  39654. HTTPStatusCode: res.StatusCode,
  39655. },
  39656. }
  39657. target := &ret
  39658. if err := gensupport.DecodeResponse(target, res); err != nil {
  39659. return nil, err
  39660. }
  39661. return ret, nil
  39662. // {
  39663. // "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.",
  39664. // "httpMethod": "POST",
  39665. // "id": "dfareporting.reports.compatibleFields.query",
  39666. // "parameterOrder": [
  39667. // "profileId"
  39668. // ],
  39669. // "parameters": {
  39670. // "profileId": {
  39671. // "description": "The DFA user profile ID.",
  39672. // "format": "int64",
  39673. // "location": "path",
  39674. // "required": true,
  39675. // "type": "string"
  39676. // }
  39677. // },
  39678. // "path": "userprofiles/{profileId}/reports/compatiblefields/query",
  39679. // "request": {
  39680. // "$ref": "Report"
  39681. // },
  39682. // "response": {
  39683. // "$ref": "CompatibleFields"
  39684. // },
  39685. // "scopes": [
  39686. // "https://www.googleapis.com/auth/dfareporting"
  39687. // ]
  39688. // }
  39689. }
  39690. // method id "dfareporting.reports.files.get":
  39691. type ReportsFilesGetCall struct {
  39692. s *Service
  39693. profileId int64
  39694. reportId int64
  39695. fileId int64
  39696. urlParams_ gensupport.URLParams
  39697. ifNoneMatch_ string
  39698. ctx_ context.Context
  39699. header_ http.Header
  39700. }
  39701. // Get: Retrieves a report file. This method supports media download.
  39702. func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall {
  39703. c := &ReportsFilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39704. c.profileId = profileId
  39705. c.reportId = reportId
  39706. c.fileId = fileId
  39707. return c
  39708. }
  39709. // Fields allows partial responses to be retrieved. See
  39710. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39711. // for more information.
  39712. func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall {
  39713. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39714. return c
  39715. }
  39716. // IfNoneMatch sets the optional parameter which makes the operation
  39717. // fail if the object's ETag matches the given value. This is useful for
  39718. // getting updates only after the object has changed since the last
  39719. // request. Use googleapi.IsNotModified to check whether the response
  39720. // error from Do is the result of In-None-Match.
  39721. func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall {
  39722. c.ifNoneMatch_ = entityTag
  39723. return c
  39724. }
  39725. // Context sets the context to be used in this call's Do and Download
  39726. // methods. Any pending HTTP request will be aborted if the provided
  39727. // context is canceled.
  39728. func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall {
  39729. c.ctx_ = ctx
  39730. return c
  39731. }
  39732. // Header returns an http.Header that can be modified by the caller to
  39733. // add HTTP headers to the request.
  39734. func (c *ReportsFilesGetCall) Header() http.Header {
  39735. if c.header_ == nil {
  39736. c.header_ = make(http.Header)
  39737. }
  39738. return c.header_
  39739. }
  39740. func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) {
  39741. reqHeaders := make(http.Header)
  39742. for k, v := range c.header_ {
  39743. reqHeaders[k] = v
  39744. }
  39745. reqHeaders.Set("User-Agent", c.s.userAgent())
  39746. if c.ifNoneMatch_ != "" {
  39747. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39748. }
  39749. var body io.Reader = nil
  39750. c.urlParams_.Set("alt", alt)
  39751. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}")
  39752. urls += "?" + c.urlParams_.Encode()
  39753. req, _ := http.NewRequest("GET", urls, body)
  39754. req.Header = reqHeaders
  39755. googleapi.Expand(req.URL, map[string]string{
  39756. "profileId": strconv.FormatInt(c.profileId, 10),
  39757. "reportId": strconv.FormatInt(c.reportId, 10),
  39758. "fileId": strconv.FormatInt(c.fileId, 10),
  39759. })
  39760. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39761. }
  39762. // Download fetches the API endpoint's "media" value, instead of the normal
  39763. // API response value. If the returned error is nil, the Response is guaranteed to
  39764. // have a 2xx status code. Callers must close the Response.Body as usual.
  39765. func (c *ReportsFilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  39766. gensupport.SetOptions(c.urlParams_, opts...)
  39767. res, err := c.doRequest("media")
  39768. if err != nil {
  39769. return nil, err
  39770. }
  39771. if err := googleapi.CheckMediaResponse(res); err != nil {
  39772. res.Body.Close()
  39773. return nil, err
  39774. }
  39775. return res, nil
  39776. }
  39777. // Do executes the "dfareporting.reports.files.get" call.
  39778. // Exactly one of *File or error will be non-nil. Any non-2xx status
  39779. // code is an error. Response headers are in either
  39780. // *File.ServerResponse.Header or (if a response was returned at all) in
  39781. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39782. // whether the returned error was because http.StatusNotModified was
  39783. // returned.
  39784. func (c *ReportsFilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  39785. gensupport.SetOptions(c.urlParams_, opts...)
  39786. res, err := c.doRequest("json")
  39787. if res != nil && res.StatusCode == http.StatusNotModified {
  39788. if res.Body != nil {
  39789. res.Body.Close()
  39790. }
  39791. return nil, &googleapi.Error{
  39792. Code: res.StatusCode,
  39793. Header: res.Header,
  39794. }
  39795. }
  39796. if err != nil {
  39797. return nil, err
  39798. }
  39799. defer googleapi.CloseBody(res)
  39800. if err := googleapi.CheckResponse(res); err != nil {
  39801. return nil, err
  39802. }
  39803. ret := &File{
  39804. ServerResponse: googleapi.ServerResponse{
  39805. Header: res.Header,
  39806. HTTPStatusCode: res.StatusCode,
  39807. },
  39808. }
  39809. target := &ret
  39810. if err := gensupport.DecodeResponse(target, res); err != nil {
  39811. return nil, err
  39812. }
  39813. return ret, nil
  39814. // {
  39815. // "description": "Retrieves a report file. This method supports media download.",
  39816. // "httpMethod": "GET",
  39817. // "id": "dfareporting.reports.files.get",
  39818. // "parameterOrder": [
  39819. // "profileId",
  39820. // "reportId",
  39821. // "fileId"
  39822. // ],
  39823. // "parameters": {
  39824. // "fileId": {
  39825. // "description": "The ID of the report file.",
  39826. // "format": "int64",
  39827. // "location": "path",
  39828. // "required": true,
  39829. // "type": "string"
  39830. // },
  39831. // "profileId": {
  39832. // "description": "The DFA profile ID.",
  39833. // "format": "int64",
  39834. // "location": "path",
  39835. // "required": true,
  39836. // "type": "string"
  39837. // },
  39838. // "reportId": {
  39839. // "description": "The ID of the report.",
  39840. // "format": "int64",
  39841. // "location": "path",
  39842. // "required": true,
  39843. // "type": "string"
  39844. // }
  39845. // },
  39846. // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}",
  39847. // "response": {
  39848. // "$ref": "File"
  39849. // },
  39850. // "scopes": [
  39851. // "https://www.googleapis.com/auth/dfareporting"
  39852. // ],
  39853. // "supportsMediaDownload": true
  39854. // }
  39855. }
  39856. // method id "dfareporting.reports.files.list":
  39857. type ReportsFilesListCall struct {
  39858. s *Service
  39859. profileId int64
  39860. reportId int64
  39861. urlParams_ gensupport.URLParams
  39862. ifNoneMatch_ string
  39863. ctx_ context.Context
  39864. header_ http.Header
  39865. }
  39866. // List: Lists files for a report.
  39867. func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall {
  39868. c := &ReportsFilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39869. c.profileId = profileId
  39870. c.reportId = reportId
  39871. return c
  39872. }
  39873. // MaxResults sets the optional parameter "maxResults": Maximum number
  39874. // of results to return.
  39875. func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall {
  39876. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39877. return c
  39878. }
  39879. // PageToken sets the optional parameter "pageToken": The value of the
  39880. // nextToken from the previous result page.
  39881. func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall {
  39882. c.urlParams_.Set("pageToken", pageToken)
  39883. return c
  39884. }
  39885. // SortField sets the optional parameter "sortField": The field by which
  39886. // to sort the list.
  39887. //
  39888. // Possible values:
  39889. // "ID" - Sort by file ID.
  39890. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  39891. func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall {
  39892. c.urlParams_.Set("sortField", sortField)
  39893. return c
  39894. }
  39895. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  39896. // results.
  39897. //
  39898. // Possible values:
  39899. // "ASCENDING" - Ascending order.
  39900. // "DESCENDING" (default) - Descending order.
  39901. func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall {
  39902. c.urlParams_.Set("sortOrder", sortOrder)
  39903. return c
  39904. }
  39905. // Fields allows partial responses to be retrieved. See
  39906. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39907. // for more information.
  39908. func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall {
  39909. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39910. return c
  39911. }
  39912. // IfNoneMatch sets the optional parameter which makes the operation
  39913. // fail if the object's ETag matches the given value. This is useful for
  39914. // getting updates only after the object has changed since the last
  39915. // request. Use googleapi.IsNotModified to check whether the response
  39916. // error from Do is the result of In-None-Match.
  39917. func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall {
  39918. c.ifNoneMatch_ = entityTag
  39919. return c
  39920. }
  39921. // Context sets the context to be used in this call's Do method. Any
  39922. // pending HTTP request will be aborted if the provided context is
  39923. // canceled.
  39924. func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall {
  39925. c.ctx_ = ctx
  39926. return c
  39927. }
  39928. // Header returns an http.Header that can be modified by the caller to
  39929. // add HTTP headers to the request.
  39930. func (c *ReportsFilesListCall) Header() http.Header {
  39931. if c.header_ == nil {
  39932. c.header_ = make(http.Header)
  39933. }
  39934. return c.header_
  39935. }
  39936. func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) {
  39937. reqHeaders := make(http.Header)
  39938. for k, v := range c.header_ {
  39939. reqHeaders[k] = v
  39940. }
  39941. reqHeaders.Set("User-Agent", c.s.userAgent())
  39942. if c.ifNoneMatch_ != "" {
  39943. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39944. }
  39945. var body io.Reader = nil
  39946. c.urlParams_.Set("alt", alt)
  39947. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files")
  39948. urls += "?" + c.urlParams_.Encode()
  39949. req, _ := http.NewRequest("GET", urls, body)
  39950. req.Header = reqHeaders
  39951. googleapi.Expand(req.URL, map[string]string{
  39952. "profileId": strconv.FormatInt(c.profileId, 10),
  39953. "reportId": strconv.FormatInt(c.reportId, 10),
  39954. })
  39955. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39956. }
  39957. // Do executes the "dfareporting.reports.files.list" call.
  39958. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  39959. // code is an error. Response headers are in either
  39960. // *FileList.ServerResponse.Header or (if a response was returned at
  39961. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39962. // to check whether the returned error was because
  39963. // http.StatusNotModified was returned.
  39964. func (c *ReportsFilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  39965. gensupport.SetOptions(c.urlParams_, opts...)
  39966. res, err := c.doRequest("json")
  39967. if res != nil && res.StatusCode == http.StatusNotModified {
  39968. if res.Body != nil {
  39969. res.Body.Close()
  39970. }
  39971. return nil, &googleapi.Error{
  39972. Code: res.StatusCode,
  39973. Header: res.Header,
  39974. }
  39975. }
  39976. if err != nil {
  39977. return nil, err
  39978. }
  39979. defer googleapi.CloseBody(res)
  39980. if err := googleapi.CheckResponse(res); err != nil {
  39981. return nil, err
  39982. }
  39983. ret := &FileList{
  39984. ServerResponse: googleapi.ServerResponse{
  39985. Header: res.Header,
  39986. HTTPStatusCode: res.StatusCode,
  39987. },
  39988. }
  39989. target := &ret
  39990. if err := gensupport.DecodeResponse(target, res); err != nil {
  39991. return nil, err
  39992. }
  39993. return ret, nil
  39994. // {
  39995. // "description": "Lists files for a report.",
  39996. // "httpMethod": "GET",
  39997. // "id": "dfareporting.reports.files.list",
  39998. // "parameterOrder": [
  39999. // "profileId",
  40000. // "reportId"
  40001. // ],
  40002. // "parameters": {
  40003. // "maxResults": {
  40004. // "default": "10",
  40005. // "description": "Maximum number of results to return.",
  40006. // "format": "int32",
  40007. // "location": "query",
  40008. // "maximum": "10",
  40009. // "minimum": "0",
  40010. // "type": "integer"
  40011. // },
  40012. // "pageToken": {
  40013. // "description": "The value of the nextToken from the previous result page.",
  40014. // "location": "query",
  40015. // "type": "string"
  40016. // },
  40017. // "profileId": {
  40018. // "description": "The DFA profile ID.",
  40019. // "format": "int64",
  40020. // "location": "path",
  40021. // "required": true,
  40022. // "type": "string"
  40023. // },
  40024. // "reportId": {
  40025. // "description": "The ID of the parent report.",
  40026. // "format": "int64",
  40027. // "location": "path",
  40028. // "required": true,
  40029. // "type": "string"
  40030. // },
  40031. // "sortField": {
  40032. // "default": "LAST_MODIFIED_TIME",
  40033. // "description": "The field by which to sort the list.",
  40034. // "enum": [
  40035. // "ID",
  40036. // "LAST_MODIFIED_TIME"
  40037. // ],
  40038. // "enumDescriptions": [
  40039. // "Sort by file ID.",
  40040. // "Sort by 'lastmodifiedAt' field."
  40041. // ],
  40042. // "location": "query",
  40043. // "type": "string"
  40044. // },
  40045. // "sortOrder": {
  40046. // "default": "DESCENDING",
  40047. // "description": "Order of sorted results.",
  40048. // "enum": [
  40049. // "ASCENDING",
  40050. // "DESCENDING"
  40051. // ],
  40052. // "enumDescriptions": [
  40053. // "Ascending order.",
  40054. // "Descending order."
  40055. // ],
  40056. // "location": "query",
  40057. // "type": "string"
  40058. // }
  40059. // },
  40060. // "path": "userprofiles/{profileId}/reports/{reportId}/files",
  40061. // "response": {
  40062. // "$ref": "FileList"
  40063. // },
  40064. // "scopes": [
  40065. // "https://www.googleapis.com/auth/dfareporting"
  40066. // ]
  40067. // }
  40068. }
  40069. // Pages invokes f for each page of results.
  40070. // A non-nil error returned from f will halt the iteration.
  40071. // The provided context supersedes any context provided to the Context method.
  40072. func (c *ReportsFilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  40073. c.ctx_ = ctx
  40074. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40075. for {
  40076. x, err := c.Do()
  40077. if err != nil {
  40078. return err
  40079. }
  40080. if err := f(x); err != nil {
  40081. return err
  40082. }
  40083. if x.NextPageToken == "" {
  40084. return nil
  40085. }
  40086. c.PageToken(x.NextPageToken)
  40087. }
  40088. }
  40089. // method id "dfareporting.sites.get":
  40090. type SitesGetCall struct {
  40091. s *Service
  40092. profileId int64
  40093. id int64
  40094. urlParams_ gensupport.URLParams
  40095. ifNoneMatch_ string
  40096. ctx_ context.Context
  40097. header_ http.Header
  40098. }
  40099. // Get: Gets one site by ID.
  40100. func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall {
  40101. c := &SitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40102. c.profileId = profileId
  40103. c.id = id
  40104. return c
  40105. }
  40106. // Fields allows partial responses to be retrieved. See
  40107. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40108. // for more information.
  40109. func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall {
  40110. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40111. return c
  40112. }
  40113. // IfNoneMatch sets the optional parameter which makes the operation
  40114. // fail if the object's ETag matches the given value. This is useful for
  40115. // getting updates only after the object has changed since the last
  40116. // request. Use googleapi.IsNotModified to check whether the response
  40117. // error from Do is the result of In-None-Match.
  40118. func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall {
  40119. c.ifNoneMatch_ = entityTag
  40120. return c
  40121. }
  40122. // Context sets the context to be used in this call's Do method. Any
  40123. // pending HTTP request will be aborted if the provided context is
  40124. // canceled.
  40125. func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall {
  40126. c.ctx_ = ctx
  40127. return c
  40128. }
  40129. // Header returns an http.Header that can be modified by the caller to
  40130. // add HTTP headers to the request.
  40131. func (c *SitesGetCall) Header() http.Header {
  40132. if c.header_ == nil {
  40133. c.header_ = make(http.Header)
  40134. }
  40135. return c.header_
  40136. }
  40137. func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) {
  40138. reqHeaders := make(http.Header)
  40139. for k, v := range c.header_ {
  40140. reqHeaders[k] = v
  40141. }
  40142. reqHeaders.Set("User-Agent", c.s.userAgent())
  40143. if c.ifNoneMatch_ != "" {
  40144. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40145. }
  40146. var body io.Reader = nil
  40147. c.urlParams_.Set("alt", alt)
  40148. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}")
  40149. urls += "?" + c.urlParams_.Encode()
  40150. req, _ := http.NewRequest("GET", urls, body)
  40151. req.Header = reqHeaders
  40152. googleapi.Expand(req.URL, map[string]string{
  40153. "profileId": strconv.FormatInt(c.profileId, 10),
  40154. "id": strconv.FormatInt(c.id, 10),
  40155. })
  40156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40157. }
  40158. // Do executes the "dfareporting.sites.get" call.
  40159. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40160. // code is an error. Response headers are in either
  40161. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40162. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40163. // whether the returned error was because http.StatusNotModified was
  40164. // returned.
  40165. func (c *SitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40166. gensupport.SetOptions(c.urlParams_, opts...)
  40167. res, err := c.doRequest("json")
  40168. if res != nil && res.StatusCode == http.StatusNotModified {
  40169. if res.Body != nil {
  40170. res.Body.Close()
  40171. }
  40172. return nil, &googleapi.Error{
  40173. Code: res.StatusCode,
  40174. Header: res.Header,
  40175. }
  40176. }
  40177. if err != nil {
  40178. return nil, err
  40179. }
  40180. defer googleapi.CloseBody(res)
  40181. if err := googleapi.CheckResponse(res); err != nil {
  40182. return nil, err
  40183. }
  40184. ret := &Site{
  40185. ServerResponse: googleapi.ServerResponse{
  40186. Header: res.Header,
  40187. HTTPStatusCode: res.StatusCode,
  40188. },
  40189. }
  40190. target := &ret
  40191. if err := gensupport.DecodeResponse(target, res); err != nil {
  40192. return nil, err
  40193. }
  40194. return ret, nil
  40195. // {
  40196. // "description": "Gets one site by ID.",
  40197. // "httpMethod": "GET",
  40198. // "id": "dfareporting.sites.get",
  40199. // "parameterOrder": [
  40200. // "profileId",
  40201. // "id"
  40202. // ],
  40203. // "parameters": {
  40204. // "id": {
  40205. // "description": "Site ID.",
  40206. // "format": "int64",
  40207. // "location": "path",
  40208. // "required": true,
  40209. // "type": "string"
  40210. // },
  40211. // "profileId": {
  40212. // "description": "User profile ID associated with this request.",
  40213. // "format": "int64",
  40214. // "location": "path",
  40215. // "required": true,
  40216. // "type": "string"
  40217. // }
  40218. // },
  40219. // "path": "userprofiles/{profileId}/sites/{id}",
  40220. // "response": {
  40221. // "$ref": "Site"
  40222. // },
  40223. // "scopes": [
  40224. // "https://www.googleapis.com/auth/dfatrafficking"
  40225. // ]
  40226. // }
  40227. }
  40228. // method id "dfareporting.sites.insert":
  40229. type SitesInsertCall struct {
  40230. s *Service
  40231. profileId int64
  40232. site *Site
  40233. urlParams_ gensupport.URLParams
  40234. ctx_ context.Context
  40235. header_ http.Header
  40236. }
  40237. // Insert: Inserts a new site.
  40238. func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall {
  40239. c := &SitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40240. c.profileId = profileId
  40241. c.site = site
  40242. return c
  40243. }
  40244. // Fields allows partial responses to be retrieved. See
  40245. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40246. // for more information.
  40247. func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall {
  40248. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40249. return c
  40250. }
  40251. // Context sets the context to be used in this call's Do method. Any
  40252. // pending HTTP request will be aborted if the provided context is
  40253. // canceled.
  40254. func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall {
  40255. c.ctx_ = ctx
  40256. return c
  40257. }
  40258. // Header returns an http.Header that can be modified by the caller to
  40259. // add HTTP headers to the request.
  40260. func (c *SitesInsertCall) Header() http.Header {
  40261. if c.header_ == nil {
  40262. c.header_ = make(http.Header)
  40263. }
  40264. return c.header_
  40265. }
  40266. func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) {
  40267. reqHeaders := make(http.Header)
  40268. for k, v := range c.header_ {
  40269. reqHeaders[k] = v
  40270. }
  40271. reqHeaders.Set("User-Agent", c.s.userAgent())
  40272. var body io.Reader = nil
  40273. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  40274. if err != nil {
  40275. return nil, err
  40276. }
  40277. reqHeaders.Set("Content-Type", "application/json")
  40278. c.urlParams_.Set("alt", alt)
  40279. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40280. urls += "?" + c.urlParams_.Encode()
  40281. req, _ := http.NewRequest("POST", urls, body)
  40282. req.Header = reqHeaders
  40283. googleapi.Expand(req.URL, map[string]string{
  40284. "profileId": strconv.FormatInt(c.profileId, 10),
  40285. })
  40286. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40287. }
  40288. // Do executes the "dfareporting.sites.insert" call.
  40289. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40290. // code is an error. Response headers are in either
  40291. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40292. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40293. // whether the returned error was because http.StatusNotModified was
  40294. // returned.
  40295. func (c *SitesInsertCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40296. gensupport.SetOptions(c.urlParams_, opts...)
  40297. res, err := c.doRequest("json")
  40298. if res != nil && res.StatusCode == http.StatusNotModified {
  40299. if res.Body != nil {
  40300. res.Body.Close()
  40301. }
  40302. return nil, &googleapi.Error{
  40303. Code: res.StatusCode,
  40304. Header: res.Header,
  40305. }
  40306. }
  40307. if err != nil {
  40308. return nil, err
  40309. }
  40310. defer googleapi.CloseBody(res)
  40311. if err := googleapi.CheckResponse(res); err != nil {
  40312. return nil, err
  40313. }
  40314. ret := &Site{
  40315. ServerResponse: googleapi.ServerResponse{
  40316. Header: res.Header,
  40317. HTTPStatusCode: res.StatusCode,
  40318. },
  40319. }
  40320. target := &ret
  40321. if err := gensupport.DecodeResponse(target, res); err != nil {
  40322. return nil, err
  40323. }
  40324. return ret, nil
  40325. // {
  40326. // "description": "Inserts a new site.",
  40327. // "httpMethod": "POST",
  40328. // "id": "dfareporting.sites.insert",
  40329. // "parameterOrder": [
  40330. // "profileId"
  40331. // ],
  40332. // "parameters": {
  40333. // "profileId": {
  40334. // "description": "User profile ID associated with this request.",
  40335. // "format": "int64",
  40336. // "location": "path",
  40337. // "required": true,
  40338. // "type": "string"
  40339. // }
  40340. // },
  40341. // "path": "userprofiles/{profileId}/sites",
  40342. // "request": {
  40343. // "$ref": "Site"
  40344. // },
  40345. // "response": {
  40346. // "$ref": "Site"
  40347. // },
  40348. // "scopes": [
  40349. // "https://www.googleapis.com/auth/dfatrafficking"
  40350. // ]
  40351. // }
  40352. }
  40353. // method id "dfareporting.sites.list":
  40354. type SitesListCall struct {
  40355. s *Service
  40356. profileId int64
  40357. urlParams_ gensupport.URLParams
  40358. ifNoneMatch_ string
  40359. ctx_ context.Context
  40360. header_ http.Header
  40361. }
  40362. // List: Retrieves a list of sites, possibly filtered. This method
  40363. // supports paging.
  40364. func (r *SitesService) List(profileId int64) *SitesListCall {
  40365. c := &SitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40366. c.profileId = profileId
  40367. return c
  40368. }
  40369. // AcceptsInStreamVideoPlacements sets the optional parameter
  40370. // "acceptsInStreamVideoPlacements": This search filter is no longer
  40371. // supported and will have no effect on the results returned.
  40372. func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall {
  40373. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  40374. return c
  40375. }
  40376. // AcceptsInterstitialPlacements sets the optional parameter
  40377. // "acceptsInterstitialPlacements": This search filter is no longer
  40378. // supported and will have no effect on the results returned.
  40379. func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall {
  40380. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  40381. return c
  40382. }
  40383. // AcceptsPublisherPaidPlacements sets the optional parameter
  40384. // "acceptsPublisherPaidPlacements": Select only sites that accept
  40385. // publisher paid placements.
  40386. func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall {
  40387. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  40388. return c
  40389. }
  40390. // AdWordsSite sets the optional parameter "adWordsSite": Select only
  40391. // AdWords sites.
  40392. func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall {
  40393. c.urlParams_.Set("adWordsSite", fmt.Sprint(adWordsSite))
  40394. return c
  40395. }
  40396. // Approved sets the optional parameter "approved": Select only approved
  40397. // sites.
  40398. func (c *SitesListCall) Approved(approved bool) *SitesListCall {
  40399. c.urlParams_.Set("approved", fmt.Sprint(approved))
  40400. return c
  40401. }
  40402. // CampaignIds sets the optional parameter "campaignIds": Select only
  40403. // sites with these campaign IDs.
  40404. func (c *SitesListCall) CampaignIds(campaignIds ...int64) *SitesListCall {
  40405. var campaignIds_ []string
  40406. for _, v := range campaignIds {
  40407. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  40408. }
  40409. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  40410. return c
  40411. }
  40412. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  40413. // Select only sites with these directory site IDs.
  40414. func (c *SitesListCall) DirectorySiteIds(directorySiteIds ...int64) *SitesListCall {
  40415. var directorySiteIds_ []string
  40416. for _, v := range directorySiteIds {
  40417. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  40418. }
  40419. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  40420. return c
  40421. }
  40422. // Ids sets the optional parameter "ids": Select only sites with these
  40423. // IDs.
  40424. func (c *SitesListCall) Ids(ids ...int64) *SitesListCall {
  40425. var ids_ []string
  40426. for _, v := range ids {
  40427. ids_ = append(ids_, fmt.Sprint(v))
  40428. }
  40429. c.urlParams_.SetMulti("ids", ids_)
  40430. return c
  40431. }
  40432. // MaxResults sets the optional parameter "maxResults": Maximum number
  40433. // of results to return.
  40434. func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall {
  40435. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40436. return c
  40437. }
  40438. // PageToken sets the optional parameter "pageToken": Value of the
  40439. // nextPageToken from the previous result page.
  40440. func (c *SitesListCall) PageToken(pageToken string) *SitesListCall {
  40441. c.urlParams_.Set("pageToken", pageToken)
  40442. return c
  40443. }
  40444. // SearchString sets the optional parameter "searchString": Allows
  40445. // searching for objects by name, ID or keyName. Wildcards (*) are
  40446. // allowed. For example, "site*2015" will return objects with names like
  40447. // "site June 2015", "site April 2015", or simply "site 2015". Most of
  40448. // the searches also add wildcards implicitly at the start and the end
  40449. // of the search string. For example, a search string of "site" will
  40450. // match objects with name "my site", "site 2015", or simply "site".
  40451. func (c *SitesListCall) SearchString(searchString string) *SitesListCall {
  40452. c.urlParams_.Set("searchString", searchString)
  40453. return c
  40454. }
  40455. // SortField sets the optional parameter "sortField": Field by which to
  40456. // sort the list.
  40457. //
  40458. // Possible values:
  40459. // "ID" (default)
  40460. // "NAME"
  40461. func (c *SitesListCall) SortField(sortField string) *SitesListCall {
  40462. c.urlParams_.Set("sortField", sortField)
  40463. return c
  40464. }
  40465. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  40466. // results.
  40467. //
  40468. // Possible values:
  40469. // "ASCENDING" (default)
  40470. // "DESCENDING"
  40471. func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall {
  40472. c.urlParams_.Set("sortOrder", sortOrder)
  40473. return c
  40474. }
  40475. // SubaccountId sets the optional parameter "subaccountId": Select only
  40476. // sites with this subaccount ID.
  40477. func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall {
  40478. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  40479. return c
  40480. }
  40481. // UnmappedSite sets the optional parameter "unmappedSite": Select only
  40482. // sites that have not been mapped to a directory site.
  40483. func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall {
  40484. c.urlParams_.Set("unmappedSite", fmt.Sprint(unmappedSite))
  40485. return c
  40486. }
  40487. // Fields allows partial responses to be retrieved. See
  40488. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40489. // for more information.
  40490. func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall {
  40491. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40492. return c
  40493. }
  40494. // IfNoneMatch sets the optional parameter which makes the operation
  40495. // fail if the object's ETag matches the given value. This is useful for
  40496. // getting updates only after the object has changed since the last
  40497. // request. Use googleapi.IsNotModified to check whether the response
  40498. // error from Do is the result of In-None-Match.
  40499. func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall {
  40500. c.ifNoneMatch_ = entityTag
  40501. return c
  40502. }
  40503. // Context sets the context to be used in this call's Do method. Any
  40504. // pending HTTP request will be aborted if the provided context is
  40505. // canceled.
  40506. func (c *SitesListCall) Context(ctx context.Context) *SitesListCall {
  40507. c.ctx_ = ctx
  40508. return c
  40509. }
  40510. // Header returns an http.Header that can be modified by the caller to
  40511. // add HTTP headers to the request.
  40512. func (c *SitesListCall) Header() http.Header {
  40513. if c.header_ == nil {
  40514. c.header_ = make(http.Header)
  40515. }
  40516. return c.header_
  40517. }
  40518. func (c *SitesListCall) doRequest(alt string) (*http.Response, error) {
  40519. reqHeaders := make(http.Header)
  40520. for k, v := range c.header_ {
  40521. reqHeaders[k] = v
  40522. }
  40523. reqHeaders.Set("User-Agent", c.s.userAgent())
  40524. if c.ifNoneMatch_ != "" {
  40525. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40526. }
  40527. var body io.Reader = nil
  40528. c.urlParams_.Set("alt", alt)
  40529. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40530. urls += "?" + c.urlParams_.Encode()
  40531. req, _ := http.NewRequest("GET", urls, body)
  40532. req.Header = reqHeaders
  40533. googleapi.Expand(req.URL, map[string]string{
  40534. "profileId": strconv.FormatInt(c.profileId, 10),
  40535. })
  40536. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40537. }
  40538. // Do executes the "dfareporting.sites.list" call.
  40539. // Exactly one of *SitesListResponse or error will be non-nil. Any
  40540. // non-2xx status code is an error. Response headers are in either
  40541. // *SitesListResponse.ServerResponse.Header or (if a response was
  40542. // returned at all) in error.(*googleapi.Error).Header. Use
  40543. // googleapi.IsNotModified to check whether the returned error was
  40544. // because http.StatusNotModified was returned.
  40545. func (c *SitesListCall) Do(opts ...googleapi.CallOption) (*SitesListResponse, error) {
  40546. gensupport.SetOptions(c.urlParams_, opts...)
  40547. res, err := c.doRequest("json")
  40548. if res != nil && res.StatusCode == http.StatusNotModified {
  40549. if res.Body != nil {
  40550. res.Body.Close()
  40551. }
  40552. return nil, &googleapi.Error{
  40553. Code: res.StatusCode,
  40554. Header: res.Header,
  40555. }
  40556. }
  40557. if err != nil {
  40558. return nil, err
  40559. }
  40560. defer googleapi.CloseBody(res)
  40561. if err := googleapi.CheckResponse(res); err != nil {
  40562. return nil, err
  40563. }
  40564. ret := &SitesListResponse{
  40565. ServerResponse: googleapi.ServerResponse{
  40566. Header: res.Header,
  40567. HTTPStatusCode: res.StatusCode,
  40568. },
  40569. }
  40570. target := &ret
  40571. if err := gensupport.DecodeResponse(target, res); err != nil {
  40572. return nil, err
  40573. }
  40574. return ret, nil
  40575. // {
  40576. // "description": "Retrieves a list of sites, possibly filtered. This method supports paging.",
  40577. // "httpMethod": "GET",
  40578. // "id": "dfareporting.sites.list",
  40579. // "parameterOrder": [
  40580. // "profileId"
  40581. // ],
  40582. // "parameters": {
  40583. // "acceptsInStreamVideoPlacements": {
  40584. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  40585. // "location": "query",
  40586. // "type": "boolean"
  40587. // },
  40588. // "acceptsInterstitialPlacements": {
  40589. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  40590. // "location": "query",
  40591. // "type": "boolean"
  40592. // },
  40593. // "acceptsPublisherPaidPlacements": {
  40594. // "description": "Select only sites that accept publisher paid placements.",
  40595. // "location": "query",
  40596. // "type": "boolean"
  40597. // },
  40598. // "adWordsSite": {
  40599. // "description": "Select only AdWords sites.",
  40600. // "location": "query",
  40601. // "type": "boolean"
  40602. // },
  40603. // "approved": {
  40604. // "description": "Select only approved sites.",
  40605. // "location": "query",
  40606. // "type": "boolean"
  40607. // },
  40608. // "campaignIds": {
  40609. // "description": "Select only sites with these campaign IDs.",
  40610. // "format": "int64",
  40611. // "location": "query",
  40612. // "repeated": true,
  40613. // "type": "string"
  40614. // },
  40615. // "directorySiteIds": {
  40616. // "description": "Select only sites with these directory site IDs.",
  40617. // "format": "int64",
  40618. // "location": "query",
  40619. // "repeated": true,
  40620. // "type": "string"
  40621. // },
  40622. // "ids": {
  40623. // "description": "Select only sites with these IDs.",
  40624. // "format": "int64",
  40625. // "location": "query",
  40626. // "repeated": true,
  40627. // "type": "string"
  40628. // },
  40629. // "maxResults": {
  40630. // "default": "1000",
  40631. // "description": "Maximum number of results to return.",
  40632. // "format": "int32",
  40633. // "location": "query",
  40634. // "maximum": "1000",
  40635. // "minimum": "0",
  40636. // "type": "integer"
  40637. // },
  40638. // "pageToken": {
  40639. // "description": "Value of the nextPageToken from the previous result page.",
  40640. // "location": "query",
  40641. // "type": "string"
  40642. // },
  40643. // "profileId": {
  40644. // "description": "User profile ID associated with this request.",
  40645. // "format": "int64",
  40646. // "location": "path",
  40647. // "required": true,
  40648. // "type": "string"
  40649. // },
  40650. // "searchString": {
  40651. // "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\".",
  40652. // "location": "query",
  40653. // "type": "string"
  40654. // },
  40655. // "sortField": {
  40656. // "default": "ID",
  40657. // "description": "Field by which to sort the list.",
  40658. // "enum": [
  40659. // "ID",
  40660. // "NAME"
  40661. // ],
  40662. // "enumDescriptions": [
  40663. // "",
  40664. // ""
  40665. // ],
  40666. // "location": "query",
  40667. // "type": "string"
  40668. // },
  40669. // "sortOrder": {
  40670. // "default": "ASCENDING",
  40671. // "description": "Order of sorted results.",
  40672. // "enum": [
  40673. // "ASCENDING",
  40674. // "DESCENDING"
  40675. // ],
  40676. // "enumDescriptions": [
  40677. // "",
  40678. // ""
  40679. // ],
  40680. // "location": "query",
  40681. // "type": "string"
  40682. // },
  40683. // "subaccountId": {
  40684. // "description": "Select only sites with this subaccount ID.",
  40685. // "format": "int64",
  40686. // "location": "query",
  40687. // "type": "string"
  40688. // },
  40689. // "unmappedSite": {
  40690. // "description": "Select only sites that have not been mapped to a directory site.",
  40691. // "location": "query",
  40692. // "type": "boolean"
  40693. // }
  40694. // },
  40695. // "path": "userprofiles/{profileId}/sites",
  40696. // "response": {
  40697. // "$ref": "SitesListResponse"
  40698. // },
  40699. // "scopes": [
  40700. // "https://www.googleapis.com/auth/dfatrafficking"
  40701. // ]
  40702. // }
  40703. }
  40704. // Pages invokes f for each page of results.
  40705. // A non-nil error returned from f will halt the iteration.
  40706. // The provided context supersedes any context provided to the Context method.
  40707. func (c *SitesListCall) Pages(ctx context.Context, f func(*SitesListResponse) error) error {
  40708. c.ctx_ = ctx
  40709. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40710. for {
  40711. x, err := c.Do()
  40712. if err != nil {
  40713. return err
  40714. }
  40715. if err := f(x); err != nil {
  40716. return err
  40717. }
  40718. if x.NextPageToken == "" {
  40719. return nil
  40720. }
  40721. c.PageToken(x.NextPageToken)
  40722. }
  40723. }
  40724. // method id "dfareporting.sites.patch":
  40725. type SitesPatchCall struct {
  40726. s *Service
  40727. profileId int64
  40728. site *Site
  40729. urlParams_ gensupport.URLParams
  40730. ctx_ context.Context
  40731. header_ http.Header
  40732. }
  40733. // Patch: Updates an existing site. This method supports patch
  40734. // semantics.
  40735. func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall {
  40736. c := &SitesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40737. c.profileId = profileId
  40738. c.urlParams_.Set("id", fmt.Sprint(id))
  40739. c.site = site
  40740. return c
  40741. }
  40742. // Fields allows partial responses to be retrieved. See
  40743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40744. // for more information.
  40745. func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall {
  40746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40747. return c
  40748. }
  40749. // Context sets the context to be used in this call's Do method. Any
  40750. // pending HTTP request will be aborted if the provided context is
  40751. // canceled.
  40752. func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall {
  40753. c.ctx_ = ctx
  40754. return c
  40755. }
  40756. // Header returns an http.Header that can be modified by the caller to
  40757. // add HTTP headers to the request.
  40758. func (c *SitesPatchCall) Header() http.Header {
  40759. if c.header_ == nil {
  40760. c.header_ = make(http.Header)
  40761. }
  40762. return c.header_
  40763. }
  40764. func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) {
  40765. reqHeaders := make(http.Header)
  40766. for k, v := range c.header_ {
  40767. reqHeaders[k] = v
  40768. }
  40769. reqHeaders.Set("User-Agent", c.s.userAgent())
  40770. var body io.Reader = nil
  40771. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  40772. if err != nil {
  40773. return nil, err
  40774. }
  40775. reqHeaders.Set("Content-Type", "application/json")
  40776. c.urlParams_.Set("alt", alt)
  40777. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40778. urls += "?" + c.urlParams_.Encode()
  40779. req, _ := http.NewRequest("PATCH", urls, body)
  40780. req.Header = reqHeaders
  40781. googleapi.Expand(req.URL, map[string]string{
  40782. "profileId": strconv.FormatInt(c.profileId, 10),
  40783. })
  40784. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40785. }
  40786. // Do executes the "dfareporting.sites.patch" call.
  40787. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40788. // code is an error. Response headers are in either
  40789. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40790. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40791. // whether the returned error was because http.StatusNotModified was
  40792. // returned.
  40793. func (c *SitesPatchCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40794. gensupport.SetOptions(c.urlParams_, opts...)
  40795. res, err := c.doRequest("json")
  40796. if res != nil && res.StatusCode == http.StatusNotModified {
  40797. if res.Body != nil {
  40798. res.Body.Close()
  40799. }
  40800. return nil, &googleapi.Error{
  40801. Code: res.StatusCode,
  40802. Header: res.Header,
  40803. }
  40804. }
  40805. if err != nil {
  40806. return nil, err
  40807. }
  40808. defer googleapi.CloseBody(res)
  40809. if err := googleapi.CheckResponse(res); err != nil {
  40810. return nil, err
  40811. }
  40812. ret := &Site{
  40813. ServerResponse: googleapi.ServerResponse{
  40814. Header: res.Header,
  40815. HTTPStatusCode: res.StatusCode,
  40816. },
  40817. }
  40818. target := &ret
  40819. if err := gensupport.DecodeResponse(target, res); err != nil {
  40820. return nil, err
  40821. }
  40822. return ret, nil
  40823. // {
  40824. // "description": "Updates an existing site. This method supports patch semantics.",
  40825. // "httpMethod": "PATCH",
  40826. // "id": "dfareporting.sites.patch",
  40827. // "parameterOrder": [
  40828. // "profileId",
  40829. // "id"
  40830. // ],
  40831. // "parameters": {
  40832. // "id": {
  40833. // "description": "Site ID.",
  40834. // "format": "int64",
  40835. // "location": "query",
  40836. // "required": true,
  40837. // "type": "string"
  40838. // },
  40839. // "profileId": {
  40840. // "description": "User profile ID associated with this request.",
  40841. // "format": "int64",
  40842. // "location": "path",
  40843. // "required": true,
  40844. // "type": "string"
  40845. // }
  40846. // },
  40847. // "path": "userprofiles/{profileId}/sites",
  40848. // "request": {
  40849. // "$ref": "Site"
  40850. // },
  40851. // "response": {
  40852. // "$ref": "Site"
  40853. // },
  40854. // "scopes": [
  40855. // "https://www.googleapis.com/auth/dfatrafficking"
  40856. // ]
  40857. // }
  40858. }
  40859. // method id "dfareporting.sites.update":
  40860. type SitesUpdateCall struct {
  40861. s *Service
  40862. profileId int64
  40863. site *Site
  40864. urlParams_ gensupport.URLParams
  40865. ctx_ context.Context
  40866. header_ http.Header
  40867. }
  40868. // Update: Updates an existing site.
  40869. func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall {
  40870. c := &SitesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40871. c.profileId = profileId
  40872. c.site = site
  40873. return c
  40874. }
  40875. // Fields allows partial responses to be retrieved. See
  40876. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40877. // for more information.
  40878. func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall {
  40879. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40880. return c
  40881. }
  40882. // Context sets the context to be used in this call's Do method. Any
  40883. // pending HTTP request will be aborted if the provided context is
  40884. // canceled.
  40885. func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall {
  40886. c.ctx_ = ctx
  40887. return c
  40888. }
  40889. // Header returns an http.Header that can be modified by the caller to
  40890. // add HTTP headers to the request.
  40891. func (c *SitesUpdateCall) Header() http.Header {
  40892. if c.header_ == nil {
  40893. c.header_ = make(http.Header)
  40894. }
  40895. return c.header_
  40896. }
  40897. func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) {
  40898. reqHeaders := make(http.Header)
  40899. for k, v := range c.header_ {
  40900. reqHeaders[k] = v
  40901. }
  40902. reqHeaders.Set("User-Agent", c.s.userAgent())
  40903. var body io.Reader = nil
  40904. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  40905. if err != nil {
  40906. return nil, err
  40907. }
  40908. reqHeaders.Set("Content-Type", "application/json")
  40909. c.urlParams_.Set("alt", alt)
  40910. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40911. urls += "?" + c.urlParams_.Encode()
  40912. req, _ := http.NewRequest("PUT", urls, body)
  40913. req.Header = reqHeaders
  40914. googleapi.Expand(req.URL, map[string]string{
  40915. "profileId": strconv.FormatInt(c.profileId, 10),
  40916. })
  40917. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40918. }
  40919. // Do executes the "dfareporting.sites.update" call.
  40920. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40921. // code is an error. Response headers are in either
  40922. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40923. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40924. // whether the returned error was because http.StatusNotModified was
  40925. // returned.
  40926. func (c *SitesUpdateCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40927. gensupport.SetOptions(c.urlParams_, opts...)
  40928. res, err := c.doRequest("json")
  40929. if res != nil && res.StatusCode == http.StatusNotModified {
  40930. if res.Body != nil {
  40931. res.Body.Close()
  40932. }
  40933. return nil, &googleapi.Error{
  40934. Code: res.StatusCode,
  40935. Header: res.Header,
  40936. }
  40937. }
  40938. if err != nil {
  40939. return nil, err
  40940. }
  40941. defer googleapi.CloseBody(res)
  40942. if err := googleapi.CheckResponse(res); err != nil {
  40943. return nil, err
  40944. }
  40945. ret := &Site{
  40946. ServerResponse: googleapi.ServerResponse{
  40947. Header: res.Header,
  40948. HTTPStatusCode: res.StatusCode,
  40949. },
  40950. }
  40951. target := &ret
  40952. if err := gensupport.DecodeResponse(target, res); err != nil {
  40953. return nil, err
  40954. }
  40955. return ret, nil
  40956. // {
  40957. // "description": "Updates an existing site.",
  40958. // "httpMethod": "PUT",
  40959. // "id": "dfareporting.sites.update",
  40960. // "parameterOrder": [
  40961. // "profileId"
  40962. // ],
  40963. // "parameters": {
  40964. // "profileId": {
  40965. // "description": "User profile ID associated with this request.",
  40966. // "format": "int64",
  40967. // "location": "path",
  40968. // "required": true,
  40969. // "type": "string"
  40970. // }
  40971. // },
  40972. // "path": "userprofiles/{profileId}/sites",
  40973. // "request": {
  40974. // "$ref": "Site"
  40975. // },
  40976. // "response": {
  40977. // "$ref": "Site"
  40978. // },
  40979. // "scopes": [
  40980. // "https://www.googleapis.com/auth/dfatrafficking"
  40981. // ]
  40982. // }
  40983. }
  40984. // method id "dfareporting.sizes.get":
  40985. type SizesGetCall struct {
  40986. s *Service
  40987. profileId int64
  40988. id int64
  40989. urlParams_ gensupport.URLParams
  40990. ifNoneMatch_ string
  40991. ctx_ context.Context
  40992. header_ http.Header
  40993. }
  40994. // Get: Gets one size by ID.
  40995. func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall {
  40996. c := &SizesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40997. c.profileId = profileId
  40998. c.id = id
  40999. return c
  41000. }
  41001. // Fields allows partial responses to be retrieved. See
  41002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41003. // for more information.
  41004. func (c *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall {
  41005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41006. return c
  41007. }
  41008. // IfNoneMatch sets the optional parameter which makes the operation
  41009. // fail if the object's ETag matches the given value. This is useful for
  41010. // getting updates only after the object has changed since the last
  41011. // request. Use googleapi.IsNotModified to check whether the response
  41012. // error from Do is the result of In-None-Match.
  41013. func (c *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall {
  41014. c.ifNoneMatch_ = entityTag
  41015. return c
  41016. }
  41017. // Context sets the context to be used in this call's Do method. Any
  41018. // pending HTTP request will be aborted if the provided context is
  41019. // canceled.
  41020. func (c *SizesGetCall) Context(ctx context.Context) *SizesGetCall {
  41021. c.ctx_ = ctx
  41022. return c
  41023. }
  41024. // Header returns an http.Header that can be modified by the caller to
  41025. // add HTTP headers to the request.
  41026. func (c *SizesGetCall) Header() http.Header {
  41027. if c.header_ == nil {
  41028. c.header_ = make(http.Header)
  41029. }
  41030. return c.header_
  41031. }
  41032. func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) {
  41033. reqHeaders := make(http.Header)
  41034. for k, v := range c.header_ {
  41035. reqHeaders[k] = v
  41036. }
  41037. reqHeaders.Set("User-Agent", c.s.userAgent())
  41038. if c.ifNoneMatch_ != "" {
  41039. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41040. }
  41041. var body io.Reader = nil
  41042. c.urlParams_.Set("alt", alt)
  41043. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes/{id}")
  41044. urls += "?" + c.urlParams_.Encode()
  41045. req, _ := http.NewRequest("GET", urls, body)
  41046. req.Header = reqHeaders
  41047. googleapi.Expand(req.URL, map[string]string{
  41048. "profileId": strconv.FormatInt(c.profileId, 10),
  41049. "id": strconv.FormatInt(c.id, 10),
  41050. })
  41051. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41052. }
  41053. // Do executes the "dfareporting.sizes.get" call.
  41054. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  41055. // code is an error. Response headers are in either
  41056. // *Size.ServerResponse.Header or (if a response was returned at all) in
  41057. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41058. // whether the returned error was because http.StatusNotModified was
  41059. // returned.
  41060. func (c *SizesGetCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  41061. gensupport.SetOptions(c.urlParams_, opts...)
  41062. res, err := c.doRequest("json")
  41063. if res != nil && res.StatusCode == http.StatusNotModified {
  41064. if res.Body != nil {
  41065. res.Body.Close()
  41066. }
  41067. return nil, &googleapi.Error{
  41068. Code: res.StatusCode,
  41069. Header: res.Header,
  41070. }
  41071. }
  41072. if err != nil {
  41073. return nil, err
  41074. }
  41075. defer googleapi.CloseBody(res)
  41076. if err := googleapi.CheckResponse(res); err != nil {
  41077. return nil, err
  41078. }
  41079. ret := &Size{
  41080. ServerResponse: googleapi.ServerResponse{
  41081. Header: res.Header,
  41082. HTTPStatusCode: res.StatusCode,
  41083. },
  41084. }
  41085. target := &ret
  41086. if err := gensupport.DecodeResponse(target, res); err != nil {
  41087. return nil, err
  41088. }
  41089. return ret, nil
  41090. // {
  41091. // "description": "Gets one size by ID.",
  41092. // "httpMethod": "GET",
  41093. // "id": "dfareporting.sizes.get",
  41094. // "parameterOrder": [
  41095. // "profileId",
  41096. // "id"
  41097. // ],
  41098. // "parameters": {
  41099. // "id": {
  41100. // "description": "Size ID.",
  41101. // "format": "int64",
  41102. // "location": "path",
  41103. // "required": true,
  41104. // "type": "string"
  41105. // },
  41106. // "profileId": {
  41107. // "description": "User profile ID associated with this request.",
  41108. // "format": "int64",
  41109. // "location": "path",
  41110. // "required": true,
  41111. // "type": "string"
  41112. // }
  41113. // },
  41114. // "path": "userprofiles/{profileId}/sizes/{id}",
  41115. // "response": {
  41116. // "$ref": "Size"
  41117. // },
  41118. // "scopes": [
  41119. // "https://www.googleapis.com/auth/dfatrafficking"
  41120. // ]
  41121. // }
  41122. }
  41123. // method id "dfareporting.sizes.insert":
  41124. type SizesInsertCall struct {
  41125. s *Service
  41126. profileId int64
  41127. size *Size
  41128. urlParams_ gensupport.URLParams
  41129. ctx_ context.Context
  41130. header_ http.Header
  41131. }
  41132. // Insert: Inserts a new size.
  41133. func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall {
  41134. c := &SizesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41135. c.profileId = profileId
  41136. c.size = size
  41137. return c
  41138. }
  41139. // Fields allows partial responses to be retrieved. See
  41140. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41141. // for more information.
  41142. func (c *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall {
  41143. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41144. return c
  41145. }
  41146. // Context sets the context to be used in this call's Do method. Any
  41147. // pending HTTP request will be aborted if the provided context is
  41148. // canceled.
  41149. func (c *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall {
  41150. c.ctx_ = ctx
  41151. return c
  41152. }
  41153. // Header returns an http.Header that can be modified by the caller to
  41154. // add HTTP headers to the request.
  41155. func (c *SizesInsertCall) Header() http.Header {
  41156. if c.header_ == nil {
  41157. c.header_ = make(http.Header)
  41158. }
  41159. return c.header_
  41160. }
  41161. func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) {
  41162. reqHeaders := make(http.Header)
  41163. for k, v := range c.header_ {
  41164. reqHeaders[k] = v
  41165. }
  41166. reqHeaders.Set("User-Agent", c.s.userAgent())
  41167. var body io.Reader = nil
  41168. body, err := googleapi.WithoutDataWrapper.JSONReader(c.size)
  41169. if err != nil {
  41170. return nil, err
  41171. }
  41172. reqHeaders.Set("Content-Type", "application/json")
  41173. c.urlParams_.Set("alt", alt)
  41174. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  41175. urls += "?" + c.urlParams_.Encode()
  41176. req, _ := http.NewRequest("POST", urls, body)
  41177. req.Header = reqHeaders
  41178. googleapi.Expand(req.URL, map[string]string{
  41179. "profileId": strconv.FormatInt(c.profileId, 10),
  41180. })
  41181. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41182. }
  41183. // Do executes the "dfareporting.sizes.insert" call.
  41184. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  41185. // code is an error. Response headers are in either
  41186. // *Size.ServerResponse.Header or (if a response was returned at all) in
  41187. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  41188. // whether the returned error was because http.StatusNotModified was
  41189. // returned.
  41190. func (c *SizesInsertCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  41191. gensupport.SetOptions(c.urlParams_, opts...)
  41192. res, err := c.doRequest("json")
  41193. if res != nil && res.StatusCode == http.StatusNotModified {
  41194. if res.Body != nil {
  41195. res.Body.Close()
  41196. }
  41197. return nil, &googleapi.Error{
  41198. Code: res.StatusCode,
  41199. Header: res.Header,
  41200. }
  41201. }
  41202. if err != nil {
  41203. return nil, err
  41204. }
  41205. defer googleapi.CloseBody(res)
  41206. if err := googleapi.CheckResponse(res); err != nil {
  41207. return nil, err
  41208. }
  41209. ret := &Size{
  41210. ServerResponse: googleapi.ServerResponse{
  41211. Header: res.Header,
  41212. HTTPStatusCode: res.StatusCode,
  41213. },
  41214. }
  41215. target := &ret
  41216. if err := gensupport.DecodeResponse(target, res); err != nil {
  41217. return nil, err
  41218. }
  41219. return ret, nil
  41220. // {
  41221. // "description": "Inserts a new size.",
  41222. // "httpMethod": "POST",
  41223. // "id": "dfareporting.sizes.insert",
  41224. // "parameterOrder": [
  41225. // "profileId"
  41226. // ],
  41227. // "parameters": {
  41228. // "profileId": {
  41229. // "description": "User profile ID associated with this request.",
  41230. // "format": "int64",
  41231. // "location": "path",
  41232. // "required": true,
  41233. // "type": "string"
  41234. // }
  41235. // },
  41236. // "path": "userprofiles/{profileId}/sizes",
  41237. // "request": {
  41238. // "$ref": "Size"
  41239. // },
  41240. // "response": {
  41241. // "$ref": "Size"
  41242. // },
  41243. // "scopes": [
  41244. // "https://www.googleapis.com/auth/dfatrafficking"
  41245. // ]
  41246. // }
  41247. }
  41248. // method id "dfareporting.sizes.list":
  41249. type SizesListCall struct {
  41250. s *Service
  41251. profileId int64
  41252. urlParams_ gensupport.URLParams
  41253. ifNoneMatch_ string
  41254. ctx_ context.Context
  41255. header_ http.Header
  41256. }
  41257. // List: Retrieves a list of sizes, possibly filtered. Retrieved sizes
  41258. // are globally unique and may include values not currently in use by
  41259. // your account. Due to this, the list of sizes returned by this method
  41260. // may differ from the list seen in the Trafficking UI.
  41261. func (r *SizesService) List(profileId int64) *SizesListCall {
  41262. c := &SizesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41263. c.profileId = profileId
  41264. return c
  41265. }
  41266. // Height sets the optional parameter "height": Select only sizes with
  41267. // this height.
  41268. func (c *SizesListCall) Height(height int64) *SizesListCall {
  41269. c.urlParams_.Set("height", fmt.Sprint(height))
  41270. return c
  41271. }
  41272. // IabStandard sets the optional parameter "iabStandard": Select only
  41273. // IAB standard sizes.
  41274. func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall {
  41275. c.urlParams_.Set("iabStandard", fmt.Sprint(iabStandard))
  41276. return c
  41277. }
  41278. // Ids sets the optional parameter "ids": Select only sizes with these
  41279. // IDs.
  41280. func (c *SizesListCall) Ids(ids ...int64) *SizesListCall {
  41281. var ids_ []string
  41282. for _, v := range ids {
  41283. ids_ = append(ids_, fmt.Sprint(v))
  41284. }
  41285. c.urlParams_.SetMulti("ids", ids_)
  41286. return c
  41287. }
  41288. // Width sets the optional parameter "width": Select only sizes with
  41289. // this width.
  41290. func (c *SizesListCall) Width(width int64) *SizesListCall {
  41291. c.urlParams_.Set("width", fmt.Sprint(width))
  41292. return c
  41293. }
  41294. // Fields allows partial responses to be retrieved. See
  41295. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41296. // for more information.
  41297. func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall {
  41298. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41299. return c
  41300. }
  41301. // IfNoneMatch sets the optional parameter which makes the operation
  41302. // fail if the object's ETag matches the given value. This is useful for
  41303. // getting updates only after the object has changed since the last
  41304. // request. Use googleapi.IsNotModified to check whether the response
  41305. // error from Do is the result of In-None-Match.
  41306. func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall {
  41307. c.ifNoneMatch_ = entityTag
  41308. return c
  41309. }
  41310. // Context sets the context to be used in this call's Do method. Any
  41311. // pending HTTP request will be aborted if the provided context is
  41312. // canceled.
  41313. func (c *SizesListCall) Context(ctx context.Context) *SizesListCall {
  41314. c.ctx_ = ctx
  41315. return c
  41316. }
  41317. // Header returns an http.Header that can be modified by the caller to
  41318. // add HTTP headers to the request.
  41319. func (c *SizesListCall) Header() http.Header {
  41320. if c.header_ == nil {
  41321. c.header_ = make(http.Header)
  41322. }
  41323. return c.header_
  41324. }
  41325. func (c *SizesListCall) doRequest(alt string) (*http.Response, error) {
  41326. reqHeaders := make(http.Header)
  41327. for k, v := range c.header_ {
  41328. reqHeaders[k] = v
  41329. }
  41330. reqHeaders.Set("User-Agent", c.s.userAgent())
  41331. if c.ifNoneMatch_ != "" {
  41332. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41333. }
  41334. var body io.Reader = nil
  41335. c.urlParams_.Set("alt", alt)
  41336. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  41337. urls += "?" + c.urlParams_.Encode()
  41338. req, _ := http.NewRequest("GET", urls, body)
  41339. req.Header = reqHeaders
  41340. googleapi.Expand(req.URL, map[string]string{
  41341. "profileId": strconv.FormatInt(c.profileId, 10),
  41342. })
  41343. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41344. }
  41345. // Do executes the "dfareporting.sizes.list" call.
  41346. // Exactly one of *SizesListResponse or error will be non-nil. Any
  41347. // non-2xx status code is an error. Response headers are in either
  41348. // *SizesListResponse.ServerResponse.Header or (if a response was
  41349. // returned at all) in error.(*googleapi.Error).Header. Use
  41350. // googleapi.IsNotModified to check whether the returned error was
  41351. // because http.StatusNotModified was returned.
  41352. func (c *SizesListCall) Do(opts ...googleapi.CallOption) (*SizesListResponse, error) {
  41353. gensupport.SetOptions(c.urlParams_, opts...)
  41354. res, err := c.doRequest("json")
  41355. if res != nil && res.StatusCode == http.StatusNotModified {
  41356. if res.Body != nil {
  41357. res.Body.Close()
  41358. }
  41359. return nil, &googleapi.Error{
  41360. Code: res.StatusCode,
  41361. Header: res.Header,
  41362. }
  41363. }
  41364. if err != nil {
  41365. return nil, err
  41366. }
  41367. defer googleapi.CloseBody(res)
  41368. if err := googleapi.CheckResponse(res); err != nil {
  41369. return nil, err
  41370. }
  41371. ret := &SizesListResponse{
  41372. ServerResponse: googleapi.ServerResponse{
  41373. Header: res.Header,
  41374. HTTPStatusCode: res.StatusCode,
  41375. },
  41376. }
  41377. target := &ret
  41378. if err := gensupport.DecodeResponse(target, res); err != nil {
  41379. return nil, err
  41380. }
  41381. return ret, nil
  41382. // {
  41383. // "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.",
  41384. // "httpMethod": "GET",
  41385. // "id": "dfareporting.sizes.list",
  41386. // "parameterOrder": [
  41387. // "profileId"
  41388. // ],
  41389. // "parameters": {
  41390. // "height": {
  41391. // "description": "Select only sizes with this height.",
  41392. // "format": "int32",
  41393. // "location": "query",
  41394. // "maximum": "32767",
  41395. // "minimum": "0",
  41396. // "type": "integer"
  41397. // },
  41398. // "iabStandard": {
  41399. // "description": "Select only IAB standard sizes.",
  41400. // "location": "query",
  41401. // "type": "boolean"
  41402. // },
  41403. // "ids": {
  41404. // "description": "Select only sizes with these IDs.",
  41405. // "format": "int64",
  41406. // "location": "query",
  41407. // "repeated": true,
  41408. // "type": "string"
  41409. // },
  41410. // "profileId": {
  41411. // "description": "User profile ID associated with this request.",
  41412. // "format": "int64",
  41413. // "location": "path",
  41414. // "required": true,
  41415. // "type": "string"
  41416. // },
  41417. // "width": {
  41418. // "description": "Select only sizes with this width.",
  41419. // "format": "int32",
  41420. // "location": "query",
  41421. // "maximum": "32767",
  41422. // "minimum": "0",
  41423. // "type": "integer"
  41424. // }
  41425. // },
  41426. // "path": "userprofiles/{profileId}/sizes",
  41427. // "response": {
  41428. // "$ref": "SizesListResponse"
  41429. // },
  41430. // "scopes": [
  41431. // "https://www.googleapis.com/auth/dfatrafficking"
  41432. // ]
  41433. // }
  41434. }
  41435. // method id "dfareporting.subaccounts.get":
  41436. type SubaccountsGetCall struct {
  41437. s *Service
  41438. profileId int64
  41439. id int64
  41440. urlParams_ gensupport.URLParams
  41441. ifNoneMatch_ string
  41442. ctx_ context.Context
  41443. header_ http.Header
  41444. }
  41445. // Get: Gets one subaccount by ID.
  41446. func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall {
  41447. c := &SubaccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41448. c.profileId = profileId
  41449. c.id = id
  41450. return c
  41451. }
  41452. // Fields allows partial responses to be retrieved. See
  41453. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41454. // for more information.
  41455. func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall {
  41456. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41457. return c
  41458. }
  41459. // IfNoneMatch sets the optional parameter which makes the operation
  41460. // fail if the object's ETag matches the given value. This is useful for
  41461. // getting updates only after the object has changed since the last
  41462. // request. Use googleapi.IsNotModified to check whether the response
  41463. // error from Do is the result of In-None-Match.
  41464. func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall {
  41465. c.ifNoneMatch_ = entityTag
  41466. return c
  41467. }
  41468. // Context sets the context to be used in this call's Do method. Any
  41469. // pending HTTP request will be aborted if the provided context is
  41470. // canceled.
  41471. func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall {
  41472. c.ctx_ = ctx
  41473. return c
  41474. }
  41475. // Header returns an http.Header that can be modified by the caller to
  41476. // add HTTP headers to the request.
  41477. func (c *SubaccountsGetCall) Header() http.Header {
  41478. if c.header_ == nil {
  41479. c.header_ = make(http.Header)
  41480. }
  41481. return c.header_
  41482. }
  41483. func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) {
  41484. reqHeaders := make(http.Header)
  41485. for k, v := range c.header_ {
  41486. reqHeaders[k] = v
  41487. }
  41488. reqHeaders.Set("User-Agent", c.s.userAgent())
  41489. if c.ifNoneMatch_ != "" {
  41490. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41491. }
  41492. var body io.Reader = nil
  41493. c.urlParams_.Set("alt", alt)
  41494. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}")
  41495. urls += "?" + c.urlParams_.Encode()
  41496. req, _ := http.NewRequest("GET", urls, body)
  41497. req.Header = reqHeaders
  41498. googleapi.Expand(req.URL, map[string]string{
  41499. "profileId": strconv.FormatInt(c.profileId, 10),
  41500. "id": strconv.FormatInt(c.id, 10),
  41501. })
  41502. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41503. }
  41504. // Do executes the "dfareporting.subaccounts.get" call.
  41505. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  41506. // status code is an error. Response headers are in either
  41507. // *Subaccount.ServerResponse.Header or (if a response was returned at
  41508. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41509. // to check whether the returned error was because
  41510. // http.StatusNotModified was returned.
  41511. func (c *SubaccountsGetCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  41512. gensupport.SetOptions(c.urlParams_, opts...)
  41513. res, err := c.doRequest("json")
  41514. if res != nil && res.StatusCode == http.StatusNotModified {
  41515. if res.Body != nil {
  41516. res.Body.Close()
  41517. }
  41518. return nil, &googleapi.Error{
  41519. Code: res.StatusCode,
  41520. Header: res.Header,
  41521. }
  41522. }
  41523. if err != nil {
  41524. return nil, err
  41525. }
  41526. defer googleapi.CloseBody(res)
  41527. if err := googleapi.CheckResponse(res); err != nil {
  41528. return nil, err
  41529. }
  41530. ret := &Subaccount{
  41531. ServerResponse: googleapi.ServerResponse{
  41532. Header: res.Header,
  41533. HTTPStatusCode: res.StatusCode,
  41534. },
  41535. }
  41536. target := &ret
  41537. if err := gensupport.DecodeResponse(target, res); err != nil {
  41538. return nil, err
  41539. }
  41540. return ret, nil
  41541. // {
  41542. // "description": "Gets one subaccount by ID.",
  41543. // "httpMethod": "GET",
  41544. // "id": "dfareporting.subaccounts.get",
  41545. // "parameterOrder": [
  41546. // "profileId",
  41547. // "id"
  41548. // ],
  41549. // "parameters": {
  41550. // "id": {
  41551. // "description": "Subaccount ID.",
  41552. // "format": "int64",
  41553. // "location": "path",
  41554. // "required": true,
  41555. // "type": "string"
  41556. // },
  41557. // "profileId": {
  41558. // "description": "User profile ID associated with this request.",
  41559. // "format": "int64",
  41560. // "location": "path",
  41561. // "required": true,
  41562. // "type": "string"
  41563. // }
  41564. // },
  41565. // "path": "userprofiles/{profileId}/subaccounts/{id}",
  41566. // "response": {
  41567. // "$ref": "Subaccount"
  41568. // },
  41569. // "scopes": [
  41570. // "https://www.googleapis.com/auth/dfatrafficking"
  41571. // ]
  41572. // }
  41573. }
  41574. // method id "dfareporting.subaccounts.insert":
  41575. type SubaccountsInsertCall struct {
  41576. s *Service
  41577. profileId int64
  41578. subaccount *Subaccount
  41579. urlParams_ gensupport.URLParams
  41580. ctx_ context.Context
  41581. header_ http.Header
  41582. }
  41583. // Insert: Inserts a new subaccount.
  41584. func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall {
  41585. c := &SubaccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41586. c.profileId = profileId
  41587. c.subaccount = subaccount
  41588. return c
  41589. }
  41590. // Fields allows partial responses to be retrieved. See
  41591. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41592. // for more information.
  41593. func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall {
  41594. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41595. return c
  41596. }
  41597. // Context sets the context to be used in this call's Do method. Any
  41598. // pending HTTP request will be aborted if the provided context is
  41599. // canceled.
  41600. func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall {
  41601. c.ctx_ = ctx
  41602. return c
  41603. }
  41604. // Header returns an http.Header that can be modified by the caller to
  41605. // add HTTP headers to the request.
  41606. func (c *SubaccountsInsertCall) Header() http.Header {
  41607. if c.header_ == nil {
  41608. c.header_ = make(http.Header)
  41609. }
  41610. return c.header_
  41611. }
  41612. func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  41613. reqHeaders := make(http.Header)
  41614. for k, v := range c.header_ {
  41615. reqHeaders[k] = v
  41616. }
  41617. reqHeaders.Set("User-Agent", c.s.userAgent())
  41618. var body io.Reader = nil
  41619. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  41620. if err != nil {
  41621. return nil, err
  41622. }
  41623. reqHeaders.Set("Content-Type", "application/json")
  41624. c.urlParams_.Set("alt", alt)
  41625. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  41626. urls += "?" + c.urlParams_.Encode()
  41627. req, _ := http.NewRequest("POST", urls, body)
  41628. req.Header = reqHeaders
  41629. googleapi.Expand(req.URL, map[string]string{
  41630. "profileId": strconv.FormatInt(c.profileId, 10),
  41631. })
  41632. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41633. }
  41634. // Do executes the "dfareporting.subaccounts.insert" call.
  41635. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  41636. // status code is an error. Response headers are in either
  41637. // *Subaccount.ServerResponse.Header or (if a response was returned at
  41638. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41639. // to check whether the returned error was because
  41640. // http.StatusNotModified was returned.
  41641. func (c *SubaccountsInsertCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  41642. gensupport.SetOptions(c.urlParams_, opts...)
  41643. res, err := c.doRequest("json")
  41644. if res != nil && res.StatusCode == http.StatusNotModified {
  41645. if res.Body != nil {
  41646. res.Body.Close()
  41647. }
  41648. return nil, &googleapi.Error{
  41649. Code: res.StatusCode,
  41650. Header: res.Header,
  41651. }
  41652. }
  41653. if err != nil {
  41654. return nil, err
  41655. }
  41656. defer googleapi.CloseBody(res)
  41657. if err := googleapi.CheckResponse(res); err != nil {
  41658. return nil, err
  41659. }
  41660. ret := &Subaccount{
  41661. ServerResponse: googleapi.ServerResponse{
  41662. Header: res.Header,
  41663. HTTPStatusCode: res.StatusCode,
  41664. },
  41665. }
  41666. target := &ret
  41667. if err := gensupport.DecodeResponse(target, res); err != nil {
  41668. return nil, err
  41669. }
  41670. return ret, nil
  41671. // {
  41672. // "description": "Inserts a new subaccount.",
  41673. // "httpMethod": "POST",
  41674. // "id": "dfareporting.subaccounts.insert",
  41675. // "parameterOrder": [
  41676. // "profileId"
  41677. // ],
  41678. // "parameters": {
  41679. // "profileId": {
  41680. // "description": "User profile ID associated with this request.",
  41681. // "format": "int64",
  41682. // "location": "path",
  41683. // "required": true,
  41684. // "type": "string"
  41685. // }
  41686. // },
  41687. // "path": "userprofiles/{profileId}/subaccounts",
  41688. // "request": {
  41689. // "$ref": "Subaccount"
  41690. // },
  41691. // "response": {
  41692. // "$ref": "Subaccount"
  41693. // },
  41694. // "scopes": [
  41695. // "https://www.googleapis.com/auth/dfatrafficking"
  41696. // ]
  41697. // }
  41698. }
  41699. // method id "dfareporting.subaccounts.list":
  41700. type SubaccountsListCall struct {
  41701. s *Service
  41702. profileId int64
  41703. urlParams_ gensupport.URLParams
  41704. ifNoneMatch_ string
  41705. ctx_ context.Context
  41706. header_ http.Header
  41707. }
  41708. // List: Gets a list of subaccounts, possibly filtered. This method
  41709. // supports paging.
  41710. func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall {
  41711. c := &SubaccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41712. c.profileId = profileId
  41713. return c
  41714. }
  41715. // Ids sets the optional parameter "ids": Select only subaccounts with
  41716. // these IDs.
  41717. func (c *SubaccountsListCall) Ids(ids ...int64) *SubaccountsListCall {
  41718. var ids_ []string
  41719. for _, v := range ids {
  41720. ids_ = append(ids_, fmt.Sprint(v))
  41721. }
  41722. c.urlParams_.SetMulti("ids", ids_)
  41723. return c
  41724. }
  41725. // MaxResults sets the optional parameter "maxResults": Maximum number
  41726. // of results to return.
  41727. func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall {
  41728. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41729. return c
  41730. }
  41731. // PageToken sets the optional parameter "pageToken": Value of the
  41732. // nextPageToken from the previous result page.
  41733. func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall {
  41734. c.urlParams_.Set("pageToken", pageToken)
  41735. return c
  41736. }
  41737. // SearchString sets the optional parameter "searchString": Allows
  41738. // searching for objects by name or ID. Wildcards (*) are allowed. For
  41739. // example, "subaccount*2015" will return objects with names like
  41740. // "subaccount June 2015", "subaccount April 2015", or simply
  41741. // "subaccount 2015". Most of the searches also add wildcards implicitly
  41742. // at the start and the end of the search string. For example, a search
  41743. // string of "subaccount" will match objects with name "my subaccount",
  41744. // "subaccount 2015", or simply "subaccount".
  41745. func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall {
  41746. c.urlParams_.Set("searchString", searchString)
  41747. return c
  41748. }
  41749. // SortField sets the optional parameter "sortField": Field by which to
  41750. // sort the list.
  41751. //
  41752. // Possible values:
  41753. // "ID" (default)
  41754. // "NAME"
  41755. func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall {
  41756. c.urlParams_.Set("sortField", sortField)
  41757. return c
  41758. }
  41759. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  41760. // results.
  41761. //
  41762. // Possible values:
  41763. // "ASCENDING" (default)
  41764. // "DESCENDING"
  41765. func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall {
  41766. c.urlParams_.Set("sortOrder", sortOrder)
  41767. return c
  41768. }
  41769. // Fields allows partial responses to be retrieved. See
  41770. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41771. // for more information.
  41772. func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall {
  41773. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41774. return c
  41775. }
  41776. // IfNoneMatch sets the optional parameter which makes the operation
  41777. // fail if the object's ETag matches the given value. This is useful for
  41778. // getting updates only after the object has changed since the last
  41779. // request. Use googleapi.IsNotModified to check whether the response
  41780. // error from Do is the result of In-None-Match.
  41781. func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall {
  41782. c.ifNoneMatch_ = entityTag
  41783. return c
  41784. }
  41785. // Context sets the context to be used in this call's Do method. Any
  41786. // pending HTTP request will be aborted if the provided context is
  41787. // canceled.
  41788. func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall {
  41789. c.ctx_ = ctx
  41790. return c
  41791. }
  41792. // Header returns an http.Header that can be modified by the caller to
  41793. // add HTTP headers to the request.
  41794. func (c *SubaccountsListCall) Header() http.Header {
  41795. if c.header_ == nil {
  41796. c.header_ = make(http.Header)
  41797. }
  41798. return c.header_
  41799. }
  41800. func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) {
  41801. reqHeaders := make(http.Header)
  41802. for k, v := range c.header_ {
  41803. reqHeaders[k] = v
  41804. }
  41805. reqHeaders.Set("User-Agent", c.s.userAgent())
  41806. if c.ifNoneMatch_ != "" {
  41807. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41808. }
  41809. var body io.Reader = nil
  41810. c.urlParams_.Set("alt", alt)
  41811. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  41812. urls += "?" + c.urlParams_.Encode()
  41813. req, _ := http.NewRequest("GET", urls, body)
  41814. req.Header = reqHeaders
  41815. googleapi.Expand(req.URL, map[string]string{
  41816. "profileId": strconv.FormatInt(c.profileId, 10),
  41817. })
  41818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41819. }
  41820. // Do executes the "dfareporting.subaccounts.list" call.
  41821. // Exactly one of *SubaccountsListResponse or error will be non-nil. Any
  41822. // non-2xx status code is an error. Response headers are in either
  41823. // *SubaccountsListResponse.ServerResponse.Header or (if a response was
  41824. // returned at all) in error.(*googleapi.Error).Header. Use
  41825. // googleapi.IsNotModified to check whether the returned error was
  41826. // because http.StatusNotModified was returned.
  41827. func (c *SubaccountsListCall) Do(opts ...googleapi.CallOption) (*SubaccountsListResponse, error) {
  41828. gensupport.SetOptions(c.urlParams_, opts...)
  41829. res, err := c.doRequest("json")
  41830. if res != nil && res.StatusCode == http.StatusNotModified {
  41831. if res.Body != nil {
  41832. res.Body.Close()
  41833. }
  41834. return nil, &googleapi.Error{
  41835. Code: res.StatusCode,
  41836. Header: res.Header,
  41837. }
  41838. }
  41839. if err != nil {
  41840. return nil, err
  41841. }
  41842. defer googleapi.CloseBody(res)
  41843. if err := googleapi.CheckResponse(res); err != nil {
  41844. return nil, err
  41845. }
  41846. ret := &SubaccountsListResponse{
  41847. ServerResponse: googleapi.ServerResponse{
  41848. Header: res.Header,
  41849. HTTPStatusCode: res.StatusCode,
  41850. },
  41851. }
  41852. target := &ret
  41853. if err := gensupport.DecodeResponse(target, res); err != nil {
  41854. return nil, err
  41855. }
  41856. return ret, nil
  41857. // {
  41858. // "description": "Gets a list of subaccounts, possibly filtered. This method supports paging.",
  41859. // "httpMethod": "GET",
  41860. // "id": "dfareporting.subaccounts.list",
  41861. // "parameterOrder": [
  41862. // "profileId"
  41863. // ],
  41864. // "parameters": {
  41865. // "ids": {
  41866. // "description": "Select only subaccounts with these IDs.",
  41867. // "format": "int64",
  41868. // "location": "query",
  41869. // "repeated": true,
  41870. // "type": "string"
  41871. // },
  41872. // "maxResults": {
  41873. // "default": "1000",
  41874. // "description": "Maximum number of results to return.",
  41875. // "format": "int32",
  41876. // "location": "query",
  41877. // "maximum": "1000",
  41878. // "minimum": "0",
  41879. // "type": "integer"
  41880. // },
  41881. // "pageToken": {
  41882. // "description": "Value of the nextPageToken from the previous result page.",
  41883. // "location": "query",
  41884. // "type": "string"
  41885. // },
  41886. // "profileId": {
  41887. // "description": "User profile ID associated with this request.",
  41888. // "format": "int64",
  41889. // "location": "path",
  41890. // "required": true,
  41891. // "type": "string"
  41892. // },
  41893. // "searchString": {
  41894. // "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\".",
  41895. // "location": "query",
  41896. // "type": "string"
  41897. // },
  41898. // "sortField": {
  41899. // "default": "ID",
  41900. // "description": "Field by which to sort the list.",
  41901. // "enum": [
  41902. // "ID",
  41903. // "NAME"
  41904. // ],
  41905. // "enumDescriptions": [
  41906. // "",
  41907. // ""
  41908. // ],
  41909. // "location": "query",
  41910. // "type": "string"
  41911. // },
  41912. // "sortOrder": {
  41913. // "default": "ASCENDING",
  41914. // "description": "Order of sorted results.",
  41915. // "enum": [
  41916. // "ASCENDING",
  41917. // "DESCENDING"
  41918. // ],
  41919. // "enumDescriptions": [
  41920. // "",
  41921. // ""
  41922. // ],
  41923. // "location": "query",
  41924. // "type": "string"
  41925. // }
  41926. // },
  41927. // "path": "userprofiles/{profileId}/subaccounts",
  41928. // "response": {
  41929. // "$ref": "SubaccountsListResponse"
  41930. // },
  41931. // "scopes": [
  41932. // "https://www.googleapis.com/auth/dfatrafficking"
  41933. // ]
  41934. // }
  41935. }
  41936. // Pages invokes f for each page of results.
  41937. // A non-nil error returned from f will halt the iteration.
  41938. // The provided context supersedes any context provided to the Context method.
  41939. func (c *SubaccountsListCall) Pages(ctx context.Context, f func(*SubaccountsListResponse) error) error {
  41940. c.ctx_ = ctx
  41941. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41942. for {
  41943. x, err := c.Do()
  41944. if err != nil {
  41945. return err
  41946. }
  41947. if err := f(x); err != nil {
  41948. return err
  41949. }
  41950. if x.NextPageToken == "" {
  41951. return nil
  41952. }
  41953. c.PageToken(x.NextPageToken)
  41954. }
  41955. }
  41956. // method id "dfareporting.subaccounts.patch":
  41957. type SubaccountsPatchCall struct {
  41958. s *Service
  41959. profileId int64
  41960. subaccount *Subaccount
  41961. urlParams_ gensupport.URLParams
  41962. ctx_ context.Context
  41963. header_ http.Header
  41964. }
  41965. // Patch: Updates an existing subaccount. This method supports patch
  41966. // semantics.
  41967. func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall {
  41968. c := &SubaccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41969. c.profileId = profileId
  41970. c.urlParams_.Set("id", fmt.Sprint(id))
  41971. c.subaccount = subaccount
  41972. return c
  41973. }
  41974. // Fields allows partial responses to be retrieved. See
  41975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41976. // for more information.
  41977. func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall {
  41978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41979. return c
  41980. }
  41981. // Context sets the context to be used in this call's Do method. Any
  41982. // pending HTTP request will be aborted if the provided context is
  41983. // canceled.
  41984. func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall {
  41985. c.ctx_ = ctx
  41986. return c
  41987. }
  41988. // Header returns an http.Header that can be modified by the caller to
  41989. // add HTTP headers to the request.
  41990. func (c *SubaccountsPatchCall) Header() http.Header {
  41991. if c.header_ == nil {
  41992. c.header_ = make(http.Header)
  41993. }
  41994. return c.header_
  41995. }
  41996. func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  41997. reqHeaders := make(http.Header)
  41998. for k, v := range c.header_ {
  41999. reqHeaders[k] = v
  42000. }
  42001. reqHeaders.Set("User-Agent", c.s.userAgent())
  42002. var body io.Reader = nil
  42003. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42004. if err != nil {
  42005. return nil, err
  42006. }
  42007. reqHeaders.Set("Content-Type", "application/json")
  42008. c.urlParams_.Set("alt", alt)
  42009. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42010. urls += "?" + c.urlParams_.Encode()
  42011. req, _ := http.NewRequest("PATCH", urls, body)
  42012. req.Header = reqHeaders
  42013. googleapi.Expand(req.URL, map[string]string{
  42014. "profileId": strconv.FormatInt(c.profileId, 10),
  42015. })
  42016. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42017. }
  42018. // Do executes the "dfareporting.subaccounts.patch" call.
  42019. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42020. // status code is an error. Response headers are in either
  42021. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42022. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42023. // to check whether the returned error was because
  42024. // http.StatusNotModified was returned.
  42025. func (c *SubaccountsPatchCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42026. gensupport.SetOptions(c.urlParams_, opts...)
  42027. res, err := c.doRequest("json")
  42028. if res != nil && res.StatusCode == http.StatusNotModified {
  42029. if res.Body != nil {
  42030. res.Body.Close()
  42031. }
  42032. return nil, &googleapi.Error{
  42033. Code: res.StatusCode,
  42034. Header: res.Header,
  42035. }
  42036. }
  42037. if err != nil {
  42038. return nil, err
  42039. }
  42040. defer googleapi.CloseBody(res)
  42041. if err := googleapi.CheckResponse(res); err != nil {
  42042. return nil, err
  42043. }
  42044. ret := &Subaccount{
  42045. ServerResponse: googleapi.ServerResponse{
  42046. Header: res.Header,
  42047. HTTPStatusCode: res.StatusCode,
  42048. },
  42049. }
  42050. target := &ret
  42051. if err := gensupport.DecodeResponse(target, res); err != nil {
  42052. return nil, err
  42053. }
  42054. return ret, nil
  42055. // {
  42056. // "description": "Updates an existing subaccount. This method supports patch semantics.",
  42057. // "httpMethod": "PATCH",
  42058. // "id": "dfareporting.subaccounts.patch",
  42059. // "parameterOrder": [
  42060. // "profileId",
  42061. // "id"
  42062. // ],
  42063. // "parameters": {
  42064. // "id": {
  42065. // "description": "Subaccount ID.",
  42066. // "format": "int64",
  42067. // "location": "query",
  42068. // "required": true,
  42069. // "type": "string"
  42070. // },
  42071. // "profileId": {
  42072. // "description": "User profile ID associated with this request.",
  42073. // "format": "int64",
  42074. // "location": "path",
  42075. // "required": true,
  42076. // "type": "string"
  42077. // }
  42078. // },
  42079. // "path": "userprofiles/{profileId}/subaccounts",
  42080. // "request": {
  42081. // "$ref": "Subaccount"
  42082. // },
  42083. // "response": {
  42084. // "$ref": "Subaccount"
  42085. // },
  42086. // "scopes": [
  42087. // "https://www.googleapis.com/auth/dfatrafficking"
  42088. // ]
  42089. // }
  42090. }
  42091. // method id "dfareporting.subaccounts.update":
  42092. type SubaccountsUpdateCall struct {
  42093. s *Service
  42094. profileId int64
  42095. subaccount *Subaccount
  42096. urlParams_ gensupport.URLParams
  42097. ctx_ context.Context
  42098. header_ http.Header
  42099. }
  42100. // Update: Updates an existing subaccount.
  42101. func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall {
  42102. c := &SubaccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42103. c.profileId = profileId
  42104. c.subaccount = subaccount
  42105. return c
  42106. }
  42107. // Fields allows partial responses to be retrieved. See
  42108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42109. // for more information.
  42110. func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall {
  42111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42112. return c
  42113. }
  42114. // Context sets the context to be used in this call's Do method. Any
  42115. // pending HTTP request will be aborted if the provided context is
  42116. // canceled.
  42117. func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall {
  42118. c.ctx_ = ctx
  42119. return c
  42120. }
  42121. // Header returns an http.Header that can be modified by the caller to
  42122. // add HTTP headers to the request.
  42123. func (c *SubaccountsUpdateCall) Header() http.Header {
  42124. if c.header_ == nil {
  42125. c.header_ = make(http.Header)
  42126. }
  42127. return c.header_
  42128. }
  42129. func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  42130. reqHeaders := make(http.Header)
  42131. for k, v := range c.header_ {
  42132. reqHeaders[k] = v
  42133. }
  42134. reqHeaders.Set("User-Agent", c.s.userAgent())
  42135. var body io.Reader = nil
  42136. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  42137. if err != nil {
  42138. return nil, err
  42139. }
  42140. reqHeaders.Set("Content-Type", "application/json")
  42141. c.urlParams_.Set("alt", alt)
  42142. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  42143. urls += "?" + c.urlParams_.Encode()
  42144. req, _ := http.NewRequest("PUT", urls, body)
  42145. req.Header = reqHeaders
  42146. googleapi.Expand(req.URL, map[string]string{
  42147. "profileId": strconv.FormatInt(c.profileId, 10),
  42148. })
  42149. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42150. }
  42151. // Do executes the "dfareporting.subaccounts.update" call.
  42152. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  42153. // status code is an error. Response headers are in either
  42154. // *Subaccount.ServerResponse.Header or (if a response was returned at
  42155. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  42156. // to check whether the returned error was because
  42157. // http.StatusNotModified was returned.
  42158. func (c *SubaccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  42159. gensupport.SetOptions(c.urlParams_, opts...)
  42160. res, err := c.doRequest("json")
  42161. if res != nil && res.StatusCode == http.StatusNotModified {
  42162. if res.Body != nil {
  42163. res.Body.Close()
  42164. }
  42165. return nil, &googleapi.Error{
  42166. Code: res.StatusCode,
  42167. Header: res.Header,
  42168. }
  42169. }
  42170. if err != nil {
  42171. return nil, err
  42172. }
  42173. defer googleapi.CloseBody(res)
  42174. if err := googleapi.CheckResponse(res); err != nil {
  42175. return nil, err
  42176. }
  42177. ret := &Subaccount{
  42178. ServerResponse: googleapi.ServerResponse{
  42179. Header: res.Header,
  42180. HTTPStatusCode: res.StatusCode,
  42181. },
  42182. }
  42183. target := &ret
  42184. if err := gensupport.DecodeResponse(target, res); err != nil {
  42185. return nil, err
  42186. }
  42187. return ret, nil
  42188. // {
  42189. // "description": "Updates an existing subaccount.",
  42190. // "httpMethod": "PUT",
  42191. // "id": "dfareporting.subaccounts.update",
  42192. // "parameterOrder": [
  42193. // "profileId"
  42194. // ],
  42195. // "parameters": {
  42196. // "profileId": {
  42197. // "description": "User profile ID associated with this request.",
  42198. // "format": "int64",
  42199. // "location": "path",
  42200. // "required": true,
  42201. // "type": "string"
  42202. // }
  42203. // },
  42204. // "path": "userprofiles/{profileId}/subaccounts",
  42205. // "request": {
  42206. // "$ref": "Subaccount"
  42207. // },
  42208. // "response": {
  42209. // "$ref": "Subaccount"
  42210. // },
  42211. // "scopes": [
  42212. // "https://www.googleapis.com/auth/dfatrafficking"
  42213. // ]
  42214. // }
  42215. }
  42216. // method id "dfareporting.targetableRemarketingLists.get":
  42217. type TargetableRemarketingListsGetCall struct {
  42218. s *Service
  42219. profileId int64
  42220. id int64
  42221. urlParams_ gensupport.URLParams
  42222. ifNoneMatch_ string
  42223. ctx_ context.Context
  42224. header_ http.Header
  42225. }
  42226. // Get: Gets one remarketing list by ID.
  42227. func (r *TargetableRemarketingListsService) Get(profileId int64, id int64) *TargetableRemarketingListsGetCall {
  42228. c := &TargetableRemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42229. c.profileId = profileId
  42230. c.id = id
  42231. return c
  42232. }
  42233. // Fields allows partial responses to be retrieved. See
  42234. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42235. // for more information.
  42236. func (c *TargetableRemarketingListsGetCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsGetCall {
  42237. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42238. return c
  42239. }
  42240. // IfNoneMatch sets the optional parameter which makes the operation
  42241. // fail if the object's ETag matches the given value. This is useful for
  42242. // getting updates only after the object has changed since the last
  42243. // request. Use googleapi.IsNotModified to check whether the response
  42244. // error from Do is the result of In-None-Match.
  42245. func (c *TargetableRemarketingListsGetCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsGetCall {
  42246. c.ifNoneMatch_ = entityTag
  42247. return c
  42248. }
  42249. // Context sets the context to be used in this call's Do method. Any
  42250. // pending HTTP request will be aborted if the provided context is
  42251. // canceled.
  42252. func (c *TargetableRemarketingListsGetCall) Context(ctx context.Context) *TargetableRemarketingListsGetCall {
  42253. c.ctx_ = ctx
  42254. return c
  42255. }
  42256. // Header returns an http.Header that can be modified by the caller to
  42257. // add HTTP headers to the request.
  42258. func (c *TargetableRemarketingListsGetCall) Header() http.Header {
  42259. if c.header_ == nil {
  42260. c.header_ = make(http.Header)
  42261. }
  42262. return c.header_
  42263. }
  42264. func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  42265. reqHeaders := make(http.Header)
  42266. for k, v := range c.header_ {
  42267. reqHeaders[k] = v
  42268. }
  42269. reqHeaders.Set("User-Agent", c.s.userAgent())
  42270. if c.ifNoneMatch_ != "" {
  42271. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42272. }
  42273. var body io.Reader = nil
  42274. c.urlParams_.Set("alt", alt)
  42275. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists/{id}")
  42276. urls += "?" + c.urlParams_.Encode()
  42277. req, _ := http.NewRequest("GET", urls, body)
  42278. req.Header = reqHeaders
  42279. googleapi.Expand(req.URL, map[string]string{
  42280. "profileId": strconv.FormatInt(c.profileId, 10),
  42281. "id": strconv.FormatInt(c.id, 10),
  42282. })
  42283. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42284. }
  42285. // Do executes the "dfareporting.targetableRemarketingLists.get" call.
  42286. // Exactly one of *TargetableRemarketingList or error will be non-nil.
  42287. // Any non-2xx status code is an error. Response headers are in either
  42288. // *TargetableRemarketingList.ServerResponse.Header or (if a response
  42289. // was returned at all) in error.(*googleapi.Error).Header. Use
  42290. // googleapi.IsNotModified to check whether the returned error was
  42291. // because http.StatusNotModified was returned.
  42292. func (c *TargetableRemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingList, error) {
  42293. gensupport.SetOptions(c.urlParams_, opts...)
  42294. res, err := c.doRequest("json")
  42295. if res != nil && res.StatusCode == http.StatusNotModified {
  42296. if res.Body != nil {
  42297. res.Body.Close()
  42298. }
  42299. return nil, &googleapi.Error{
  42300. Code: res.StatusCode,
  42301. Header: res.Header,
  42302. }
  42303. }
  42304. if err != nil {
  42305. return nil, err
  42306. }
  42307. defer googleapi.CloseBody(res)
  42308. if err := googleapi.CheckResponse(res); err != nil {
  42309. return nil, err
  42310. }
  42311. ret := &TargetableRemarketingList{
  42312. ServerResponse: googleapi.ServerResponse{
  42313. Header: res.Header,
  42314. HTTPStatusCode: res.StatusCode,
  42315. },
  42316. }
  42317. target := &ret
  42318. if err := gensupport.DecodeResponse(target, res); err != nil {
  42319. return nil, err
  42320. }
  42321. return ret, nil
  42322. // {
  42323. // "description": "Gets one remarketing list by ID.",
  42324. // "httpMethod": "GET",
  42325. // "id": "dfareporting.targetableRemarketingLists.get",
  42326. // "parameterOrder": [
  42327. // "profileId",
  42328. // "id"
  42329. // ],
  42330. // "parameters": {
  42331. // "id": {
  42332. // "description": "Remarketing list ID.",
  42333. // "format": "int64",
  42334. // "location": "path",
  42335. // "required": true,
  42336. // "type": "string"
  42337. // },
  42338. // "profileId": {
  42339. // "description": "User profile ID associated with this request.",
  42340. // "format": "int64",
  42341. // "location": "path",
  42342. // "required": true,
  42343. // "type": "string"
  42344. // }
  42345. // },
  42346. // "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}",
  42347. // "response": {
  42348. // "$ref": "TargetableRemarketingList"
  42349. // },
  42350. // "scopes": [
  42351. // "https://www.googleapis.com/auth/dfatrafficking"
  42352. // ]
  42353. // }
  42354. }
  42355. // method id "dfareporting.targetableRemarketingLists.list":
  42356. type TargetableRemarketingListsListCall struct {
  42357. s *Service
  42358. profileId int64
  42359. urlParams_ gensupport.URLParams
  42360. ifNoneMatch_ string
  42361. ctx_ context.Context
  42362. header_ http.Header
  42363. }
  42364. // List: Retrieves a list of targetable remarketing lists, possibly
  42365. // filtered. This method supports paging.
  42366. func (r *TargetableRemarketingListsService) List(profileId int64, advertiserId int64) *TargetableRemarketingListsListCall {
  42367. c := &TargetableRemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42368. c.profileId = profileId
  42369. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  42370. return c
  42371. }
  42372. // Active sets the optional parameter "active": Select only active or
  42373. // only inactive targetable remarketing lists.
  42374. func (c *TargetableRemarketingListsListCall) Active(active bool) *TargetableRemarketingListsListCall {
  42375. c.urlParams_.Set("active", fmt.Sprint(active))
  42376. return c
  42377. }
  42378. // MaxResults sets the optional parameter "maxResults": Maximum number
  42379. // of results to return.
  42380. func (c *TargetableRemarketingListsListCall) MaxResults(maxResults int64) *TargetableRemarketingListsListCall {
  42381. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42382. return c
  42383. }
  42384. // Name sets the optional parameter "name": Allows searching for objects
  42385. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  42386. // list*2015" will return objects with names like "remarketing list June
  42387. // 2015", "remarketing list April 2015", or simply "remarketing list
  42388. // 2015". Most of the searches also add wildcards implicitly at the
  42389. // start and the end of the search string. For example, a search string
  42390. // of "remarketing list" will match objects with name "my remarketing
  42391. // list", "remarketing list 2015", or simply "remarketing list".
  42392. func (c *TargetableRemarketingListsListCall) Name(name string) *TargetableRemarketingListsListCall {
  42393. c.urlParams_.Set("name", name)
  42394. return c
  42395. }
  42396. // PageToken sets the optional parameter "pageToken": Value of the
  42397. // nextPageToken from the previous result page.
  42398. func (c *TargetableRemarketingListsListCall) PageToken(pageToken string) *TargetableRemarketingListsListCall {
  42399. c.urlParams_.Set("pageToken", pageToken)
  42400. return c
  42401. }
  42402. // SortField sets the optional parameter "sortField": Field by which to
  42403. // sort the list.
  42404. //
  42405. // Possible values:
  42406. // "ID" (default)
  42407. // "NAME"
  42408. func (c *TargetableRemarketingListsListCall) SortField(sortField string) *TargetableRemarketingListsListCall {
  42409. c.urlParams_.Set("sortField", sortField)
  42410. return c
  42411. }
  42412. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  42413. // results.
  42414. //
  42415. // Possible values:
  42416. // "ASCENDING" (default)
  42417. // "DESCENDING"
  42418. func (c *TargetableRemarketingListsListCall) SortOrder(sortOrder string) *TargetableRemarketingListsListCall {
  42419. c.urlParams_.Set("sortOrder", sortOrder)
  42420. return c
  42421. }
  42422. // Fields allows partial responses to be retrieved. See
  42423. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42424. // for more information.
  42425. func (c *TargetableRemarketingListsListCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsListCall {
  42426. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42427. return c
  42428. }
  42429. // IfNoneMatch sets the optional parameter which makes the operation
  42430. // fail if the object's ETag matches the given value. This is useful for
  42431. // getting updates only after the object has changed since the last
  42432. // request. Use googleapi.IsNotModified to check whether the response
  42433. // error from Do is the result of In-None-Match.
  42434. func (c *TargetableRemarketingListsListCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsListCall {
  42435. c.ifNoneMatch_ = entityTag
  42436. return c
  42437. }
  42438. // Context sets the context to be used in this call's Do method. Any
  42439. // pending HTTP request will be aborted if the provided context is
  42440. // canceled.
  42441. func (c *TargetableRemarketingListsListCall) Context(ctx context.Context) *TargetableRemarketingListsListCall {
  42442. c.ctx_ = ctx
  42443. return c
  42444. }
  42445. // Header returns an http.Header that can be modified by the caller to
  42446. // add HTTP headers to the request.
  42447. func (c *TargetableRemarketingListsListCall) Header() http.Header {
  42448. if c.header_ == nil {
  42449. c.header_ = make(http.Header)
  42450. }
  42451. return c.header_
  42452. }
  42453. func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  42454. reqHeaders := make(http.Header)
  42455. for k, v := range c.header_ {
  42456. reqHeaders[k] = v
  42457. }
  42458. reqHeaders.Set("User-Agent", c.s.userAgent())
  42459. if c.ifNoneMatch_ != "" {
  42460. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42461. }
  42462. var body io.Reader = nil
  42463. c.urlParams_.Set("alt", alt)
  42464. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists")
  42465. urls += "?" + c.urlParams_.Encode()
  42466. req, _ := http.NewRequest("GET", urls, body)
  42467. req.Header = reqHeaders
  42468. googleapi.Expand(req.URL, map[string]string{
  42469. "profileId": strconv.FormatInt(c.profileId, 10),
  42470. })
  42471. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42472. }
  42473. // Do executes the "dfareporting.targetableRemarketingLists.list" call.
  42474. // Exactly one of *TargetableRemarketingListsListResponse or error will
  42475. // be non-nil. Any non-2xx status code is an error. Response headers are
  42476. // in either
  42477. // *TargetableRemarketingListsListResponse.ServerResponse.Header or (if
  42478. // a response was returned at all) in error.(*googleapi.Error).Header.
  42479. // Use googleapi.IsNotModified to check whether the returned error was
  42480. // because http.StatusNotModified was returned.
  42481. func (c *TargetableRemarketingListsListCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingListsListResponse, error) {
  42482. gensupport.SetOptions(c.urlParams_, opts...)
  42483. res, err := c.doRequest("json")
  42484. if res != nil && res.StatusCode == http.StatusNotModified {
  42485. if res.Body != nil {
  42486. res.Body.Close()
  42487. }
  42488. return nil, &googleapi.Error{
  42489. Code: res.StatusCode,
  42490. Header: res.Header,
  42491. }
  42492. }
  42493. if err != nil {
  42494. return nil, err
  42495. }
  42496. defer googleapi.CloseBody(res)
  42497. if err := googleapi.CheckResponse(res); err != nil {
  42498. return nil, err
  42499. }
  42500. ret := &TargetableRemarketingListsListResponse{
  42501. ServerResponse: googleapi.ServerResponse{
  42502. Header: res.Header,
  42503. HTTPStatusCode: res.StatusCode,
  42504. },
  42505. }
  42506. target := &ret
  42507. if err := gensupport.DecodeResponse(target, res); err != nil {
  42508. return nil, err
  42509. }
  42510. return ret, nil
  42511. // {
  42512. // "description": "Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging.",
  42513. // "httpMethod": "GET",
  42514. // "id": "dfareporting.targetableRemarketingLists.list",
  42515. // "parameterOrder": [
  42516. // "profileId",
  42517. // "advertiserId"
  42518. // ],
  42519. // "parameters": {
  42520. // "active": {
  42521. // "description": "Select only active or only inactive targetable remarketing lists.",
  42522. // "location": "query",
  42523. // "type": "boolean"
  42524. // },
  42525. // "advertiserId": {
  42526. // "description": "Select only targetable remarketing lists targetable by these advertisers.",
  42527. // "format": "int64",
  42528. // "location": "query",
  42529. // "required": true,
  42530. // "type": "string"
  42531. // },
  42532. // "maxResults": {
  42533. // "default": "1000",
  42534. // "description": "Maximum number of results to return.",
  42535. // "format": "int32",
  42536. // "location": "query",
  42537. // "maximum": "1000",
  42538. // "minimum": "0",
  42539. // "type": "integer"
  42540. // },
  42541. // "name": {
  42542. // "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\".",
  42543. // "location": "query",
  42544. // "type": "string"
  42545. // },
  42546. // "pageToken": {
  42547. // "description": "Value of the nextPageToken from the previous result page.",
  42548. // "location": "query",
  42549. // "type": "string"
  42550. // },
  42551. // "profileId": {
  42552. // "description": "User profile ID associated with this request.",
  42553. // "format": "int64",
  42554. // "location": "path",
  42555. // "required": true,
  42556. // "type": "string"
  42557. // },
  42558. // "sortField": {
  42559. // "default": "ID",
  42560. // "description": "Field by which to sort the list.",
  42561. // "enum": [
  42562. // "ID",
  42563. // "NAME"
  42564. // ],
  42565. // "enumDescriptions": [
  42566. // "",
  42567. // ""
  42568. // ],
  42569. // "location": "query",
  42570. // "type": "string"
  42571. // },
  42572. // "sortOrder": {
  42573. // "default": "ASCENDING",
  42574. // "description": "Order of sorted results.",
  42575. // "enum": [
  42576. // "ASCENDING",
  42577. // "DESCENDING"
  42578. // ],
  42579. // "enumDescriptions": [
  42580. // "",
  42581. // ""
  42582. // ],
  42583. // "location": "query",
  42584. // "type": "string"
  42585. // }
  42586. // },
  42587. // "path": "userprofiles/{profileId}/targetableRemarketingLists",
  42588. // "response": {
  42589. // "$ref": "TargetableRemarketingListsListResponse"
  42590. // },
  42591. // "scopes": [
  42592. // "https://www.googleapis.com/auth/dfatrafficking"
  42593. // ]
  42594. // }
  42595. }
  42596. // Pages invokes f for each page of results.
  42597. // A non-nil error returned from f will halt the iteration.
  42598. // The provided context supersedes any context provided to the Context method.
  42599. func (c *TargetableRemarketingListsListCall) Pages(ctx context.Context, f func(*TargetableRemarketingListsListResponse) error) error {
  42600. c.ctx_ = ctx
  42601. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42602. for {
  42603. x, err := c.Do()
  42604. if err != nil {
  42605. return err
  42606. }
  42607. if err := f(x); err != nil {
  42608. return err
  42609. }
  42610. if x.NextPageToken == "" {
  42611. return nil
  42612. }
  42613. c.PageToken(x.NextPageToken)
  42614. }
  42615. }
  42616. // method id "dfareporting.targetingTemplates.get":
  42617. type TargetingTemplatesGetCall struct {
  42618. s *Service
  42619. profileId int64
  42620. id int64
  42621. urlParams_ gensupport.URLParams
  42622. ifNoneMatch_ string
  42623. ctx_ context.Context
  42624. header_ http.Header
  42625. }
  42626. // Get: Gets one targeting template by ID.
  42627. func (r *TargetingTemplatesService) Get(profileId int64, id int64) *TargetingTemplatesGetCall {
  42628. c := &TargetingTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42629. c.profileId = profileId
  42630. c.id = id
  42631. return c
  42632. }
  42633. // Fields allows partial responses to be retrieved. See
  42634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42635. // for more information.
  42636. func (c *TargetingTemplatesGetCall) Fields(s ...googleapi.Field) *TargetingTemplatesGetCall {
  42637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42638. return c
  42639. }
  42640. // IfNoneMatch sets the optional parameter which makes the operation
  42641. // fail if the object's ETag matches the given value. This is useful for
  42642. // getting updates only after the object has changed since the last
  42643. // request. Use googleapi.IsNotModified to check whether the response
  42644. // error from Do is the result of In-None-Match.
  42645. func (c *TargetingTemplatesGetCall) IfNoneMatch(entityTag string) *TargetingTemplatesGetCall {
  42646. c.ifNoneMatch_ = entityTag
  42647. return c
  42648. }
  42649. // Context sets the context to be used in this call's Do method. Any
  42650. // pending HTTP request will be aborted if the provided context is
  42651. // canceled.
  42652. func (c *TargetingTemplatesGetCall) Context(ctx context.Context) *TargetingTemplatesGetCall {
  42653. c.ctx_ = ctx
  42654. return c
  42655. }
  42656. // Header returns an http.Header that can be modified by the caller to
  42657. // add HTTP headers to the request.
  42658. func (c *TargetingTemplatesGetCall) Header() http.Header {
  42659. if c.header_ == nil {
  42660. c.header_ = make(http.Header)
  42661. }
  42662. return c.header_
  42663. }
  42664. func (c *TargetingTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  42665. reqHeaders := make(http.Header)
  42666. for k, v := range c.header_ {
  42667. reqHeaders[k] = v
  42668. }
  42669. reqHeaders.Set("User-Agent", c.s.userAgent())
  42670. if c.ifNoneMatch_ != "" {
  42671. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42672. }
  42673. var body io.Reader = nil
  42674. c.urlParams_.Set("alt", alt)
  42675. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates/{id}")
  42676. urls += "?" + c.urlParams_.Encode()
  42677. req, _ := http.NewRequest("GET", urls, body)
  42678. req.Header = reqHeaders
  42679. googleapi.Expand(req.URL, map[string]string{
  42680. "profileId": strconv.FormatInt(c.profileId, 10),
  42681. "id": strconv.FormatInt(c.id, 10),
  42682. })
  42683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42684. }
  42685. // Do executes the "dfareporting.targetingTemplates.get" call.
  42686. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  42687. // non-2xx status code is an error. Response headers are in either
  42688. // *TargetingTemplate.ServerResponse.Header or (if a response was
  42689. // returned at all) in error.(*googleapi.Error).Header. Use
  42690. // googleapi.IsNotModified to check whether the returned error was
  42691. // because http.StatusNotModified was returned.
  42692. func (c *TargetingTemplatesGetCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  42693. gensupport.SetOptions(c.urlParams_, opts...)
  42694. res, err := c.doRequest("json")
  42695. if res != nil && res.StatusCode == http.StatusNotModified {
  42696. if res.Body != nil {
  42697. res.Body.Close()
  42698. }
  42699. return nil, &googleapi.Error{
  42700. Code: res.StatusCode,
  42701. Header: res.Header,
  42702. }
  42703. }
  42704. if err != nil {
  42705. return nil, err
  42706. }
  42707. defer googleapi.CloseBody(res)
  42708. if err := googleapi.CheckResponse(res); err != nil {
  42709. return nil, err
  42710. }
  42711. ret := &TargetingTemplate{
  42712. ServerResponse: googleapi.ServerResponse{
  42713. Header: res.Header,
  42714. HTTPStatusCode: res.StatusCode,
  42715. },
  42716. }
  42717. target := &ret
  42718. if err := gensupport.DecodeResponse(target, res); err != nil {
  42719. return nil, err
  42720. }
  42721. return ret, nil
  42722. // {
  42723. // "description": "Gets one targeting template by ID.",
  42724. // "httpMethod": "GET",
  42725. // "id": "dfareporting.targetingTemplates.get",
  42726. // "parameterOrder": [
  42727. // "profileId",
  42728. // "id"
  42729. // ],
  42730. // "parameters": {
  42731. // "id": {
  42732. // "description": "Targeting template ID.",
  42733. // "format": "int64",
  42734. // "location": "path",
  42735. // "required": true,
  42736. // "type": "string"
  42737. // },
  42738. // "profileId": {
  42739. // "description": "User profile ID associated with this request.",
  42740. // "format": "int64",
  42741. // "location": "path",
  42742. // "required": true,
  42743. // "type": "string"
  42744. // }
  42745. // },
  42746. // "path": "userprofiles/{profileId}/targetingTemplates/{id}",
  42747. // "response": {
  42748. // "$ref": "TargetingTemplate"
  42749. // },
  42750. // "scopes": [
  42751. // "https://www.googleapis.com/auth/dfatrafficking"
  42752. // ]
  42753. // }
  42754. }
  42755. // method id "dfareporting.targetingTemplates.insert":
  42756. type TargetingTemplatesInsertCall struct {
  42757. s *Service
  42758. profileId int64
  42759. targetingtemplate *TargetingTemplate
  42760. urlParams_ gensupport.URLParams
  42761. ctx_ context.Context
  42762. header_ http.Header
  42763. }
  42764. // Insert: Inserts a new targeting template.
  42765. func (r *TargetingTemplatesService) Insert(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesInsertCall {
  42766. c := &TargetingTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42767. c.profileId = profileId
  42768. c.targetingtemplate = targetingtemplate
  42769. return c
  42770. }
  42771. // Fields allows partial responses to be retrieved. See
  42772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42773. // for more information.
  42774. func (c *TargetingTemplatesInsertCall) Fields(s ...googleapi.Field) *TargetingTemplatesInsertCall {
  42775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42776. return c
  42777. }
  42778. // Context sets the context to be used in this call's Do method. Any
  42779. // pending HTTP request will be aborted if the provided context is
  42780. // canceled.
  42781. func (c *TargetingTemplatesInsertCall) Context(ctx context.Context) *TargetingTemplatesInsertCall {
  42782. c.ctx_ = ctx
  42783. return c
  42784. }
  42785. // Header returns an http.Header that can be modified by the caller to
  42786. // add HTTP headers to the request.
  42787. func (c *TargetingTemplatesInsertCall) Header() http.Header {
  42788. if c.header_ == nil {
  42789. c.header_ = make(http.Header)
  42790. }
  42791. return c.header_
  42792. }
  42793. func (c *TargetingTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  42794. reqHeaders := make(http.Header)
  42795. for k, v := range c.header_ {
  42796. reqHeaders[k] = v
  42797. }
  42798. reqHeaders.Set("User-Agent", c.s.userAgent())
  42799. var body io.Reader = nil
  42800. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  42801. if err != nil {
  42802. return nil, err
  42803. }
  42804. reqHeaders.Set("Content-Type", "application/json")
  42805. c.urlParams_.Set("alt", alt)
  42806. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  42807. urls += "?" + c.urlParams_.Encode()
  42808. req, _ := http.NewRequest("POST", urls, body)
  42809. req.Header = reqHeaders
  42810. googleapi.Expand(req.URL, map[string]string{
  42811. "profileId": strconv.FormatInt(c.profileId, 10),
  42812. })
  42813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42814. }
  42815. // Do executes the "dfareporting.targetingTemplates.insert" call.
  42816. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  42817. // non-2xx status code is an error. Response headers are in either
  42818. // *TargetingTemplate.ServerResponse.Header or (if a response was
  42819. // returned at all) in error.(*googleapi.Error).Header. Use
  42820. // googleapi.IsNotModified to check whether the returned error was
  42821. // because http.StatusNotModified was returned.
  42822. func (c *TargetingTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  42823. gensupport.SetOptions(c.urlParams_, opts...)
  42824. res, err := c.doRequest("json")
  42825. if res != nil && res.StatusCode == http.StatusNotModified {
  42826. if res.Body != nil {
  42827. res.Body.Close()
  42828. }
  42829. return nil, &googleapi.Error{
  42830. Code: res.StatusCode,
  42831. Header: res.Header,
  42832. }
  42833. }
  42834. if err != nil {
  42835. return nil, err
  42836. }
  42837. defer googleapi.CloseBody(res)
  42838. if err := googleapi.CheckResponse(res); err != nil {
  42839. return nil, err
  42840. }
  42841. ret := &TargetingTemplate{
  42842. ServerResponse: googleapi.ServerResponse{
  42843. Header: res.Header,
  42844. HTTPStatusCode: res.StatusCode,
  42845. },
  42846. }
  42847. target := &ret
  42848. if err := gensupport.DecodeResponse(target, res); err != nil {
  42849. return nil, err
  42850. }
  42851. return ret, nil
  42852. // {
  42853. // "description": "Inserts a new targeting template.",
  42854. // "httpMethod": "POST",
  42855. // "id": "dfareporting.targetingTemplates.insert",
  42856. // "parameterOrder": [
  42857. // "profileId"
  42858. // ],
  42859. // "parameters": {
  42860. // "profileId": {
  42861. // "description": "User profile ID associated with this request.",
  42862. // "format": "int64",
  42863. // "location": "path",
  42864. // "required": true,
  42865. // "type": "string"
  42866. // }
  42867. // },
  42868. // "path": "userprofiles/{profileId}/targetingTemplates",
  42869. // "request": {
  42870. // "$ref": "TargetingTemplate"
  42871. // },
  42872. // "response": {
  42873. // "$ref": "TargetingTemplate"
  42874. // },
  42875. // "scopes": [
  42876. // "https://www.googleapis.com/auth/dfatrafficking"
  42877. // ]
  42878. // }
  42879. }
  42880. // method id "dfareporting.targetingTemplates.list":
  42881. type TargetingTemplatesListCall struct {
  42882. s *Service
  42883. profileId int64
  42884. urlParams_ gensupport.URLParams
  42885. ifNoneMatch_ string
  42886. ctx_ context.Context
  42887. header_ http.Header
  42888. }
  42889. // List: Retrieves a list of targeting templates, optionally filtered.
  42890. // This method supports paging.
  42891. func (r *TargetingTemplatesService) List(profileId int64) *TargetingTemplatesListCall {
  42892. c := &TargetingTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42893. c.profileId = profileId
  42894. return c
  42895. }
  42896. // AdvertiserId sets the optional parameter "advertiserId": Select only
  42897. // targeting templates with this advertiser ID.
  42898. func (c *TargetingTemplatesListCall) AdvertiserId(advertiserId int64) *TargetingTemplatesListCall {
  42899. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  42900. return c
  42901. }
  42902. // Ids sets the optional parameter "ids": Select only targeting
  42903. // templates with these IDs.
  42904. func (c *TargetingTemplatesListCall) Ids(ids ...int64) *TargetingTemplatesListCall {
  42905. var ids_ []string
  42906. for _, v := range ids {
  42907. ids_ = append(ids_, fmt.Sprint(v))
  42908. }
  42909. c.urlParams_.SetMulti("ids", ids_)
  42910. return c
  42911. }
  42912. // MaxResults sets the optional parameter "maxResults": Maximum number
  42913. // of results to return.
  42914. func (c *TargetingTemplatesListCall) MaxResults(maxResults int64) *TargetingTemplatesListCall {
  42915. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42916. return c
  42917. }
  42918. // PageToken sets the optional parameter "pageToken": Value of the
  42919. // nextPageToken from the previous result page.
  42920. func (c *TargetingTemplatesListCall) PageToken(pageToken string) *TargetingTemplatesListCall {
  42921. c.urlParams_.Set("pageToken", pageToken)
  42922. return c
  42923. }
  42924. // SearchString sets the optional parameter "searchString": Allows
  42925. // searching for objects by name or ID. Wildcards (*) are allowed. For
  42926. // example, "template*2015" will return objects with names like
  42927. // "template June 2015", "template April 2015", or simply "template
  42928. // 2015". Most of the searches also add wildcards implicitly at the
  42929. // start and the end of the search string. For example, a search string
  42930. // of "template" will match objects with name "my template", "template
  42931. // 2015", or simply "template".
  42932. func (c *TargetingTemplatesListCall) SearchString(searchString string) *TargetingTemplatesListCall {
  42933. c.urlParams_.Set("searchString", searchString)
  42934. return c
  42935. }
  42936. // SortField sets the optional parameter "sortField": Field by which to
  42937. // sort the list.
  42938. //
  42939. // Possible values:
  42940. // "ID" (default)
  42941. // "NAME"
  42942. func (c *TargetingTemplatesListCall) SortField(sortField string) *TargetingTemplatesListCall {
  42943. c.urlParams_.Set("sortField", sortField)
  42944. return c
  42945. }
  42946. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  42947. // results.
  42948. //
  42949. // Possible values:
  42950. // "ASCENDING" (default)
  42951. // "DESCENDING"
  42952. func (c *TargetingTemplatesListCall) SortOrder(sortOrder string) *TargetingTemplatesListCall {
  42953. c.urlParams_.Set("sortOrder", sortOrder)
  42954. return c
  42955. }
  42956. // Fields allows partial responses to be retrieved. See
  42957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42958. // for more information.
  42959. func (c *TargetingTemplatesListCall) Fields(s ...googleapi.Field) *TargetingTemplatesListCall {
  42960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42961. return c
  42962. }
  42963. // IfNoneMatch sets the optional parameter which makes the operation
  42964. // fail if the object's ETag matches the given value. This is useful for
  42965. // getting updates only after the object has changed since the last
  42966. // request. Use googleapi.IsNotModified to check whether the response
  42967. // error from Do is the result of In-None-Match.
  42968. func (c *TargetingTemplatesListCall) IfNoneMatch(entityTag string) *TargetingTemplatesListCall {
  42969. c.ifNoneMatch_ = entityTag
  42970. return c
  42971. }
  42972. // Context sets the context to be used in this call's Do method. Any
  42973. // pending HTTP request will be aborted if the provided context is
  42974. // canceled.
  42975. func (c *TargetingTemplatesListCall) Context(ctx context.Context) *TargetingTemplatesListCall {
  42976. c.ctx_ = ctx
  42977. return c
  42978. }
  42979. // Header returns an http.Header that can be modified by the caller to
  42980. // add HTTP headers to the request.
  42981. func (c *TargetingTemplatesListCall) Header() http.Header {
  42982. if c.header_ == nil {
  42983. c.header_ = make(http.Header)
  42984. }
  42985. return c.header_
  42986. }
  42987. func (c *TargetingTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  42988. reqHeaders := make(http.Header)
  42989. for k, v := range c.header_ {
  42990. reqHeaders[k] = v
  42991. }
  42992. reqHeaders.Set("User-Agent", c.s.userAgent())
  42993. if c.ifNoneMatch_ != "" {
  42994. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42995. }
  42996. var body io.Reader = nil
  42997. c.urlParams_.Set("alt", alt)
  42998. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  42999. urls += "?" + c.urlParams_.Encode()
  43000. req, _ := http.NewRequest("GET", urls, body)
  43001. req.Header = reqHeaders
  43002. googleapi.Expand(req.URL, map[string]string{
  43003. "profileId": strconv.FormatInt(c.profileId, 10),
  43004. })
  43005. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43006. }
  43007. // Do executes the "dfareporting.targetingTemplates.list" call.
  43008. // Exactly one of *TargetingTemplatesListResponse or error will be
  43009. // non-nil. Any non-2xx status code is an error. Response headers are in
  43010. // either *TargetingTemplatesListResponse.ServerResponse.Header or (if a
  43011. // response was returned at all) in error.(*googleapi.Error).Header. Use
  43012. // googleapi.IsNotModified to check whether the returned error was
  43013. // because http.StatusNotModified was returned.
  43014. func (c *TargetingTemplatesListCall) Do(opts ...googleapi.CallOption) (*TargetingTemplatesListResponse, error) {
  43015. gensupport.SetOptions(c.urlParams_, opts...)
  43016. res, err := c.doRequest("json")
  43017. if res != nil && res.StatusCode == http.StatusNotModified {
  43018. if res.Body != nil {
  43019. res.Body.Close()
  43020. }
  43021. return nil, &googleapi.Error{
  43022. Code: res.StatusCode,
  43023. Header: res.Header,
  43024. }
  43025. }
  43026. if err != nil {
  43027. return nil, err
  43028. }
  43029. defer googleapi.CloseBody(res)
  43030. if err := googleapi.CheckResponse(res); err != nil {
  43031. return nil, err
  43032. }
  43033. ret := &TargetingTemplatesListResponse{
  43034. ServerResponse: googleapi.ServerResponse{
  43035. Header: res.Header,
  43036. HTTPStatusCode: res.StatusCode,
  43037. },
  43038. }
  43039. target := &ret
  43040. if err := gensupport.DecodeResponse(target, res); err != nil {
  43041. return nil, err
  43042. }
  43043. return ret, nil
  43044. // {
  43045. // "description": "Retrieves a list of targeting templates, optionally filtered. This method supports paging.",
  43046. // "httpMethod": "GET",
  43047. // "id": "dfareporting.targetingTemplates.list",
  43048. // "parameterOrder": [
  43049. // "profileId"
  43050. // ],
  43051. // "parameters": {
  43052. // "advertiserId": {
  43053. // "description": "Select only targeting templates with this advertiser ID.",
  43054. // "format": "int64",
  43055. // "location": "query",
  43056. // "type": "string"
  43057. // },
  43058. // "ids": {
  43059. // "description": "Select only targeting templates with these IDs.",
  43060. // "format": "int64",
  43061. // "location": "query",
  43062. // "repeated": true,
  43063. // "type": "string"
  43064. // },
  43065. // "maxResults": {
  43066. // "default": "1000",
  43067. // "description": "Maximum number of results to return.",
  43068. // "format": "int32",
  43069. // "location": "query",
  43070. // "maximum": "1000",
  43071. // "minimum": "0",
  43072. // "type": "integer"
  43073. // },
  43074. // "pageToken": {
  43075. // "description": "Value of the nextPageToken from the previous result page.",
  43076. // "location": "query",
  43077. // "type": "string"
  43078. // },
  43079. // "profileId": {
  43080. // "description": "User profile ID associated with this request.",
  43081. // "format": "int64",
  43082. // "location": "path",
  43083. // "required": true,
  43084. // "type": "string"
  43085. // },
  43086. // "searchString": {
  43087. // "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\".",
  43088. // "location": "query",
  43089. // "type": "string"
  43090. // },
  43091. // "sortField": {
  43092. // "default": "ID",
  43093. // "description": "Field by which to sort the list.",
  43094. // "enum": [
  43095. // "ID",
  43096. // "NAME"
  43097. // ],
  43098. // "enumDescriptions": [
  43099. // "",
  43100. // ""
  43101. // ],
  43102. // "location": "query",
  43103. // "type": "string"
  43104. // },
  43105. // "sortOrder": {
  43106. // "default": "ASCENDING",
  43107. // "description": "Order of sorted results.",
  43108. // "enum": [
  43109. // "ASCENDING",
  43110. // "DESCENDING"
  43111. // ],
  43112. // "enumDescriptions": [
  43113. // "",
  43114. // ""
  43115. // ],
  43116. // "location": "query",
  43117. // "type": "string"
  43118. // }
  43119. // },
  43120. // "path": "userprofiles/{profileId}/targetingTemplates",
  43121. // "response": {
  43122. // "$ref": "TargetingTemplatesListResponse"
  43123. // },
  43124. // "scopes": [
  43125. // "https://www.googleapis.com/auth/dfatrafficking"
  43126. // ]
  43127. // }
  43128. }
  43129. // Pages invokes f for each page of results.
  43130. // A non-nil error returned from f will halt the iteration.
  43131. // The provided context supersedes any context provided to the Context method.
  43132. func (c *TargetingTemplatesListCall) Pages(ctx context.Context, f func(*TargetingTemplatesListResponse) error) error {
  43133. c.ctx_ = ctx
  43134. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  43135. for {
  43136. x, err := c.Do()
  43137. if err != nil {
  43138. return err
  43139. }
  43140. if err := f(x); err != nil {
  43141. return err
  43142. }
  43143. if x.NextPageToken == "" {
  43144. return nil
  43145. }
  43146. c.PageToken(x.NextPageToken)
  43147. }
  43148. }
  43149. // method id "dfareporting.targetingTemplates.patch":
  43150. type TargetingTemplatesPatchCall struct {
  43151. s *Service
  43152. profileId int64
  43153. targetingtemplate *TargetingTemplate
  43154. urlParams_ gensupport.URLParams
  43155. ctx_ context.Context
  43156. header_ http.Header
  43157. }
  43158. // Patch: Updates an existing targeting template. This method supports
  43159. // patch semantics.
  43160. func (r *TargetingTemplatesService) Patch(profileId int64, id int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesPatchCall {
  43161. c := &TargetingTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43162. c.profileId = profileId
  43163. c.urlParams_.Set("id", fmt.Sprint(id))
  43164. c.targetingtemplate = targetingtemplate
  43165. return c
  43166. }
  43167. // Fields allows partial responses to be retrieved. See
  43168. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43169. // for more information.
  43170. func (c *TargetingTemplatesPatchCall) Fields(s ...googleapi.Field) *TargetingTemplatesPatchCall {
  43171. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43172. return c
  43173. }
  43174. // Context sets the context to be used in this call's Do method. Any
  43175. // pending HTTP request will be aborted if the provided context is
  43176. // canceled.
  43177. func (c *TargetingTemplatesPatchCall) Context(ctx context.Context) *TargetingTemplatesPatchCall {
  43178. c.ctx_ = ctx
  43179. return c
  43180. }
  43181. // Header returns an http.Header that can be modified by the caller to
  43182. // add HTTP headers to the request.
  43183. func (c *TargetingTemplatesPatchCall) Header() http.Header {
  43184. if c.header_ == nil {
  43185. c.header_ = make(http.Header)
  43186. }
  43187. return c.header_
  43188. }
  43189. func (c *TargetingTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  43190. reqHeaders := make(http.Header)
  43191. for k, v := range c.header_ {
  43192. reqHeaders[k] = v
  43193. }
  43194. reqHeaders.Set("User-Agent", c.s.userAgent())
  43195. var body io.Reader = nil
  43196. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  43197. if err != nil {
  43198. return nil, err
  43199. }
  43200. reqHeaders.Set("Content-Type", "application/json")
  43201. c.urlParams_.Set("alt", alt)
  43202. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43203. urls += "?" + c.urlParams_.Encode()
  43204. req, _ := http.NewRequest("PATCH", urls, body)
  43205. req.Header = reqHeaders
  43206. googleapi.Expand(req.URL, map[string]string{
  43207. "profileId": strconv.FormatInt(c.profileId, 10),
  43208. })
  43209. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43210. }
  43211. // Do executes the "dfareporting.targetingTemplates.patch" call.
  43212. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43213. // non-2xx status code is an error. Response headers are in either
  43214. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43215. // returned at all) in error.(*googleapi.Error).Header. Use
  43216. // googleapi.IsNotModified to check whether the returned error was
  43217. // because http.StatusNotModified was returned.
  43218. func (c *TargetingTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43219. gensupport.SetOptions(c.urlParams_, opts...)
  43220. res, err := c.doRequest("json")
  43221. if res != nil && res.StatusCode == http.StatusNotModified {
  43222. if res.Body != nil {
  43223. res.Body.Close()
  43224. }
  43225. return nil, &googleapi.Error{
  43226. Code: res.StatusCode,
  43227. Header: res.Header,
  43228. }
  43229. }
  43230. if err != nil {
  43231. return nil, err
  43232. }
  43233. defer googleapi.CloseBody(res)
  43234. if err := googleapi.CheckResponse(res); err != nil {
  43235. return nil, err
  43236. }
  43237. ret := &TargetingTemplate{
  43238. ServerResponse: googleapi.ServerResponse{
  43239. Header: res.Header,
  43240. HTTPStatusCode: res.StatusCode,
  43241. },
  43242. }
  43243. target := &ret
  43244. if err := gensupport.DecodeResponse(target, res); err != nil {
  43245. return nil, err
  43246. }
  43247. return ret, nil
  43248. // {
  43249. // "description": "Updates an existing targeting template. This method supports patch semantics.",
  43250. // "httpMethod": "PATCH",
  43251. // "id": "dfareporting.targetingTemplates.patch",
  43252. // "parameterOrder": [
  43253. // "profileId",
  43254. // "id"
  43255. // ],
  43256. // "parameters": {
  43257. // "id": {
  43258. // "description": "Targeting template ID.",
  43259. // "format": "int64",
  43260. // "location": "query",
  43261. // "required": true,
  43262. // "type": "string"
  43263. // },
  43264. // "profileId": {
  43265. // "description": "User profile ID associated with this request.",
  43266. // "format": "int64",
  43267. // "location": "path",
  43268. // "required": true,
  43269. // "type": "string"
  43270. // }
  43271. // },
  43272. // "path": "userprofiles/{profileId}/targetingTemplates",
  43273. // "request": {
  43274. // "$ref": "TargetingTemplate"
  43275. // },
  43276. // "response": {
  43277. // "$ref": "TargetingTemplate"
  43278. // },
  43279. // "scopes": [
  43280. // "https://www.googleapis.com/auth/dfatrafficking"
  43281. // ]
  43282. // }
  43283. }
  43284. // method id "dfareporting.targetingTemplates.update":
  43285. type TargetingTemplatesUpdateCall struct {
  43286. s *Service
  43287. profileId int64
  43288. targetingtemplate *TargetingTemplate
  43289. urlParams_ gensupport.URLParams
  43290. ctx_ context.Context
  43291. header_ http.Header
  43292. }
  43293. // Update: Updates an existing targeting template.
  43294. func (r *TargetingTemplatesService) Update(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesUpdateCall {
  43295. c := &TargetingTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43296. c.profileId = profileId
  43297. c.targetingtemplate = targetingtemplate
  43298. return c
  43299. }
  43300. // Fields allows partial responses to be retrieved. See
  43301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43302. // for more information.
  43303. func (c *TargetingTemplatesUpdateCall) Fields(s ...googleapi.Field) *TargetingTemplatesUpdateCall {
  43304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43305. return c
  43306. }
  43307. // Context sets the context to be used in this call's Do method. Any
  43308. // pending HTTP request will be aborted if the provided context is
  43309. // canceled.
  43310. func (c *TargetingTemplatesUpdateCall) Context(ctx context.Context) *TargetingTemplatesUpdateCall {
  43311. c.ctx_ = ctx
  43312. return c
  43313. }
  43314. // Header returns an http.Header that can be modified by the caller to
  43315. // add HTTP headers to the request.
  43316. func (c *TargetingTemplatesUpdateCall) Header() http.Header {
  43317. if c.header_ == nil {
  43318. c.header_ = make(http.Header)
  43319. }
  43320. return c.header_
  43321. }
  43322. func (c *TargetingTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  43323. reqHeaders := make(http.Header)
  43324. for k, v := range c.header_ {
  43325. reqHeaders[k] = v
  43326. }
  43327. reqHeaders.Set("User-Agent", c.s.userAgent())
  43328. var body io.Reader = nil
  43329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  43330. if err != nil {
  43331. return nil, err
  43332. }
  43333. reqHeaders.Set("Content-Type", "application/json")
  43334. c.urlParams_.Set("alt", alt)
  43335. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  43336. urls += "?" + c.urlParams_.Encode()
  43337. req, _ := http.NewRequest("PUT", urls, body)
  43338. req.Header = reqHeaders
  43339. googleapi.Expand(req.URL, map[string]string{
  43340. "profileId": strconv.FormatInt(c.profileId, 10),
  43341. })
  43342. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43343. }
  43344. // Do executes the "dfareporting.targetingTemplates.update" call.
  43345. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  43346. // non-2xx status code is an error. Response headers are in either
  43347. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43348. // returned at all) in error.(*googleapi.Error).Header. Use
  43349. // googleapi.IsNotModified to check whether the returned error was
  43350. // because http.StatusNotModified was returned.
  43351. func (c *TargetingTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43352. gensupport.SetOptions(c.urlParams_, opts...)
  43353. res, err := c.doRequest("json")
  43354. if res != nil && res.StatusCode == http.StatusNotModified {
  43355. if res.Body != nil {
  43356. res.Body.Close()
  43357. }
  43358. return nil, &googleapi.Error{
  43359. Code: res.StatusCode,
  43360. Header: res.Header,
  43361. }
  43362. }
  43363. if err != nil {
  43364. return nil, err
  43365. }
  43366. defer googleapi.CloseBody(res)
  43367. if err := googleapi.CheckResponse(res); err != nil {
  43368. return nil, err
  43369. }
  43370. ret := &TargetingTemplate{
  43371. ServerResponse: googleapi.ServerResponse{
  43372. Header: res.Header,
  43373. HTTPStatusCode: res.StatusCode,
  43374. },
  43375. }
  43376. target := &ret
  43377. if err := gensupport.DecodeResponse(target, res); err != nil {
  43378. return nil, err
  43379. }
  43380. return ret, nil
  43381. // {
  43382. // "description": "Updates an existing targeting template.",
  43383. // "httpMethod": "PUT",
  43384. // "id": "dfareporting.targetingTemplates.update",
  43385. // "parameterOrder": [
  43386. // "profileId"
  43387. // ],
  43388. // "parameters": {
  43389. // "profileId": {
  43390. // "description": "User profile ID associated with this request.",
  43391. // "format": "int64",
  43392. // "location": "path",
  43393. // "required": true,
  43394. // "type": "string"
  43395. // }
  43396. // },
  43397. // "path": "userprofiles/{profileId}/targetingTemplates",
  43398. // "request": {
  43399. // "$ref": "TargetingTemplate"
  43400. // },
  43401. // "response": {
  43402. // "$ref": "TargetingTemplate"
  43403. // },
  43404. // "scopes": [
  43405. // "https://www.googleapis.com/auth/dfatrafficking"
  43406. // ]
  43407. // }
  43408. }
  43409. // method id "dfareporting.userProfiles.get":
  43410. type UserProfilesGetCall struct {
  43411. s *Service
  43412. profileId int64
  43413. urlParams_ gensupport.URLParams
  43414. ifNoneMatch_ string
  43415. ctx_ context.Context
  43416. header_ http.Header
  43417. }
  43418. // Get: Gets one user profile by ID.
  43419. func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall {
  43420. c := &UserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43421. c.profileId = profileId
  43422. return c
  43423. }
  43424. // Fields allows partial responses to be retrieved. See
  43425. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43426. // for more information.
  43427. func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
  43428. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43429. return c
  43430. }
  43431. // IfNoneMatch sets the optional parameter which makes the operation
  43432. // fail if the object's ETag matches the given value. This is useful for
  43433. // getting updates only after the object has changed since the last
  43434. // request. Use googleapi.IsNotModified to check whether the response
  43435. // error from Do is the result of In-None-Match.
  43436. func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
  43437. c.ifNoneMatch_ = entityTag
  43438. return c
  43439. }
  43440. // Context sets the context to be used in this call's Do method. Any
  43441. // pending HTTP request will be aborted if the provided context is
  43442. // canceled.
  43443. func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
  43444. c.ctx_ = ctx
  43445. return c
  43446. }
  43447. // Header returns an http.Header that can be modified by the caller to
  43448. // add HTTP headers to the request.
  43449. func (c *UserProfilesGetCall) Header() http.Header {
  43450. if c.header_ == nil {
  43451. c.header_ = make(http.Header)
  43452. }
  43453. return c.header_
  43454. }
  43455. func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  43456. reqHeaders := make(http.Header)
  43457. for k, v := range c.header_ {
  43458. reqHeaders[k] = v
  43459. }
  43460. reqHeaders.Set("User-Agent", c.s.userAgent())
  43461. if c.ifNoneMatch_ != "" {
  43462. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43463. }
  43464. var body io.Reader = nil
  43465. c.urlParams_.Set("alt", alt)
  43466. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}")
  43467. urls += "?" + c.urlParams_.Encode()
  43468. req, _ := http.NewRequest("GET", urls, body)
  43469. req.Header = reqHeaders
  43470. googleapi.Expand(req.URL, map[string]string{
  43471. "profileId": strconv.FormatInt(c.profileId, 10),
  43472. })
  43473. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43474. }
  43475. // Do executes the "dfareporting.userProfiles.get" call.
  43476. // Exactly one of *UserProfile or error will be non-nil. Any non-2xx
  43477. // status code is an error. Response headers are in either
  43478. // *UserProfile.ServerResponse.Header or (if a response was returned at
  43479. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43480. // to check whether the returned error was because
  43481. // http.StatusNotModified was returned.
  43482. func (c *UserProfilesGetCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
  43483. gensupport.SetOptions(c.urlParams_, opts...)
  43484. res, err := c.doRequest("json")
  43485. if res != nil && res.StatusCode == http.StatusNotModified {
  43486. if res.Body != nil {
  43487. res.Body.Close()
  43488. }
  43489. return nil, &googleapi.Error{
  43490. Code: res.StatusCode,
  43491. Header: res.Header,
  43492. }
  43493. }
  43494. if err != nil {
  43495. return nil, err
  43496. }
  43497. defer googleapi.CloseBody(res)
  43498. if err := googleapi.CheckResponse(res); err != nil {
  43499. return nil, err
  43500. }
  43501. ret := &UserProfile{
  43502. ServerResponse: googleapi.ServerResponse{
  43503. Header: res.Header,
  43504. HTTPStatusCode: res.StatusCode,
  43505. },
  43506. }
  43507. target := &ret
  43508. if err := gensupport.DecodeResponse(target, res); err != nil {
  43509. return nil, err
  43510. }
  43511. return ret, nil
  43512. // {
  43513. // "description": "Gets one user profile by ID.",
  43514. // "httpMethod": "GET",
  43515. // "id": "dfareporting.userProfiles.get",
  43516. // "parameterOrder": [
  43517. // "profileId"
  43518. // ],
  43519. // "parameters": {
  43520. // "profileId": {
  43521. // "description": "The user profile ID.",
  43522. // "format": "int64",
  43523. // "location": "path",
  43524. // "required": true,
  43525. // "type": "string"
  43526. // }
  43527. // },
  43528. // "path": "userprofiles/{profileId}",
  43529. // "response": {
  43530. // "$ref": "UserProfile"
  43531. // },
  43532. // "scopes": [
  43533. // "https://www.googleapis.com/auth/dfareporting",
  43534. // "https://www.googleapis.com/auth/dfatrafficking"
  43535. // ]
  43536. // }
  43537. }
  43538. // method id "dfareporting.userProfiles.list":
  43539. type UserProfilesListCall struct {
  43540. s *Service
  43541. urlParams_ gensupport.URLParams
  43542. ifNoneMatch_ string
  43543. ctx_ context.Context
  43544. header_ http.Header
  43545. }
  43546. // List: Retrieves list of user profiles for a user.
  43547. func (r *UserProfilesService) List() *UserProfilesListCall {
  43548. c := &UserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43549. return c
  43550. }
  43551. // Fields allows partial responses to be retrieved. See
  43552. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43553. // for more information.
  43554. func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall {
  43555. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43556. return c
  43557. }
  43558. // IfNoneMatch sets the optional parameter which makes the operation
  43559. // fail if the object's ETag matches the given value. This is useful for
  43560. // getting updates only after the object has changed since the last
  43561. // request. Use googleapi.IsNotModified to check whether the response
  43562. // error from Do is the result of In-None-Match.
  43563. func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall {
  43564. c.ifNoneMatch_ = entityTag
  43565. return c
  43566. }
  43567. // Context sets the context to be used in this call's Do method. Any
  43568. // pending HTTP request will be aborted if the provided context is
  43569. // canceled.
  43570. func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall {
  43571. c.ctx_ = ctx
  43572. return c
  43573. }
  43574. // Header returns an http.Header that can be modified by the caller to
  43575. // add HTTP headers to the request.
  43576. func (c *UserProfilesListCall) Header() http.Header {
  43577. if c.header_ == nil {
  43578. c.header_ = make(http.Header)
  43579. }
  43580. return c.header_
  43581. }
  43582. func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  43583. reqHeaders := make(http.Header)
  43584. for k, v := range c.header_ {
  43585. reqHeaders[k] = v
  43586. }
  43587. reqHeaders.Set("User-Agent", c.s.userAgent())
  43588. if c.ifNoneMatch_ != "" {
  43589. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43590. }
  43591. var body io.Reader = nil
  43592. c.urlParams_.Set("alt", alt)
  43593. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles")
  43594. urls += "?" + c.urlParams_.Encode()
  43595. req, _ := http.NewRequest("GET", urls, body)
  43596. req.Header = reqHeaders
  43597. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43598. }
  43599. // Do executes the "dfareporting.userProfiles.list" call.
  43600. // Exactly one of *UserProfileList or error will be non-nil. Any non-2xx
  43601. // status code is an error. Response headers are in either
  43602. // *UserProfileList.ServerResponse.Header or (if a response was returned
  43603. // at all) in error.(*googleapi.Error).Header. Use
  43604. // googleapi.IsNotModified to check whether the returned error was
  43605. // because http.StatusNotModified was returned.
  43606. func (c *UserProfilesListCall) Do(opts ...googleapi.CallOption) (*UserProfileList, error) {
  43607. gensupport.SetOptions(c.urlParams_, opts...)
  43608. res, err := c.doRequest("json")
  43609. if res != nil && res.StatusCode == http.StatusNotModified {
  43610. if res.Body != nil {
  43611. res.Body.Close()
  43612. }
  43613. return nil, &googleapi.Error{
  43614. Code: res.StatusCode,
  43615. Header: res.Header,
  43616. }
  43617. }
  43618. if err != nil {
  43619. return nil, err
  43620. }
  43621. defer googleapi.CloseBody(res)
  43622. if err := googleapi.CheckResponse(res); err != nil {
  43623. return nil, err
  43624. }
  43625. ret := &UserProfileList{
  43626. ServerResponse: googleapi.ServerResponse{
  43627. Header: res.Header,
  43628. HTTPStatusCode: res.StatusCode,
  43629. },
  43630. }
  43631. target := &ret
  43632. if err := gensupport.DecodeResponse(target, res); err != nil {
  43633. return nil, err
  43634. }
  43635. return ret, nil
  43636. // {
  43637. // "description": "Retrieves list of user profiles for a user.",
  43638. // "httpMethod": "GET",
  43639. // "id": "dfareporting.userProfiles.list",
  43640. // "path": "userprofiles",
  43641. // "response": {
  43642. // "$ref": "UserProfileList"
  43643. // },
  43644. // "scopes": [
  43645. // "https://www.googleapis.com/auth/dfareporting",
  43646. // "https://www.googleapis.com/auth/dfatrafficking"
  43647. // ]
  43648. // }
  43649. }
  43650. // method id "dfareporting.userRolePermissionGroups.get":
  43651. type UserRolePermissionGroupsGetCall struct {
  43652. s *Service
  43653. profileId int64
  43654. id int64
  43655. urlParams_ gensupport.URLParams
  43656. ifNoneMatch_ string
  43657. ctx_ context.Context
  43658. header_ http.Header
  43659. }
  43660. // Get: Gets one user role permission group by ID.
  43661. func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall {
  43662. c := &UserRolePermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43663. c.profileId = profileId
  43664. c.id = id
  43665. return c
  43666. }
  43667. // Fields allows partial responses to be retrieved. See
  43668. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43669. // for more information.
  43670. func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall {
  43671. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43672. return c
  43673. }
  43674. // IfNoneMatch sets the optional parameter which makes the operation
  43675. // fail if the object's ETag matches the given value. This is useful for
  43676. // getting updates only after the object has changed since the last
  43677. // request. Use googleapi.IsNotModified to check whether the response
  43678. // error from Do is the result of In-None-Match.
  43679. func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall {
  43680. c.ifNoneMatch_ = entityTag
  43681. return c
  43682. }
  43683. // Context sets the context to be used in this call's Do method. Any
  43684. // pending HTTP request will be aborted if the provided context is
  43685. // canceled.
  43686. func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall {
  43687. c.ctx_ = ctx
  43688. return c
  43689. }
  43690. // Header returns an http.Header that can be modified by the caller to
  43691. // add HTTP headers to the request.
  43692. func (c *UserRolePermissionGroupsGetCall) Header() http.Header {
  43693. if c.header_ == nil {
  43694. c.header_ = make(http.Header)
  43695. }
  43696. return c.header_
  43697. }
  43698. func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  43699. reqHeaders := make(http.Header)
  43700. for k, v := range c.header_ {
  43701. reqHeaders[k] = v
  43702. }
  43703. reqHeaders.Set("User-Agent", c.s.userAgent())
  43704. if c.ifNoneMatch_ != "" {
  43705. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43706. }
  43707. var body io.Reader = nil
  43708. c.urlParams_.Set("alt", alt)
  43709. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}")
  43710. urls += "?" + c.urlParams_.Encode()
  43711. req, _ := http.NewRequest("GET", urls, body)
  43712. req.Header = reqHeaders
  43713. googleapi.Expand(req.URL, map[string]string{
  43714. "profileId": strconv.FormatInt(c.profileId, 10),
  43715. "id": strconv.FormatInt(c.id, 10),
  43716. })
  43717. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43718. }
  43719. // Do executes the "dfareporting.userRolePermissionGroups.get" call.
  43720. // Exactly one of *UserRolePermissionGroup or error will be non-nil. Any
  43721. // non-2xx status code is an error. Response headers are in either
  43722. // *UserRolePermissionGroup.ServerResponse.Header or (if a response was
  43723. // returned at all) in error.(*googleapi.Error).Header. Use
  43724. // googleapi.IsNotModified to check whether the returned error was
  43725. // because http.StatusNotModified was returned.
  43726. func (c *UserRolePermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroup, error) {
  43727. gensupport.SetOptions(c.urlParams_, opts...)
  43728. res, err := c.doRequest("json")
  43729. if res != nil && res.StatusCode == http.StatusNotModified {
  43730. if res.Body != nil {
  43731. res.Body.Close()
  43732. }
  43733. return nil, &googleapi.Error{
  43734. Code: res.StatusCode,
  43735. Header: res.Header,
  43736. }
  43737. }
  43738. if err != nil {
  43739. return nil, err
  43740. }
  43741. defer googleapi.CloseBody(res)
  43742. if err := googleapi.CheckResponse(res); err != nil {
  43743. return nil, err
  43744. }
  43745. ret := &UserRolePermissionGroup{
  43746. ServerResponse: googleapi.ServerResponse{
  43747. Header: res.Header,
  43748. HTTPStatusCode: res.StatusCode,
  43749. },
  43750. }
  43751. target := &ret
  43752. if err := gensupport.DecodeResponse(target, res); err != nil {
  43753. return nil, err
  43754. }
  43755. return ret, nil
  43756. // {
  43757. // "description": "Gets one user role permission group by ID.",
  43758. // "httpMethod": "GET",
  43759. // "id": "dfareporting.userRolePermissionGroups.get",
  43760. // "parameterOrder": [
  43761. // "profileId",
  43762. // "id"
  43763. // ],
  43764. // "parameters": {
  43765. // "id": {
  43766. // "description": "User role permission group ID.",
  43767. // "format": "int64",
  43768. // "location": "path",
  43769. // "required": true,
  43770. // "type": "string"
  43771. // },
  43772. // "profileId": {
  43773. // "description": "User profile ID associated with this request.",
  43774. // "format": "int64",
  43775. // "location": "path",
  43776. // "required": true,
  43777. // "type": "string"
  43778. // }
  43779. // },
  43780. // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}",
  43781. // "response": {
  43782. // "$ref": "UserRolePermissionGroup"
  43783. // },
  43784. // "scopes": [
  43785. // "https://www.googleapis.com/auth/dfatrafficking"
  43786. // ]
  43787. // }
  43788. }
  43789. // method id "dfareporting.userRolePermissionGroups.list":
  43790. type UserRolePermissionGroupsListCall struct {
  43791. s *Service
  43792. profileId int64
  43793. urlParams_ gensupport.URLParams
  43794. ifNoneMatch_ string
  43795. ctx_ context.Context
  43796. header_ http.Header
  43797. }
  43798. // List: Gets a list of all supported user role permission groups.
  43799. func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall {
  43800. c := &UserRolePermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43801. c.profileId = profileId
  43802. return c
  43803. }
  43804. // Fields allows partial responses to be retrieved. See
  43805. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43806. // for more information.
  43807. func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall {
  43808. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43809. return c
  43810. }
  43811. // IfNoneMatch sets the optional parameter which makes the operation
  43812. // fail if the object's ETag matches the given value. This is useful for
  43813. // getting updates only after the object has changed since the last
  43814. // request. Use googleapi.IsNotModified to check whether the response
  43815. // error from Do is the result of In-None-Match.
  43816. func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall {
  43817. c.ifNoneMatch_ = entityTag
  43818. return c
  43819. }
  43820. // Context sets the context to be used in this call's Do method. Any
  43821. // pending HTTP request will be aborted if the provided context is
  43822. // canceled.
  43823. func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall {
  43824. c.ctx_ = ctx
  43825. return c
  43826. }
  43827. // Header returns an http.Header that can be modified by the caller to
  43828. // add HTTP headers to the request.
  43829. func (c *UserRolePermissionGroupsListCall) Header() http.Header {
  43830. if c.header_ == nil {
  43831. c.header_ = make(http.Header)
  43832. }
  43833. return c.header_
  43834. }
  43835. func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  43836. reqHeaders := make(http.Header)
  43837. for k, v := range c.header_ {
  43838. reqHeaders[k] = v
  43839. }
  43840. reqHeaders.Set("User-Agent", c.s.userAgent())
  43841. if c.ifNoneMatch_ != "" {
  43842. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43843. }
  43844. var body io.Reader = nil
  43845. c.urlParams_.Set("alt", alt)
  43846. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups")
  43847. urls += "?" + c.urlParams_.Encode()
  43848. req, _ := http.NewRequest("GET", urls, body)
  43849. req.Header = reqHeaders
  43850. googleapi.Expand(req.URL, map[string]string{
  43851. "profileId": strconv.FormatInt(c.profileId, 10),
  43852. })
  43853. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43854. }
  43855. // Do executes the "dfareporting.userRolePermissionGroups.list" call.
  43856. // Exactly one of *UserRolePermissionGroupsListResponse or error will be
  43857. // non-nil. Any non-2xx status code is an error. Response headers are in
  43858. // either *UserRolePermissionGroupsListResponse.ServerResponse.Header or
  43859. // (if a response was returned at all) in
  43860. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  43861. // whether the returned error was because http.StatusNotModified was
  43862. // returned.
  43863. func (c *UserRolePermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroupsListResponse, error) {
  43864. gensupport.SetOptions(c.urlParams_, opts...)
  43865. res, err := c.doRequest("json")
  43866. if res != nil && res.StatusCode == http.StatusNotModified {
  43867. if res.Body != nil {
  43868. res.Body.Close()
  43869. }
  43870. return nil, &googleapi.Error{
  43871. Code: res.StatusCode,
  43872. Header: res.Header,
  43873. }
  43874. }
  43875. if err != nil {
  43876. return nil, err
  43877. }
  43878. defer googleapi.CloseBody(res)
  43879. if err := googleapi.CheckResponse(res); err != nil {
  43880. return nil, err
  43881. }
  43882. ret := &UserRolePermissionGroupsListResponse{
  43883. ServerResponse: googleapi.ServerResponse{
  43884. Header: res.Header,
  43885. HTTPStatusCode: res.StatusCode,
  43886. },
  43887. }
  43888. target := &ret
  43889. if err := gensupport.DecodeResponse(target, res); err != nil {
  43890. return nil, err
  43891. }
  43892. return ret, nil
  43893. // {
  43894. // "description": "Gets a list of all supported user role permission groups.",
  43895. // "httpMethod": "GET",
  43896. // "id": "dfareporting.userRolePermissionGroups.list",
  43897. // "parameterOrder": [
  43898. // "profileId"
  43899. // ],
  43900. // "parameters": {
  43901. // "profileId": {
  43902. // "description": "User profile ID associated with this request.",
  43903. // "format": "int64",
  43904. // "location": "path",
  43905. // "required": true,
  43906. // "type": "string"
  43907. // }
  43908. // },
  43909. // "path": "userprofiles/{profileId}/userRolePermissionGroups",
  43910. // "response": {
  43911. // "$ref": "UserRolePermissionGroupsListResponse"
  43912. // },
  43913. // "scopes": [
  43914. // "https://www.googleapis.com/auth/dfatrafficking"
  43915. // ]
  43916. // }
  43917. }
  43918. // method id "dfareporting.userRolePermissions.get":
  43919. type UserRolePermissionsGetCall struct {
  43920. s *Service
  43921. profileId int64
  43922. id int64
  43923. urlParams_ gensupport.URLParams
  43924. ifNoneMatch_ string
  43925. ctx_ context.Context
  43926. header_ http.Header
  43927. }
  43928. // Get: Gets one user role permission by ID.
  43929. func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall {
  43930. c := &UserRolePermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43931. c.profileId = profileId
  43932. c.id = id
  43933. return c
  43934. }
  43935. // Fields allows partial responses to be retrieved. See
  43936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43937. // for more information.
  43938. func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall {
  43939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43940. return c
  43941. }
  43942. // IfNoneMatch sets the optional parameter which makes the operation
  43943. // fail if the object's ETag matches the given value. This is useful for
  43944. // getting updates only after the object has changed since the last
  43945. // request. Use googleapi.IsNotModified to check whether the response
  43946. // error from Do is the result of In-None-Match.
  43947. func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall {
  43948. c.ifNoneMatch_ = entityTag
  43949. return c
  43950. }
  43951. // Context sets the context to be used in this call's Do method. Any
  43952. // pending HTTP request will be aborted if the provided context is
  43953. // canceled.
  43954. func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall {
  43955. c.ctx_ = ctx
  43956. return c
  43957. }
  43958. // Header returns an http.Header that can be modified by the caller to
  43959. // add HTTP headers to the request.
  43960. func (c *UserRolePermissionsGetCall) Header() http.Header {
  43961. if c.header_ == nil {
  43962. c.header_ = make(http.Header)
  43963. }
  43964. return c.header_
  43965. }
  43966. func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  43967. reqHeaders := make(http.Header)
  43968. for k, v := range c.header_ {
  43969. reqHeaders[k] = v
  43970. }
  43971. reqHeaders.Set("User-Agent", c.s.userAgent())
  43972. if c.ifNoneMatch_ != "" {
  43973. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43974. }
  43975. var body io.Reader = nil
  43976. c.urlParams_.Set("alt", alt)
  43977. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}")
  43978. urls += "?" + c.urlParams_.Encode()
  43979. req, _ := http.NewRequest("GET", urls, body)
  43980. req.Header = reqHeaders
  43981. googleapi.Expand(req.URL, map[string]string{
  43982. "profileId": strconv.FormatInt(c.profileId, 10),
  43983. "id": strconv.FormatInt(c.id, 10),
  43984. })
  43985. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43986. }
  43987. // Do executes the "dfareporting.userRolePermissions.get" call.
  43988. // Exactly one of *UserRolePermission or error will be non-nil. Any
  43989. // non-2xx status code is an error. Response headers are in either
  43990. // *UserRolePermission.ServerResponse.Header or (if a response was
  43991. // returned at all) in error.(*googleapi.Error).Header. Use
  43992. // googleapi.IsNotModified to check whether the returned error was
  43993. // because http.StatusNotModified was returned.
  43994. func (c *UserRolePermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermission, error) {
  43995. gensupport.SetOptions(c.urlParams_, opts...)
  43996. res, err := c.doRequest("json")
  43997. if res != nil && res.StatusCode == http.StatusNotModified {
  43998. if res.Body != nil {
  43999. res.Body.Close()
  44000. }
  44001. return nil, &googleapi.Error{
  44002. Code: res.StatusCode,
  44003. Header: res.Header,
  44004. }
  44005. }
  44006. if err != nil {
  44007. return nil, err
  44008. }
  44009. defer googleapi.CloseBody(res)
  44010. if err := googleapi.CheckResponse(res); err != nil {
  44011. return nil, err
  44012. }
  44013. ret := &UserRolePermission{
  44014. ServerResponse: googleapi.ServerResponse{
  44015. Header: res.Header,
  44016. HTTPStatusCode: res.StatusCode,
  44017. },
  44018. }
  44019. target := &ret
  44020. if err := gensupport.DecodeResponse(target, res); err != nil {
  44021. return nil, err
  44022. }
  44023. return ret, nil
  44024. // {
  44025. // "description": "Gets one user role permission by ID.",
  44026. // "httpMethod": "GET",
  44027. // "id": "dfareporting.userRolePermissions.get",
  44028. // "parameterOrder": [
  44029. // "profileId",
  44030. // "id"
  44031. // ],
  44032. // "parameters": {
  44033. // "id": {
  44034. // "description": "User role permission ID.",
  44035. // "format": "int64",
  44036. // "location": "path",
  44037. // "required": true,
  44038. // "type": "string"
  44039. // },
  44040. // "profileId": {
  44041. // "description": "User profile ID associated with this request.",
  44042. // "format": "int64",
  44043. // "location": "path",
  44044. // "required": true,
  44045. // "type": "string"
  44046. // }
  44047. // },
  44048. // "path": "userprofiles/{profileId}/userRolePermissions/{id}",
  44049. // "response": {
  44050. // "$ref": "UserRolePermission"
  44051. // },
  44052. // "scopes": [
  44053. // "https://www.googleapis.com/auth/dfatrafficking"
  44054. // ]
  44055. // }
  44056. }
  44057. // method id "dfareporting.userRolePermissions.list":
  44058. type UserRolePermissionsListCall struct {
  44059. s *Service
  44060. profileId int64
  44061. urlParams_ gensupport.URLParams
  44062. ifNoneMatch_ string
  44063. ctx_ context.Context
  44064. header_ http.Header
  44065. }
  44066. // List: Gets a list of user role permissions, possibly filtered.
  44067. func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall {
  44068. c := &UserRolePermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44069. c.profileId = profileId
  44070. return c
  44071. }
  44072. // Ids sets the optional parameter "ids": Select only user role
  44073. // permissions with these IDs.
  44074. func (c *UserRolePermissionsListCall) Ids(ids ...int64) *UserRolePermissionsListCall {
  44075. var ids_ []string
  44076. for _, v := range ids {
  44077. ids_ = append(ids_, fmt.Sprint(v))
  44078. }
  44079. c.urlParams_.SetMulti("ids", ids_)
  44080. return c
  44081. }
  44082. // Fields allows partial responses to be retrieved. See
  44083. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44084. // for more information.
  44085. func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall {
  44086. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44087. return c
  44088. }
  44089. // IfNoneMatch sets the optional parameter which makes the operation
  44090. // fail if the object's ETag matches the given value. This is useful for
  44091. // getting updates only after the object has changed since the last
  44092. // request. Use googleapi.IsNotModified to check whether the response
  44093. // error from Do is the result of In-None-Match.
  44094. func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall {
  44095. c.ifNoneMatch_ = entityTag
  44096. return c
  44097. }
  44098. // Context sets the context to be used in this call's Do method. Any
  44099. // pending HTTP request will be aborted if the provided context is
  44100. // canceled.
  44101. func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall {
  44102. c.ctx_ = ctx
  44103. return c
  44104. }
  44105. // Header returns an http.Header that can be modified by the caller to
  44106. // add HTTP headers to the request.
  44107. func (c *UserRolePermissionsListCall) Header() http.Header {
  44108. if c.header_ == nil {
  44109. c.header_ = make(http.Header)
  44110. }
  44111. return c.header_
  44112. }
  44113. func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) {
  44114. reqHeaders := make(http.Header)
  44115. for k, v := range c.header_ {
  44116. reqHeaders[k] = v
  44117. }
  44118. reqHeaders.Set("User-Agent", c.s.userAgent())
  44119. if c.ifNoneMatch_ != "" {
  44120. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44121. }
  44122. var body io.Reader = nil
  44123. c.urlParams_.Set("alt", alt)
  44124. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions")
  44125. urls += "?" + c.urlParams_.Encode()
  44126. req, _ := http.NewRequest("GET", urls, body)
  44127. req.Header = reqHeaders
  44128. googleapi.Expand(req.URL, map[string]string{
  44129. "profileId": strconv.FormatInt(c.profileId, 10),
  44130. })
  44131. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44132. }
  44133. // Do executes the "dfareporting.userRolePermissions.list" call.
  44134. // Exactly one of *UserRolePermissionsListResponse or error will be
  44135. // non-nil. Any non-2xx status code is an error. Response headers are in
  44136. // either *UserRolePermissionsListResponse.ServerResponse.Header or (if
  44137. // a response was returned at all) in error.(*googleapi.Error).Header.
  44138. // Use googleapi.IsNotModified to check whether the returned error was
  44139. // because http.StatusNotModified was returned.
  44140. func (c *UserRolePermissionsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionsListResponse, error) {
  44141. gensupport.SetOptions(c.urlParams_, opts...)
  44142. res, err := c.doRequest("json")
  44143. if res != nil && res.StatusCode == http.StatusNotModified {
  44144. if res.Body != nil {
  44145. res.Body.Close()
  44146. }
  44147. return nil, &googleapi.Error{
  44148. Code: res.StatusCode,
  44149. Header: res.Header,
  44150. }
  44151. }
  44152. if err != nil {
  44153. return nil, err
  44154. }
  44155. defer googleapi.CloseBody(res)
  44156. if err := googleapi.CheckResponse(res); err != nil {
  44157. return nil, err
  44158. }
  44159. ret := &UserRolePermissionsListResponse{
  44160. ServerResponse: googleapi.ServerResponse{
  44161. Header: res.Header,
  44162. HTTPStatusCode: res.StatusCode,
  44163. },
  44164. }
  44165. target := &ret
  44166. if err := gensupport.DecodeResponse(target, res); err != nil {
  44167. return nil, err
  44168. }
  44169. return ret, nil
  44170. // {
  44171. // "description": "Gets a list of user role permissions, possibly filtered.",
  44172. // "httpMethod": "GET",
  44173. // "id": "dfareporting.userRolePermissions.list",
  44174. // "parameterOrder": [
  44175. // "profileId"
  44176. // ],
  44177. // "parameters": {
  44178. // "ids": {
  44179. // "description": "Select only user role permissions with these IDs.",
  44180. // "format": "int64",
  44181. // "location": "query",
  44182. // "repeated": true,
  44183. // "type": "string"
  44184. // },
  44185. // "profileId": {
  44186. // "description": "User profile ID associated with this request.",
  44187. // "format": "int64",
  44188. // "location": "path",
  44189. // "required": true,
  44190. // "type": "string"
  44191. // }
  44192. // },
  44193. // "path": "userprofiles/{profileId}/userRolePermissions",
  44194. // "response": {
  44195. // "$ref": "UserRolePermissionsListResponse"
  44196. // },
  44197. // "scopes": [
  44198. // "https://www.googleapis.com/auth/dfatrafficking"
  44199. // ]
  44200. // }
  44201. }
  44202. // method id "dfareporting.userRoles.delete":
  44203. type UserRolesDeleteCall struct {
  44204. s *Service
  44205. profileId int64
  44206. id int64
  44207. urlParams_ gensupport.URLParams
  44208. ctx_ context.Context
  44209. header_ http.Header
  44210. }
  44211. // Delete: Deletes an existing user role.
  44212. func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall {
  44213. c := &UserRolesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44214. c.profileId = profileId
  44215. c.id = id
  44216. return c
  44217. }
  44218. // Fields allows partial responses to be retrieved. See
  44219. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44220. // for more information.
  44221. func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall {
  44222. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44223. return c
  44224. }
  44225. // Context sets the context to be used in this call's Do method. Any
  44226. // pending HTTP request will be aborted if the provided context is
  44227. // canceled.
  44228. func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall {
  44229. c.ctx_ = ctx
  44230. return c
  44231. }
  44232. // Header returns an http.Header that can be modified by the caller to
  44233. // add HTTP headers to the request.
  44234. func (c *UserRolesDeleteCall) Header() http.Header {
  44235. if c.header_ == nil {
  44236. c.header_ = make(http.Header)
  44237. }
  44238. return c.header_
  44239. }
  44240. func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) {
  44241. reqHeaders := make(http.Header)
  44242. for k, v := range c.header_ {
  44243. reqHeaders[k] = v
  44244. }
  44245. reqHeaders.Set("User-Agent", c.s.userAgent())
  44246. var body io.Reader = nil
  44247. c.urlParams_.Set("alt", alt)
  44248. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  44249. urls += "?" + c.urlParams_.Encode()
  44250. req, _ := http.NewRequest("DELETE", urls, body)
  44251. req.Header = reqHeaders
  44252. googleapi.Expand(req.URL, map[string]string{
  44253. "profileId": strconv.FormatInt(c.profileId, 10),
  44254. "id": strconv.FormatInt(c.id, 10),
  44255. })
  44256. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44257. }
  44258. // Do executes the "dfareporting.userRoles.delete" call.
  44259. func (c *UserRolesDeleteCall) Do(opts ...googleapi.CallOption) error {
  44260. gensupport.SetOptions(c.urlParams_, opts...)
  44261. res, err := c.doRequest("json")
  44262. if err != nil {
  44263. return err
  44264. }
  44265. defer googleapi.CloseBody(res)
  44266. if err := googleapi.CheckResponse(res); err != nil {
  44267. return err
  44268. }
  44269. return nil
  44270. // {
  44271. // "description": "Deletes an existing user role.",
  44272. // "httpMethod": "DELETE",
  44273. // "id": "dfareporting.userRoles.delete",
  44274. // "parameterOrder": [
  44275. // "profileId",
  44276. // "id"
  44277. // ],
  44278. // "parameters": {
  44279. // "id": {
  44280. // "description": "User role ID.",
  44281. // "format": "int64",
  44282. // "location": "path",
  44283. // "required": true,
  44284. // "type": "string"
  44285. // },
  44286. // "profileId": {
  44287. // "description": "User profile ID associated with this request.",
  44288. // "format": "int64",
  44289. // "location": "path",
  44290. // "required": true,
  44291. // "type": "string"
  44292. // }
  44293. // },
  44294. // "path": "userprofiles/{profileId}/userRoles/{id}",
  44295. // "scopes": [
  44296. // "https://www.googleapis.com/auth/dfatrafficking"
  44297. // ]
  44298. // }
  44299. }
  44300. // method id "dfareporting.userRoles.get":
  44301. type UserRolesGetCall struct {
  44302. s *Service
  44303. profileId int64
  44304. id int64
  44305. urlParams_ gensupport.URLParams
  44306. ifNoneMatch_ string
  44307. ctx_ context.Context
  44308. header_ http.Header
  44309. }
  44310. // Get: Gets one user role by ID.
  44311. func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall {
  44312. c := &UserRolesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44313. c.profileId = profileId
  44314. c.id = id
  44315. return c
  44316. }
  44317. // Fields allows partial responses to be retrieved. See
  44318. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44319. // for more information.
  44320. func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall {
  44321. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44322. return c
  44323. }
  44324. // IfNoneMatch sets the optional parameter which makes the operation
  44325. // fail if the object's ETag matches the given value. This is useful for
  44326. // getting updates only after the object has changed since the last
  44327. // request. Use googleapi.IsNotModified to check whether the response
  44328. // error from Do is the result of In-None-Match.
  44329. func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall {
  44330. c.ifNoneMatch_ = entityTag
  44331. return c
  44332. }
  44333. // Context sets the context to be used in this call's Do method. Any
  44334. // pending HTTP request will be aborted if the provided context is
  44335. // canceled.
  44336. func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall {
  44337. c.ctx_ = ctx
  44338. return c
  44339. }
  44340. // Header returns an http.Header that can be modified by the caller to
  44341. // add HTTP headers to the request.
  44342. func (c *UserRolesGetCall) Header() http.Header {
  44343. if c.header_ == nil {
  44344. c.header_ = make(http.Header)
  44345. }
  44346. return c.header_
  44347. }
  44348. func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) {
  44349. reqHeaders := make(http.Header)
  44350. for k, v := range c.header_ {
  44351. reqHeaders[k] = v
  44352. }
  44353. reqHeaders.Set("User-Agent", c.s.userAgent())
  44354. if c.ifNoneMatch_ != "" {
  44355. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44356. }
  44357. var body io.Reader = nil
  44358. c.urlParams_.Set("alt", alt)
  44359. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  44360. urls += "?" + c.urlParams_.Encode()
  44361. req, _ := http.NewRequest("GET", urls, body)
  44362. req.Header = reqHeaders
  44363. googleapi.Expand(req.URL, map[string]string{
  44364. "profileId": strconv.FormatInt(c.profileId, 10),
  44365. "id": strconv.FormatInt(c.id, 10),
  44366. })
  44367. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44368. }
  44369. // Do executes the "dfareporting.userRoles.get" call.
  44370. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44371. // code is an error. Response headers are in either
  44372. // *UserRole.ServerResponse.Header or (if a response was returned at
  44373. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44374. // to check whether the returned error was because
  44375. // http.StatusNotModified was returned.
  44376. func (c *UserRolesGetCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44377. gensupport.SetOptions(c.urlParams_, opts...)
  44378. res, err := c.doRequest("json")
  44379. if res != nil && res.StatusCode == http.StatusNotModified {
  44380. if res.Body != nil {
  44381. res.Body.Close()
  44382. }
  44383. return nil, &googleapi.Error{
  44384. Code: res.StatusCode,
  44385. Header: res.Header,
  44386. }
  44387. }
  44388. if err != nil {
  44389. return nil, err
  44390. }
  44391. defer googleapi.CloseBody(res)
  44392. if err := googleapi.CheckResponse(res); err != nil {
  44393. return nil, err
  44394. }
  44395. ret := &UserRole{
  44396. ServerResponse: googleapi.ServerResponse{
  44397. Header: res.Header,
  44398. HTTPStatusCode: res.StatusCode,
  44399. },
  44400. }
  44401. target := &ret
  44402. if err := gensupport.DecodeResponse(target, res); err != nil {
  44403. return nil, err
  44404. }
  44405. return ret, nil
  44406. // {
  44407. // "description": "Gets one user role by ID.",
  44408. // "httpMethod": "GET",
  44409. // "id": "dfareporting.userRoles.get",
  44410. // "parameterOrder": [
  44411. // "profileId",
  44412. // "id"
  44413. // ],
  44414. // "parameters": {
  44415. // "id": {
  44416. // "description": "User role ID.",
  44417. // "format": "int64",
  44418. // "location": "path",
  44419. // "required": true,
  44420. // "type": "string"
  44421. // },
  44422. // "profileId": {
  44423. // "description": "User profile ID associated with this request.",
  44424. // "format": "int64",
  44425. // "location": "path",
  44426. // "required": true,
  44427. // "type": "string"
  44428. // }
  44429. // },
  44430. // "path": "userprofiles/{profileId}/userRoles/{id}",
  44431. // "response": {
  44432. // "$ref": "UserRole"
  44433. // },
  44434. // "scopes": [
  44435. // "https://www.googleapis.com/auth/dfatrafficking"
  44436. // ]
  44437. // }
  44438. }
  44439. // method id "dfareporting.userRoles.insert":
  44440. type UserRolesInsertCall struct {
  44441. s *Service
  44442. profileId int64
  44443. userrole *UserRole
  44444. urlParams_ gensupport.URLParams
  44445. ctx_ context.Context
  44446. header_ http.Header
  44447. }
  44448. // Insert: Inserts a new user role.
  44449. func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall {
  44450. c := &UserRolesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44451. c.profileId = profileId
  44452. c.userrole = userrole
  44453. return c
  44454. }
  44455. // Fields allows partial responses to be retrieved. See
  44456. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44457. // for more information.
  44458. func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall {
  44459. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44460. return c
  44461. }
  44462. // Context sets the context to be used in this call's Do method. Any
  44463. // pending HTTP request will be aborted if the provided context is
  44464. // canceled.
  44465. func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall {
  44466. c.ctx_ = ctx
  44467. return c
  44468. }
  44469. // Header returns an http.Header that can be modified by the caller to
  44470. // add HTTP headers to the request.
  44471. func (c *UserRolesInsertCall) Header() http.Header {
  44472. if c.header_ == nil {
  44473. c.header_ = make(http.Header)
  44474. }
  44475. return c.header_
  44476. }
  44477. func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) {
  44478. reqHeaders := make(http.Header)
  44479. for k, v := range c.header_ {
  44480. reqHeaders[k] = v
  44481. }
  44482. reqHeaders.Set("User-Agent", c.s.userAgent())
  44483. var body io.Reader = nil
  44484. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  44485. if err != nil {
  44486. return nil, err
  44487. }
  44488. reqHeaders.Set("Content-Type", "application/json")
  44489. c.urlParams_.Set("alt", alt)
  44490. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44491. urls += "?" + c.urlParams_.Encode()
  44492. req, _ := http.NewRequest("POST", urls, body)
  44493. req.Header = reqHeaders
  44494. googleapi.Expand(req.URL, map[string]string{
  44495. "profileId": strconv.FormatInt(c.profileId, 10),
  44496. })
  44497. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44498. }
  44499. // Do executes the "dfareporting.userRoles.insert" call.
  44500. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44501. // code is an error. Response headers are in either
  44502. // *UserRole.ServerResponse.Header or (if a response was returned at
  44503. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44504. // to check whether the returned error was because
  44505. // http.StatusNotModified was returned.
  44506. func (c *UserRolesInsertCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44507. gensupport.SetOptions(c.urlParams_, opts...)
  44508. res, err := c.doRequest("json")
  44509. if res != nil && res.StatusCode == http.StatusNotModified {
  44510. if res.Body != nil {
  44511. res.Body.Close()
  44512. }
  44513. return nil, &googleapi.Error{
  44514. Code: res.StatusCode,
  44515. Header: res.Header,
  44516. }
  44517. }
  44518. if err != nil {
  44519. return nil, err
  44520. }
  44521. defer googleapi.CloseBody(res)
  44522. if err := googleapi.CheckResponse(res); err != nil {
  44523. return nil, err
  44524. }
  44525. ret := &UserRole{
  44526. ServerResponse: googleapi.ServerResponse{
  44527. Header: res.Header,
  44528. HTTPStatusCode: res.StatusCode,
  44529. },
  44530. }
  44531. target := &ret
  44532. if err := gensupport.DecodeResponse(target, res); err != nil {
  44533. return nil, err
  44534. }
  44535. return ret, nil
  44536. // {
  44537. // "description": "Inserts a new user role.",
  44538. // "httpMethod": "POST",
  44539. // "id": "dfareporting.userRoles.insert",
  44540. // "parameterOrder": [
  44541. // "profileId"
  44542. // ],
  44543. // "parameters": {
  44544. // "profileId": {
  44545. // "description": "User profile ID associated with this request.",
  44546. // "format": "int64",
  44547. // "location": "path",
  44548. // "required": true,
  44549. // "type": "string"
  44550. // }
  44551. // },
  44552. // "path": "userprofiles/{profileId}/userRoles",
  44553. // "request": {
  44554. // "$ref": "UserRole"
  44555. // },
  44556. // "response": {
  44557. // "$ref": "UserRole"
  44558. // },
  44559. // "scopes": [
  44560. // "https://www.googleapis.com/auth/dfatrafficking"
  44561. // ]
  44562. // }
  44563. }
  44564. // method id "dfareporting.userRoles.list":
  44565. type UserRolesListCall struct {
  44566. s *Service
  44567. profileId int64
  44568. urlParams_ gensupport.URLParams
  44569. ifNoneMatch_ string
  44570. ctx_ context.Context
  44571. header_ http.Header
  44572. }
  44573. // List: Retrieves a list of user roles, possibly filtered. This method
  44574. // supports paging.
  44575. func (r *UserRolesService) List(profileId int64) *UserRolesListCall {
  44576. c := &UserRolesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44577. c.profileId = profileId
  44578. return c
  44579. }
  44580. // AccountUserRoleOnly sets the optional parameter
  44581. // "accountUserRoleOnly": Select only account level user roles not
  44582. // associated with any specific subaccount.
  44583. func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall {
  44584. c.urlParams_.Set("accountUserRoleOnly", fmt.Sprint(accountUserRoleOnly))
  44585. return c
  44586. }
  44587. // Ids sets the optional parameter "ids": Select only user roles with
  44588. // the specified IDs.
  44589. func (c *UserRolesListCall) Ids(ids ...int64) *UserRolesListCall {
  44590. var ids_ []string
  44591. for _, v := range ids {
  44592. ids_ = append(ids_, fmt.Sprint(v))
  44593. }
  44594. c.urlParams_.SetMulti("ids", ids_)
  44595. return c
  44596. }
  44597. // MaxResults sets the optional parameter "maxResults": Maximum number
  44598. // of results to return.
  44599. func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall {
  44600. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44601. return c
  44602. }
  44603. // PageToken sets the optional parameter "pageToken": Value of the
  44604. // nextPageToken from the previous result page.
  44605. func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall {
  44606. c.urlParams_.Set("pageToken", pageToken)
  44607. return c
  44608. }
  44609. // SearchString sets the optional parameter "searchString": Allows
  44610. // searching for objects by name or ID. Wildcards (*) are allowed. For
  44611. // example, "userrole*2015" will return objects with names like
  44612. // "userrole June 2015", "userrole April 2015", or simply "userrole
  44613. // 2015". Most of the searches also add wildcards implicitly at the
  44614. // start and the end of the search string. For example, a search string
  44615. // of "userrole" will match objects with name "my userrole", "userrole
  44616. // 2015", or simply "userrole".
  44617. func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall {
  44618. c.urlParams_.Set("searchString", searchString)
  44619. return c
  44620. }
  44621. // SortField sets the optional parameter "sortField": Field by which to
  44622. // sort the list.
  44623. //
  44624. // Possible values:
  44625. // "ID" (default)
  44626. // "NAME"
  44627. func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall {
  44628. c.urlParams_.Set("sortField", sortField)
  44629. return c
  44630. }
  44631. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  44632. // results.
  44633. //
  44634. // Possible values:
  44635. // "ASCENDING" (default)
  44636. // "DESCENDING"
  44637. func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall {
  44638. c.urlParams_.Set("sortOrder", sortOrder)
  44639. return c
  44640. }
  44641. // SubaccountId sets the optional parameter "subaccountId": Select only
  44642. // user roles that belong to this subaccount.
  44643. func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall {
  44644. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  44645. return c
  44646. }
  44647. // Fields allows partial responses to be retrieved. See
  44648. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44649. // for more information.
  44650. func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall {
  44651. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44652. return c
  44653. }
  44654. // IfNoneMatch sets the optional parameter which makes the operation
  44655. // fail if the object's ETag matches the given value. This is useful for
  44656. // getting updates only after the object has changed since the last
  44657. // request. Use googleapi.IsNotModified to check whether the response
  44658. // error from Do is the result of In-None-Match.
  44659. func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall {
  44660. c.ifNoneMatch_ = entityTag
  44661. return c
  44662. }
  44663. // Context sets the context to be used in this call's Do method. Any
  44664. // pending HTTP request will be aborted if the provided context is
  44665. // canceled.
  44666. func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall {
  44667. c.ctx_ = ctx
  44668. return c
  44669. }
  44670. // Header returns an http.Header that can be modified by the caller to
  44671. // add HTTP headers to the request.
  44672. func (c *UserRolesListCall) Header() http.Header {
  44673. if c.header_ == nil {
  44674. c.header_ = make(http.Header)
  44675. }
  44676. return c.header_
  44677. }
  44678. func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) {
  44679. reqHeaders := make(http.Header)
  44680. for k, v := range c.header_ {
  44681. reqHeaders[k] = v
  44682. }
  44683. reqHeaders.Set("User-Agent", c.s.userAgent())
  44684. if c.ifNoneMatch_ != "" {
  44685. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44686. }
  44687. var body io.Reader = nil
  44688. c.urlParams_.Set("alt", alt)
  44689. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44690. urls += "?" + c.urlParams_.Encode()
  44691. req, _ := http.NewRequest("GET", urls, body)
  44692. req.Header = reqHeaders
  44693. googleapi.Expand(req.URL, map[string]string{
  44694. "profileId": strconv.FormatInt(c.profileId, 10),
  44695. })
  44696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44697. }
  44698. // Do executes the "dfareporting.userRoles.list" call.
  44699. // Exactly one of *UserRolesListResponse or error will be non-nil. Any
  44700. // non-2xx status code is an error. Response headers are in either
  44701. // *UserRolesListResponse.ServerResponse.Header or (if a response was
  44702. // returned at all) in error.(*googleapi.Error).Header. Use
  44703. // googleapi.IsNotModified to check whether the returned error was
  44704. // because http.StatusNotModified was returned.
  44705. func (c *UserRolesListCall) Do(opts ...googleapi.CallOption) (*UserRolesListResponse, error) {
  44706. gensupport.SetOptions(c.urlParams_, opts...)
  44707. res, err := c.doRequest("json")
  44708. if res != nil && res.StatusCode == http.StatusNotModified {
  44709. if res.Body != nil {
  44710. res.Body.Close()
  44711. }
  44712. return nil, &googleapi.Error{
  44713. Code: res.StatusCode,
  44714. Header: res.Header,
  44715. }
  44716. }
  44717. if err != nil {
  44718. return nil, err
  44719. }
  44720. defer googleapi.CloseBody(res)
  44721. if err := googleapi.CheckResponse(res); err != nil {
  44722. return nil, err
  44723. }
  44724. ret := &UserRolesListResponse{
  44725. ServerResponse: googleapi.ServerResponse{
  44726. Header: res.Header,
  44727. HTTPStatusCode: res.StatusCode,
  44728. },
  44729. }
  44730. target := &ret
  44731. if err := gensupport.DecodeResponse(target, res); err != nil {
  44732. return nil, err
  44733. }
  44734. return ret, nil
  44735. // {
  44736. // "description": "Retrieves a list of user roles, possibly filtered. This method supports paging.",
  44737. // "httpMethod": "GET",
  44738. // "id": "dfareporting.userRoles.list",
  44739. // "parameterOrder": [
  44740. // "profileId"
  44741. // ],
  44742. // "parameters": {
  44743. // "accountUserRoleOnly": {
  44744. // "description": "Select only account level user roles not associated with any specific subaccount.",
  44745. // "location": "query",
  44746. // "type": "boolean"
  44747. // },
  44748. // "ids": {
  44749. // "description": "Select only user roles with the specified IDs.",
  44750. // "format": "int64",
  44751. // "location": "query",
  44752. // "repeated": true,
  44753. // "type": "string"
  44754. // },
  44755. // "maxResults": {
  44756. // "default": "1000",
  44757. // "description": "Maximum number of results to return.",
  44758. // "format": "int32",
  44759. // "location": "query",
  44760. // "maximum": "1000",
  44761. // "minimum": "0",
  44762. // "type": "integer"
  44763. // },
  44764. // "pageToken": {
  44765. // "description": "Value of the nextPageToken from the previous result page.",
  44766. // "location": "query",
  44767. // "type": "string"
  44768. // },
  44769. // "profileId": {
  44770. // "description": "User profile ID associated with this request.",
  44771. // "format": "int64",
  44772. // "location": "path",
  44773. // "required": true,
  44774. // "type": "string"
  44775. // },
  44776. // "searchString": {
  44777. // "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\".",
  44778. // "location": "query",
  44779. // "type": "string"
  44780. // },
  44781. // "sortField": {
  44782. // "default": "ID",
  44783. // "description": "Field by which to sort the list.",
  44784. // "enum": [
  44785. // "ID",
  44786. // "NAME"
  44787. // ],
  44788. // "enumDescriptions": [
  44789. // "",
  44790. // ""
  44791. // ],
  44792. // "location": "query",
  44793. // "type": "string"
  44794. // },
  44795. // "sortOrder": {
  44796. // "default": "ASCENDING",
  44797. // "description": "Order of sorted results.",
  44798. // "enum": [
  44799. // "ASCENDING",
  44800. // "DESCENDING"
  44801. // ],
  44802. // "enumDescriptions": [
  44803. // "",
  44804. // ""
  44805. // ],
  44806. // "location": "query",
  44807. // "type": "string"
  44808. // },
  44809. // "subaccountId": {
  44810. // "description": "Select only user roles that belong to this subaccount.",
  44811. // "format": "int64",
  44812. // "location": "query",
  44813. // "type": "string"
  44814. // }
  44815. // },
  44816. // "path": "userprofiles/{profileId}/userRoles",
  44817. // "response": {
  44818. // "$ref": "UserRolesListResponse"
  44819. // },
  44820. // "scopes": [
  44821. // "https://www.googleapis.com/auth/dfatrafficking"
  44822. // ]
  44823. // }
  44824. }
  44825. // Pages invokes f for each page of results.
  44826. // A non-nil error returned from f will halt the iteration.
  44827. // The provided context supersedes any context provided to the Context method.
  44828. func (c *UserRolesListCall) Pages(ctx context.Context, f func(*UserRolesListResponse) error) error {
  44829. c.ctx_ = ctx
  44830. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44831. for {
  44832. x, err := c.Do()
  44833. if err != nil {
  44834. return err
  44835. }
  44836. if err := f(x); err != nil {
  44837. return err
  44838. }
  44839. if x.NextPageToken == "" {
  44840. return nil
  44841. }
  44842. c.PageToken(x.NextPageToken)
  44843. }
  44844. }
  44845. // method id "dfareporting.userRoles.patch":
  44846. type UserRolesPatchCall struct {
  44847. s *Service
  44848. profileId int64
  44849. userrole *UserRole
  44850. urlParams_ gensupport.URLParams
  44851. ctx_ context.Context
  44852. header_ http.Header
  44853. }
  44854. // Patch: Updates an existing user role. This method supports patch
  44855. // semantics.
  44856. func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall {
  44857. c := &UserRolesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44858. c.profileId = profileId
  44859. c.urlParams_.Set("id", fmt.Sprint(id))
  44860. c.userrole = userrole
  44861. return c
  44862. }
  44863. // Fields allows partial responses to be retrieved. See
  44864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44865. // for more information.
  44866. func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall {
  44867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44868. return c
  44869. }
  44870. // Context sets the context to be used in this call's Do method. Any
  44871. // pending HTTP request will be aborted if the provided context is
  44872. // canceled.
  44873. func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall {
  44874. c.ctx_ = ctx
  44875. return c
  44876. }
  44877. // Header returns an http.Header that can be modified by the caller to
  44878. // add HTTP headers to the request.
  44879. func (c *UserRolesPatchCall) Header() http.Header {
  44880. if c.header_ == nil {
  44881. c.header_ = make(http.Header)
  44882. }
  44883. return c.header_
  44884. }
  44885. func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) {
  44886. reqHeaders := make(http.Header)
  44887. for k, v := range c.header_ {
  44888. reqHeaders[k] = v
  44889. }
  44890. reqHeaders.Set("User-Agent", c.s.userAgent())
  44891. var body io.Reader = nil
  44892. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  44893. if err != nil {
  44894. return nil, err
  44895. }
  44896. reqHeaders.Set("Content-Type", "application/json")
  44897. c.urlParams_.Set("alt", alt)
  44898. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44899. urls += "?" + c.urlParams_.Encode()
  44900. req, _ := http.NewRequest("PATCH", urls, body)
  44901. req.Header = reqHeaders
  44902. googleapi.Expand(req.URL, map[string]string{
  44903. "profileId": strconv.FormatInt(c.profileId, 10),
  44904. })
  44905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44906. }
  44907. // Do executes the "dfareporting.userRoles.patch" call.
  44908. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44909. // code is an error. Response headers are in either
  44910. // *UserRole.ServerResponse.Header or (if a response was returned at
  44911. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44912. // to check whether the returned error was because
  44913. // http.StatusNotModified was returned.
  44914. func (c *UserRolesPatchCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44915. gensupport.SetOptions(c.urlParams_, opts...)
  44916. res, err := c.doRequest("json")
  44917. if res != nil && res.StatusCode == http.StatusNotModified {
  44918. if res.Body != nil {
  44919. res.Body.Close()
  44920. }
  44921. return nil, &googleapi.Error{
  44922. Code: res.StatusCode,
  44923. Header: res.Header,
  44924. }
  44925. }
  44926. if err != nil {
  44927. return nil, err
  44928. }
  44929. defer googleapi.CloseBody(res)
  44930. if err := googleapi.CheckResponse(res); err != nil {
  44931. return nil, err
  44932. }
  44933. ret := &UserRole{
  44934. ServerResponse: googleapi.ServerResponse{
  44935. Header: res.Header,
  44936. HTTPStatusCode: res.StatusCode,
  44937. },
  44938. }
  44939. target := &ret
  44940. if err := gensupport.DecodeResponse(target, res); err != nil {
  44941. return nil, err
  44942. }
  44943. return ret, nil
  44944. // {
  44945. // "description": "Updates an existing user role. This method supports patch semantics.",
  44946. // "httpMethod": "PATCH",
  44947. // "id": "dfareporting.userRoles.patch",
  44948. // "parameterOrder": [
  44949. // "profileId",
  44950. // "id"
  44951. // ],
  44952. // "parameters": {
  44953. // "id": {
  44954. // "description": "User role ID.",
  44955. // "format": "int64",
  44956. // "location": "query",
  44957. // "required": true,
  44958. // "type": "string"
  44959. // },
  44960. // "profileId": {
  44961. // "description": "User profile ID associated with this request.",
  44962. // "format": "int64",
  44963. // "location": "path",
  44964. // "required": true,
  44965. // "type": "string"
  44966. // }
  44967. // },
  44968. // "path": "userprofiles/{profileId}/userRoles",
  44969. // "request": {
  44970. // "$ref": "UserRole"
  44971. // },
  44972. // "response": {
  44973. // "$ref": "UserRole"
  44974. // },
  44975. // "scopes": [
  44976. // "https://www.googleapis.com/auth/dfatrafficking"
  44977. // ]
  44978. // }
  44979. }
  44980. // method id "dfareporting.userRoles.update":
  44981. type UserRolesUpdateCall struct {
  44982. s *Service
  44983. profileId int64
  44984. userrole *UserRole
  44985. urlParams_ gensupport.URLParams
  44986. ctx_ context.Context
  44987. header_ http.Header
  44988. }
  44989. // Update: Updates an existing user role.
  44990. func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall {
  44991. c := &UserRolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44992. c.profileId = profileId
  44993. c.userrole = userrole
  44994. return c
  44995. }
  44996. // Fields allows partial responses to be retrieved. See
  44997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44998. // for more information.
  44999. func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall {
  45000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45001. return c
  45002. }
  45003. // Context sets the context to be used in this call's Do method. Any
  45004. // pending HTTP request will be aborted if the provided context is
  45005. // canceled.
  45006. func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall {
  45007. c.ctx_ = ctx
  45008. return c
  45009. }
  45010. // Header returns an http.Header that can be modified by the caller to
  45011. // add HTTP headers to the request.
  45012. func (c *UserRolesUpdateCall) Header() http.Header {
  45013. if c.header_ == nil {
  45014. c.header_ = make(http.Header)
  45015. }
  45016. return c.header_
  45017. }
  45018. func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) {
  45019. reqHeaders := make(http.Header)
  45020. for k, v := range c.header_ {
  45021. reqHeaders[k] = v
  45022. }
  45023. reqHeaders.Set("User-Agent", c.s.userAgent())
  45024. var body io.Reader = nil
  45025. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  45026. if err != nil {
  45027. return nil, err
  45028. }
  45029. reqHeaders.Set("Content-Type", "application/json")
  45030. c.urlParams_.Set("alt", alt)
  45031. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  45032. urls += "?" + c.urlParams_.Encode()
  45033. req, _ := http.NewRequest("PUT", urls, body)
  45034. req.Header = reqHeaders
  45035. googleapi.Expand(req.URL, map[string]string{
  45036. "profileId": strconv.FormatInt(c.profileId, 10),
  45037. })
  45038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45039. }
  45040. // Do executes the "dfareporting.userRoles.update" call.
  45041. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  45042. // code is an error. Response headers are in either
  45043. // *UserRole.ServerResponse.Header or (if a response was returned at
  45044. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45045. // to check whether the returned error was because
  45046. // http.StatusNotModified was returned.
  45047. func (c *UserRolesUpdateCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  45048. gensupport.SetOptions(c.urlParams_, opts...)
  45049. res, err := c.doRequest("json")
  45050. if res != nil && res.StatusCode == http.StatusNotModified {
  45051. if res.Body != nil {
  45052. res.Body.Close()
  45053. }
  45054. return nil, &googleapi.Error{
  45055. Code: res.StatusCode,
  45056. Header: res.Header,
  45057. }
  45058. }
  45059. if err != nil {
  45060. return nil, err
  45061. }
  45062. defer googleapi.CloseBody(res)
  45063. if err := googleapi.CheckResponse(res); err != nil {
  45064. return nil, err
  45065. }
  45066. ret := &UserRole{
  45067. ServerResponse: googleapi.ServerResponse{
  45068. Header: res.Header,
  45069. HTTPStatusCode: res.StatusCode,
  45070. },
  45071. }
  45072. target := &ret
  45073. if err := gensupport.DecodeResponse(target, res); err != nil {
  45074. return nil, err
  45075. }
  45076. return ret, nil
  45077. // {
  45078. // "description": "Updates an existing user role.",
  45079. // "httpMethod": "PUT",
  45080. // "id": "dfareporting.userRoles.update",
  45081. // "parameterOrder": [
  45082. // "profileId"
  45083. // ],
  45084. // "parameters": {
  45085. // "profileId": {
  45086. // "description": "User profile ID associated with this request.",
  45087. // "format": "int64",
  45088. // "location": "path",
  45089. // "required": true,
  45090. // "type": "string"
  45091. // }
  45092. // },
  45093. // "path": "userprofiles/{profileId}/userRoles",
  45094. // "request": {
  45095. // "$ref": "UserRole"
  45096. // },
  45097. // "response": {
  45098. // "$ref": "UserRole"
  45099. // },
  45100. // "scopes": [
  45101. // "https://www.googleapis.com/auth/dfatrafficking"
  45102. // ]
  45103. // }
  45104. }
  45105. // method id "dfareporting.videoFormats.get":
  45106. type VideoFormatsGetCall struct {
  45107. s *Service
  45108. profileId int64
  45109. id int64
  45110. urlParams_ gensupport.URLParams
  45111. ifNoneMatch_ string
  45112. ctx_ context.Context
  45113. header_ http.Header
  45114. }
  45115. // Get: Gets one video format by ID.
  45116. func (r *VideoFormatsService) Get(profileId int64, id int64) *VideoFormatsGetCall {
  45117. c := &VideoFormatsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45118. c.profileId = profileId
  45119. c.id = id
  45120. return c
  45121. }
  45122. // Fields allows partial responses to be retrieved. See
  45123. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45124. // for more information.
  45125. func (c *VideoFormatsGetCall) Fields(s ...googleapi.Field) *VideoFormatsGetCall {
  45126. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45127. return c
  45128. }
  45129. // IfNoneMatch sets the optional parameter which makes the operation
  45130. // fail if the object's ETag matches the given value. This is useful for
  45131. // getting updates only after the object has changed since the last
  45132. // request. Use googleapi.IsNotModified to check whether the response
  45133. // error from Do is the result of In-None-Match.
  45134. func (c *VideoFormatsGetCall) IfNoneMatch(entityTag string) *VideoFormatsGetCall {
  45135. c.ifNoneMatch_ = entityTag
  45136. return c
  45137. }
  45138. // Context sets the context to be used in this call's Do method. Any
  45139. // pending HTTP request will be aborted if the provided context is
  45140. // canceled.
  45141. func (c *VideoFormatsGetCall) Context(ctx context.Context) *VideoFormatsGetCall {
  45142. c.ctx_ = ctx
  45143. return c
  45144. }
  45145. // Header returns an http.Header that can be modified by the caller to
  45146. // add HTTP headers to the request.
  45147. func (c *VideoFormatsGetCall) Header() http.Header {
  45148. if c.header_ == nil {
  45149. c.header_ = make(http.Header)
  45150. }
  45151. return c.header_
  45152. }
  45153. func (c *VideoFormatsGetCall) doRequest(alt string) (*http.Response, error) {
  45154. reqHeaders := make(http.Header)
  45155. for k, v := range c.header_ {
  45156. reqHeaders[k] = v
  45157. }
  45158. reqHeaders.Set("User-Agent", c.s.userAgent())
  45159. if c.ifNoneMatch_ != "" {
  45160. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45161. }
  45162. var body io.Reader = nil
  45163. c.urlParams_.Set("alt", alt)
  45164. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats/{id}")
  45165. urls += "?" + c.urlParams_.Encode()
  45166. req, _ := http.NewRequest("GET", urls, body)
  45167. req.Header = reqHeaders
  45168. googleapi.Expand(req.URL, map[string]string{
  45169. "profileId": strconv.FormatInt(c.profileId, 10),
  45170. "id": strconv.FormatInt(c.id, 10),
  45171. })
  45172. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45173. }
  45174. // Do executes the "dfareporting.videoFormats.get" call.
  45175. // Exactly one of *VideoFormat or error will be non-nil. Any non-2xx
  45176. // status code is an error. Response headers are in either
  45177. // *VideoFormat.ServerResponse.Header or (if a response was returned at
  45178. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  45179. // to check whether the returned error was because
  45180. // http.StatusNotModified was returned.
  45181. func (c *VideoFormatsGetCall) Do(opts ...googleapi.CallOption) (*VideoFormat, error) {
  45182. gensupport.SetOptions(c.urlParams_, opts...)
  45183. res, err := c.doRequest("json")
  45184. if res != nil && res.StatusCode == http.StatusNotModified {
  45185. if res.Body != nil {
  45186. res.Body.Close()
  45187. }
  45188. return nil, &googleapi.Error{
  45189. Code: res.StatusCode,
  45190. Header: res.Header,
  45191. }
  45192. }
  45193. if err != nil {
  45194. return nil, err
  45195. }
  45196. defer googleapi.CloseBody(res)
  45197. if err := googleapi.CheckResponse(res); err != nil {
  45198. return nil, err
  45199. }
  45200. ret := &VideoFormat{
  45201. ServerResponse: googleapi.ServerResponse{
  45202. Header: res.Header,
  45203. HTTPStatusCode: res.StatusCode,
  45204. },
  45205. }
  45206. target := &ret
  45207. if err := gensupport.DecodeResponse(target, res); err != nil {
  45208. return nil, err
  45209. }
  45210. return ret, nil
  45211. // {
  45212. // "description": "Gets one video format by ID.",
  45213. // "httpMethod": "GET",
  45214. // "id": "dfareporting.videoFormats.get",
  45215. // "parameterOrder": [
  45216. // "profileId",
  45217. // "id"
  45218. // ],
  45219. // "parameters": {
  45220. // "id": {
  45221. // "description": "Video format ID.",
  45222. // "format": "int32",
  45223. // "location": "path",
  45224. // "required": true,
  45225. // "type": "integer"
  45226. // },
  45227. // "profileId": {
  45228. // "description": "User profile ID associated with this request.",
  45229. // "format": "int64",
  45230. // "location": "path",
  45231. // "required": true,
  45232. // "type": "string"
  45233. // }
  45234. // },
  45235. // "path": "userprofiles/{profileId}/videoFormats/{id}",
  45236. // "response": {
  45237. // "$ref": "VideoFormat"
  45238. // },
  45239. // "scopes": [
  45240. // "https://www.googleapis.com/auth/dfatrafficking"
  45241. // ]
  45242. // }
  45243. }
  45244. // method id "dfareporting.videoFormats.list":
  45245. type VideoFormatsListCall struct {
  45246. s *Service
  45247. profileId int64
  45248. urlParams_ gensupport.URLParams
  45249. ifNoneMatch_ string
  45250. ctx_ context.Context
  45251. header_ http.Header
  45252. }
  45253. // List: Lists available video formats.
  45254. func (r *VideoFormatsService) List(profileId int64) *VideoFormatsListCall {
  45255. c := &VideoFormatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  45256. c.profileId = profileId
  45257. return c
  45258. }
  45259. // Fields allows partial responses to be retrieved. See
  45260. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  45261. // for more information.
  45262. func (c *VideoFormatsListCall) Fields(s ...googleapi.Field) *VideoFormatsListCall {
  45263. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  45264. return c
  45265. }
  45266. // IfNoneMatch sets the optional parameter which makes the operation
  45267. // fail if the object's ETag matches the given value. This is useful for
  45268. // getting updates only after the object has changed since the last
  45269. // request. Use googleapi.IsNotModified to check whether the response
  45270. // error from Do is the result of In-None-Match.
  45271. func (c *VideoFormatsListCall) IfNoneMatch(entityTag string) *VideoFormatsListCall {
  45272. c.ifNoneMatch_ = entityTag
  45273. return c
  45274. }
  45275. // Context sets the context to be used in this call's Do method. Any
  45276. // pending HTTP request will be aborted if the provided context is
  45277. // canceled.
  45278. func (c *VideoFormatsListCall) Context(ctx context.Context) *VideoFormatsListCall {
  45279. c.ctx_ = ctx
  45280. return c
  45281. }
  45282. // Header returns an http.Header that can be modified by the caller to
  45283. // add HTTP headers to the request.
  45284. func (c *VideoFormatsListCall) Header() http.Header {
  45285. if c.header_ == nil {
  45286. c.header_ = make(http.Header)
  45287. }
  45288. return c.header_
  45289. }
  45290. func (c *VideoFormatsListCall) doRequest(alt string) (*http.Response, error) {
  45291. reqHeaders := make(http.Header)
  45292. for k, v := range c.header_ {
  45293. reqHeaders[k] = v
  45294. }
  45295. reqHeaders.Set("User-Agent", c.s.userAgent())
  45296. if c.ifNoneMatch_ != "" {
  45297. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  45298. }
  45299. var body io.Reader = nil
  45300. c.urlParams_.Set("alt", alt)
  45301. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats")
  45302. urls += "?" + c.urlParams_.Encode()
  45303. req, _ := http.NewRequest("GET", urls, body)
  45304. req.Header = reqHeaders
  45305. googleapi.Expand(req.URL, map[string]string{
  45306. "profileId": strconv.FormatInt(c.profileId, 10),
  45307. })
  45308. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  45309. }
  45310. // Do executes the "dfareporting.videoFormats.list" call.
  45311. // Exactly one of *VideoFormatsListResponse or error will be non-nil.
  45312. // Any non-2xx status code is an error. Response headers are in either
  45313. // *VideoFormatsListResponse.ServerResponse.Header or (if a response was
  45314. // returned at all) in error.(*googleapi.Error).Header. Use
  45315. // googleapi.IsNotModified to check whether the returned error was
  45316. // because http.StatusNotModified was returned.
  45317. func (c *VideoFormatsListCall) Do(opts ...googleapi.CallOption) (*VideoFormatsListResponse, error) {
  45318. gensupport.SetOptions(c.urlParams_, opts...)
  45319. res, err := c.doRequest("json")
  45320. if res != nil && res.StatusCode == http.StatusNotModified {
  45321. if res.Body != nil {
  45322. res.Body.Close()
  45323. }
  45324. return nil, &googleapi.Error{
  45325. Code: res.StatusCode,
  45326. Header: res.Header,
  45327. }
  45328. }
  45329. if err != nil {
  45330. return nil, err
  45331. }
  45332. defer googleapi.CloseBody(res)
  45333. if err := googleapi.CheckResponse(res); err != nil {
  45334. return nil, err
  45335. }
  45336. ret := &VideoFormatsListResponse{
  45337. ServerResponse: googleapi.ServerResponse{
  45338. Header: res.Header,
  45339. HTTPStatusCode: res.StatusCode,
  45340. },
  45341. }
  45342. target := &ret
  45343. if err := gensupport.DecodeResponse(target, res); err != nil {
  45344. return nil, err
  45345. }
  45346. return ret, nil
  45347. // {
  45348. // "description": "Lists available video formats.",
  45349. // "httpMethod": "GET",
  45350. // "id": "dfareporting.videoFormats.list",
  45351. // "parameterOrder": [
  45352. // "profileId"
  45353. // ],
  45354. // "parameters": {
  45355. // "profileId": {
  45356. // "description": "User profile ID associated with this request.",
  45357. // "format": "int64",
  45358. // "location": "path",
  45359. // "required": true,
  45360. // "type": "string"
  45361. // }
  45362. // },
  45363. // "path": "userprofiles/{profileId}/videoFormats",
  45364. // "response": {
  45365. // "$ref": "VideoFormatsListResponse"
  45366. // },
  45367. // "scopes": [
  45368. // "https://www.googleapis.com/auth/dfatrafficking"
  45369. // ]
  45370. // }
  45371. }