您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

49596 行
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/v2.7"
  8. // ...
  9. // dfareportingService, err := dfareporting.New(oauthHttpClient)
  10. package dfareporting // import "google.golang.org/api/dfareporting/v2.7"
  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:v2.7"
  41. const apiName = "dfareporting"
  42. const apiVersion = "v2.7"
  43. const basePath = "https://www.googleapis.com/dfareporting/v2.7/"
  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.Advertisers = NewAdvertisersService(s)
  67. s.Browsers = NewBrowsersService(s)
  68. s.CampaignCreativeAssociations = NewCampaignCreativeAssociationsService(s)
  69. s.Campaigns = NewCampaignsService(s)
  70. s.ChangeLogs = NewChangeLogsService(s)
  71. s.Cities = NewCitiesService(s)
  72. s.ConnectionTypes = NewConnectionTypesService(s)
  73. s.ContentCategories = NewContentCategoriesService(s)
  74. s.Conversions = NewConversionsService(s)
  75. s.Countries = NewCountriesService(s)
  76. s.CreativeAssets = NewCreativeAssetsService(s)
  77. s.CreativeFieldValues = NewCreativeFieldValuesService(s)
  78. s.CreativeFields = NewCreativeFieldsService(s)
  79. s.CreativeGroups = NewCreativeGroupsService(s)
  80. s.Creatives = NewCreativesService(s)
  81. s.DimensionValues = NewDimensionValuesService(s)
  82. s.DirectorySiteContacts = NewDirectorySiteContactsService(s)
  83. s.DirectorySites = NewDirectorySitesService(s)
  84. s.DynamicTargetingKeys = NewDynamicTargetingKeysService(s)
  85. s.EventTags = NewEventTagsService(s)
  86. s.Files = NewFilesService(s)
  87. s.FloodlightActivities = NewFloodlightActivitiesService(s)
  88. s.FloodlightActivityGroups = NewFloodlightActivityGroupsService(s)
  89. s.FloodlightConfigurations = NewFloodlightConfigurationsService(s)
  90. s.InventoryItems = NewInventoryItemsService(s)
  91. s.LandingPages = NewLandingPagesService(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. Advertisers *AdvertisersService
  133. Browsers *BrowsersService
  134. CampaignCreativeAssociations *CampaignCreativeAssociationsService
  135. Campaigns *CampaignsService
  136. ChangeLogs *ChangeLogsService
  137. Cities *CitiesService
  138. ConnectionTypes *ConnectionTypesService
  139. ContentCategories *ContentCategoriesService
  140. Conversions *ConversionsService
  141. Countries *CountriesService
  142. CreativeAssets *CreativeAssetsService
  143. CreativeFieldValues *CreativeFieldValuesService
  144. CreativeFields *CreativeFieldsService
  145. CreativeGroups *CreativeGroupsService
  146. Creatives *CreativesService
  147. DimensionValues *DimensionValuesService
  148. DirectorySiteContacts *DirectorySiteContactsService
  149. DirectorySites *DirectorySitesService
  150. DynamicTargetingKeys *DynamicTargetingKeysService
  151. EventTags *EventTagsService
  152. Files *FilesService
  153. FloodlightActivities *FloodlightActivitiesService
  154. FloodlightActivityGroups *FloodlightActivityGroupsService
  155. FloodlightConfigurations *FloodlightConfigurationsService
  156. InventoryItems *InventoryItemsService
  157. LandingPages *LandingPagesService
  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 NewAdvertisersService(s *Service) *AdvertisersService {
  242. rs := &AdvertisersService{s: s}
  243. return rs
  244. }
  245. type AdvertisersService struct {
  246. s *Service
  247. }
  248. func NewBrowsersService(s *Service) *BrowsersService {
  249. rs := &BrowsersService{s: s}
  250. return rs
  251. }
  252. type BrowsersService struct {
  253. s *Service
  254. }
  255. func NewCampaignCreativeAssociationsService(s *Service) *CampaignCreativeAssociationsService {
  256. rs := &CampaignCreativeAssociationsService{s: s}
  257. return rs
  258. }
  259. type CampaignCreativeAssociationsService struct {
  260. s *Service
  261. }
  262. func NewCampaignsService(s *Service) *CampaignsService {
  263. rs := &CampaignsService{s: s}
  264. return rs
  265. }
  266. type CampaignsService struct {
  267. s *Service
  268. }
  269. func NewChangeLogsService(s *Service) *ChangeLogsService {
  270. rs := &ChangeLogsService{s: s}
  271. return rs
  272. }
  273. type ChangeLogsService struct {
  274. s *Service
  275. }
  276. func NewCitiesService(s *Service) *CitiesService {
  277. rs := &CitiesService{s: s}
  278. return rs
  279. }
  280. type CitiesService struct {
  281. s *Service
  282. }
  283. func NewConnectionTypesService(s *Service) *ConnectionTypesService {
  284. rs := &ConnectionTypesService{s: s}
  285. return rs
  286. }
  287. type ConnectionTypesService struct {
  288. s *Service
  289. }
  290. func NewContentCategoriesService(s *Service) *ContentCategoriesService {
  291. rs := &ContentCategoriesService{s: s}
  292. return rs
  293. }
  294. type ContentCategoriesService struct {
  295. s *Service
  296. }
  297. func NewConversionsService(s *Service) *ConversionsService {
  298. rs := &ConversionsService{s: s}
  299. return rs
  300. }
  301. type ConversionsService struct {
  302. s *Service
  303. }
  304. func NewCountriesService(s *Service) *CountriesService {
  305. rs := &CountriesService{s: s}
  306. return rs
  307. }
  308. type CountriesService struct {
  309. s *Service
  310. }
  311. func NewCreativeAssetsService(s *Service) *CreativeAssetsService {
  312. rs := &CreativeAssetsService{s: s}
  313. return rs
  314. }
  315. type CreativeAssetsService struct {
  316. s *Service
  317. }
  318. func NewCreativeFieldValuesService(s *Service) *CreativeFieldValuesService {
  319. rs := &CreativeFieldValuesService{s: s}
  320. return rs
  321. }
  322. type CreativeFieldValuesService struct {
  323. s *Service
  324. }
  325. func NewCreativeFieldsService(s *Service) *CreativeFieldsService {
  326. rs := &CreativeFieldsService{s: s}
  327. return rs
  328. }
  329. type CreativeFieldsService struct {
  330. s *Service
  331. }
  332. func NewCreativeGroupsService(s *Service) *CreativeGroupsService {
  333. rs := &CreativeGroupsService{s: s}
  334. return rs
  335. }
  336. type CreativeGroupsService struct {
  337. s *Service
  338. }
  339. func NewCreativesService(s *Service) *CreativesService {
  340. rs := &CreativesService{s: s}
  341. return rs
  342. }
  343. type CreativesService struct {
  344. s *Service
  345. }
  346. func NewDimensionValuesService(s *Service) *DimensionValuesService {
  347. rs := &DimensionValuesService{s: s}
  348. return rs
  349. }
  350. type DimensionValuesService struct {
  351. s *Service
  352. }
  353. func NewDirectorySiteContactsService(s *Service) *DirectorySiteContactsService {
  354. rs := &DirectorySiteContactsService{s: s}
  355. return rs
  356. }
  357. type DirectorySiteContactsService struct {
  358. s *Service
  359. }
  360. func NewDirectorySitesService(s *Service) *DirectorySitesService {
  361. rs := &DirectorySitesService{s: s}
  362. return rs
  363. }
  364. type DirectorySitesService struct {
  365. s *Service
  366. }
  367. func NewDynamicTargetingKeysService(s *Service) *DynamicTargetingKeysService {
  368. rs := &DynamicTargetingKeysService{s: s}
  369. return rs
  370. }
  371. type DynamicTargetingKeysService struct {
  372. s *Service
  373. }
  374. func NewEventTagsService(s *Service) *EventTagsService {
  375. rs := &EventTagsService{s: s}
  376. return rs
  377. }
  378. type EventTagsService struct {
  379. s *Service
  380. }
  381. func NewFilesService(s *Service) *FilesService {
  382. rs := &FilesService{s: s}
  383. return rs
  384. }
  385. type FilesService struct {
  386. s *Service
  387. }
  388. func NewFloodlightActivitiesService(s *Service) *FloodlightActivitiesService {
  389. rs := &FloodlightActivitiesService{s: s}
  390. return rs
  391. }
  392. type FloodlightActivitiesService struct {
  393. s *Service
  394. }
  395. func NewFloodlightActivityGroupsService(s *Service) *FloodlightActivityGroupsService {
  396. rs := &FloodlightActivityGroupsService{s: s}
  397. return rs
  398. }
  399. type FloodlightActivityGroupsService struct {
  400. s *Service
  401. }
  402. func NewFloodlightConfigurationsService(s *Service) *FloodlightConfigurationsService {
  403. rs := &FloodlightConfigurationsService{s: s}
  404. return rs
  405. }
  406. type FloodlightConfigurationsService struct {
  407. s *Service
  408. }
  409. func NewInventoryItemsService(s *Service) *InventoryItemsService {
  410. rs := &InventoryItemsService{s: s}
  411. return rs
  412. }
  413. type InventoryItemsService struct {
  414. s *Service
  415. }
  416. func NewLandingPagesService(s *Service) *LandingPagesService {
  417. rs := &LandingPagesService{s: s}
  418. return rs
  419. }
  420. type LandingPagesService 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.
  1047. //
  1048. // Possible values:
  1049. // "EXTERNAL_TRAFFICKER"
  1050. // "INTERNAL_NON_TRAFFICKER"
  1051. // "INTERNAL_TRAFFICKER"
  1052. TraffickerType string `json:"traffickerType,omitempty"`
  1053. // UserAccessType: User type of the user profile. This is a read-only
  1054. // field that can be left blank.
  1055. //
  1056. // Possible values:
  1057. // "INTERNAL_ADMINISTRATOR"
  1058. // "NORMAL_USER"
  1059. // "READ_ONLY_SUPER_USER"
  1060. // "SUPER_USER"
  1061. UserAccessType string `json:"userAccessType,omitempty"`
  1062. // UserRoleFilter: Filter that describes which user roles are visible to
  1063. // the user profile.
  1064. UserRoleFilter *ObjectFilter `json:"userRoleFilter,omitempty"`
  1065. // UserRoleId: User role ID of the user profile. This is a required
  1066. // field.
  1067. UserRoleId int64 `json:"userRoleId,omitempty,string"`
  1068. // ServerResponse contains the HTTP response code and headers from the
  1069. // server.
  1070. googleapi.ServerResponse `json:"-"`
  1071. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1072. // unconditionally include in API requests. By default, fields with
  1073. // empty values are omitted from API requests. However, any non-pointer,
  1074. // non-interface field appearing in ForceSendFields will be sent to the
  1075. // server regardless of whether the field is empty or not. This may be
  1076. // used to include empty fields in Patch requests.
  1077. ForceSendFields []string `json:"-"`
  1078. // NullFields is a list of field names (e.g. "AccountId") to include in
  1079. // API requests with the JSON null value. By default, fields with empty
  1080. // values are omitted from API requests. However, any field with an
  1081. // empty value appearing in NullFields will be sent to the server as
  1082. // null. It is an error if a field in this list has a non-empty value.
  1083. // This may be used to include null fields in Patch requests.
  1084. NullFields []string `json:"-"`
  1085. }
  1086. func (s *AccountUserProfile) MarshalJSON() ([]byte, error) {
  1087. type NoMethod AccountUserProfile
  1088. raw := NoMethod(*s)
  1089. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1090. }
  1091. // AccountUserProfilesListResponse: Account User Profile List Response
  1092. type AccountUserProfilesListResponse struct {
  1093. // AccountUserProfiles: Account user profile collection.
  1094. AccountUserProfiles []*AccountUserProfile `json:"accountUserProfiles,omitempty"`
  1095. // Kind: Identifies what kind of resource this is. Value: the fixed
  1096. // string "dfareporting#accountUserProfilesListResponse".
  1097. Kind string `json:"kind,omitempty"`
  1098. // NextPageToken: Pagination token to be used for the next list
  1099. // operation.
  1100. NextPageToken string `json:"nextPageToken,omitempty"`
  1101. // ServerResponse contains the HTTP response code and headers from the
  1102. // server.
  1103. googleapi.ServerResponse `json:"-"`
  1104. // ForceSendFields is a list of field names (e.g. "AccountUserProfiles")
  1105. // to unconditionally include in API requests. By default, fields with
  1106. // empty values are omitted from API requests. However, any non-pointer,
  1107. // non-interface field appearing in ForceSendFields will be sent to the
  1108. // server regardless of whether the field is empty or not. This may be
  1109. // used to include empty fields in Patch requests.
  1110. ForceSendFields []string `json:"-"`
  1111. // NullFields is a list of field names (e.g. "AccountUserProfiles") to
  1112. // include in API requests with the JSON null value. By default, fields
  1113. // with empty values are omitted from API requests. However, any field
  1114. // with an empty value appearing in NullFields will be sent to the
  1115. // server as null. It is an error if a field in this list has a
  1116. // non-empty value. This may be used to include null fields in Patch
  1117. // requests.
  1118. NullFields []string `json:"-"`
  1119. }
  1120. func (s *AccountUserProfilesListResponse) MarshalJSON() ([]byte, error) {
  1121. type NoMethod AccountUserProfilesListResponse
  1122. raw := NoMethod(*s)
  1123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1124. }
  1125. // AccountsListResponse: Account List Response
  1126. type AccountsListResponse struct {
  1127. // Accounts: Account collection.
  1128. Accounts []*Account `json:"accounts,omitempty"`
  1129. // Kind: Identifies what kind of resource this is. Value: the fixed
  1130. // string "dfareporting#accountsListResponse".
  1131. Kind string `json:"kind,omitempty"`
  1132. // NextPageToken: Pagination token to be used for the next list
  1133. // operation.
  1134. NextPageToken string `json:"nextPageToken,omitempty"`
  1135. // ServerResponse contains the HTTP response code and headers from the
  1136. // server.
  1137. googleapi.ServerResponse `json:"-"`
  1138. // ForceSendFields is a list of field names (e.g. "Accounts") to
  1139. // unconditionally include in API requests. By default, fields with
  1140. // empty values are omitted from API requests. However, any non-pointer,
  1141. // non-interface field appearing in ForceSendFields will be sent to the
  1142. // server regardless of whether the field is empty or not. This may be
  1143. // used to include empty fields in Patch requests.
  1144. ForceSendFields []string `json:"-"`
  1145. // NullFields is a list of field names (e.g. "Accounts") to include in
  1146. // API requests with the JSON null value. By default, fields with empty
  1147. // values are omitted from API requests. However, any field with an
  1148. // empty value appearing in NullFields will be sent to the server as
  1149. // null. It is an error if a field in this list has a non-empty value.
  1150. // This may be used to include null fields in Patch requests.
  1151. NullFields []string `json:"-"`
  1152. }
  1153. func (s *AccountsListResponse) MarshalJSON() ([]byte, error) {
  1154. type NoMethod AccountsListResponse
  1155. raw := NoMethod(*s)
  1156. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1157. }
  1158. // Activities: Represents an activity group.
  1159. type Activities struct {
  1160. // Filters: List of activity filters. The dimension values need to be
  1161. // all either of type "dfa:activity" or "dfa:activityGroup".
  1162. Filters []*DimensionValue `json:"filters,omitempty"`
  1163. // Kind: The kind of resource this is, in this case
  1164. // dfareporting#activities.
  1165. Kind string `json:"kind,omitempty"`
  1166. // MetricNames: List of names of floodlight activity metrics.
  1167. MetricNames []string `json:"metricNames,omitempty"`
  1168. // ForceSendFields is a list of field names (e.g. "Filters") to
  1169. // unconditionally include in API requests. By default, fields with
  1170. // empty values are omitted from API requests. However, any non-pointer,
  1171. // non-interface field appearing in ForceSendFields will be sent to the
  1172. // server regardless of whether the field is empty or not. This may be
  1173. // used to include empty fields in Patch requests.
  1174. ForceSendFields []string `json:"-"`
  1175. // NullFields is a list of field names (e.g. "Filters") to include in
  1176. // API requests with the JSON null value. By default, fields with empty
  1177. // values are omitted from API requests. However, any field with an
  1178. // empty value appearing in NullFields will be sent to the server as
  1179. // null. It is an error if a field in this list has a non-empty value.
  1180. // This may be used to include null fields in Patch requests.
  1181. NullFields []string `json:"-"`
  1182. }
  1183. func (s *Activities) MarshalJSON() ([]byte, error) {
  1184. type NoMethod Activities
  1185. raw := NoMethod(*s)
  1186. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1187. }
  1188. // Ad: Contains properties of a DCM ad.
  1189. type Ad struct {
  1190. // AccountId: Account ID of this ad. This is a read-only field that can
  1191. // be left blank.
  1192. AccountId int64 `json:"accountId,omitempty,string"`
  1193. // Active: Whether this ad is active. When true, archived must be false.
  1194. Active bool `json:"active,omitempty"`
  1195. // AdvertiserId: Advertiser ID of this ad. This is a required field on
  1196. // insertion.
  1197. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1198. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  1199. // advertiser. This is a read-only, auto-generated field.
  1200. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1201. // Archived: Whether this ad is archived. When true, active must be
  1202. // false.
  1203. Archived bool `json:"archived,omitempty"`
  1204. // AudienceSegmentId: Audience segment ID that is being targeted for
  1205. // this ad. Applicable when type is AD_SERVING_STANDARD_AD.
  1206. AudienceSegmentId int64 `json:"audienceSegmentId,omitempty,string"`
  1207. // CampaignId: Campaign ID of this ad. This is a required field on
  1208. // insertion.
  1209. CampaignId int64 `json:"campaignId,omitempty,string"`
  1210. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  1211. // This is a read-only, auto-generated field.
  1212. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  1213. // ClickThroughUrl: Click-through URL for this ad. This is a required
  1214. // field on insertion. Applicable when type is AD_SERVING_CLICK_TRACKER.
  1215. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  1216. // ClickThroughUrlSuffixProperties: Click-through URL suffix properties
  1217. // for this ad. Applies to the URL in the ad or (if overriding ad
  1218. // properties) the URL in the creative.
  1219. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1220. // Comments: Comments for this ad.
  1221. Comments string `json:"comments,omitempty"`
  1222. // Compatibility: Compatibility of this ad. Applicable when type is
  1223. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  1224. // either rendering on desktop or on mobile devices or in mobile apps
  1225. // for regular or interstitial ads, respectively. APP and
  1226. // APP_INTERSTITIAL are only used for existing default ads. New mobile
  1227. // placements must be assigned DISPLAY or DISPLAY_INTERSTITIAL and
  1228. // default ads created for those placements will be limited to those
  1229. // compatibility types. IN_STREAM_VIDEO refers to rendering in-stream
  1230. // video ads developed with the VAST standard.
  1231. //
  1232. // Possible values:
  1233. // "APP"
  1234. // "APP_INTERSTITIAL"
  1235. // "DISPLAY"
  1236. // "DISPLAY_INTERSTITIAL"
  1237. // "IN_STREAM_VIDEO"
  1238. Compatibility string `json:"compatibility,omitempty"`
  1239. // CreateInfo: Information about the creation of this ad. This is a
  1240. // read-only field.
  1241. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1242. // CreativeGroupAssignments: Creative group assignments for this ad.
  1243. // Applicable when type is AD_SERVING_CLICK_TRACKER. Only one assignment
  1244. // per creative group number is allowed for a maximum of two
  1245. // assignments.
  1246. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  1247. // CreativeRotation: Creative rotation for this ad. Applicable when type
  1248. // is AD_SERVING_DEFAULT_AD, AD_SERVING_STANDARD_AD, or
  1249. // AD_SERVING_TRACKING. When type is AD_SERVING_DEFAULT_AD, this field
  1250. // should have exactly one creativeAssignment.
  1251. CreativeRotation *CreativeRotation `json:"creativeRotation,omitempty"`
  1252. // DayPartTargeting: Time and day targeting information for this ad.
  1253. // This field must be left blank if the ad is using a targeting
  1254. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1255. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  1256. // DefaultClickThroughEventTagProperties: Default click-through event
  1257. // tag properties for this ad.
  1258. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1259. // DeliverySchedule: Delivery schedule information for this ad.
  1260. // Applicable when type is AD_SERVING_STANDARD_AD or
  1261. // AD_SERVING_TRACKING. This field along with subfields priority and
  1262. // impressionRatio are required on insertion when type is
  1263. // AD_SERVING_STANDARD_AD.
  1264. DeliverySchedule *DeliverySchedule `json:"deliverySchedule,omitempty"`
  1265. // DynamicClickTracker: Whether this ad is a dynamic click tracker.
  1266. // Applicable when type is AD_SERVING_CLICK_TRACKER. This is a required
  1267. // field on insert, and is read-only after insert.
  1268. DynamicClickTracker bool `json:"dynamicClickTracker,omitempty"`
  1269. // EndTime: Date and time that this ad should stop serving. Must be
  1270. // later than the start time. This is a required field on insertion.
  1271. EndTime string `json:"endTime,omitempty"`
  1272. // EventTagOverrides: Event tag overrides for this ad.
  1273. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1274. // GeoTargeting: Geographical targeting information for this ad. This
  1275. // field must be left blank if the ad is using a targeting template.
  1276. // Applicable when type is AD_SERVING_STANDARD_AD.
  1277. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  1278. // Id: ID of this ad. This is a read-only, auto-generated field.
  1279. Id int64 `json:"id,omitempty,string"`
  1280. // IdDimensionValue: Dimension value for the ID of this ad. This is a
  1281. // read-only, auto-generated field.
  1282. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1283. // KeyValueTargetingExpression: Key-value targeting information for this
  1284. // ad. This field must be left blank if the ad is using a targeting
  1285. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1286. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  1287. // Kind: Identifies what kind of resource this is. Value: the fixed
  1288. // string "dfareporting#ad".
  1289. Kind string `json:"kind,omitempty"`
  1290. // LanguageTargeting: Language targeting information for this ad. This
  1291. // field must be left blank if the ad is using a targeting template.
  1292. // Applicable when type is AD_SERVING_STANDARD_AD.
  1293. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  1294. // LastModifiedInfo: Information about the most recent modification of
  1295. // this ad. This is a read-only field.
  1296. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1297. // Name: Name of this ad. This is a required field and must be less than
  1298. // 256 characters long.
  1299. Name string `json:"name,omitempty"`
  1300. // PlacementAssignments: Placement assignments for this ad.
  1301. PlacementAssignments []*PlacementAssignment `json:"placementAssignments,omitempty"`
  1302. // RemarketingListExpression: Remarketing list targeting expression for
  1303. // this ad. This field must be left blank if the ad is using a targeting
  1304. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1305. RemarketingListExpression *ListTargetingExpression `json:"remarketingListExpression,omitempty"`
  1306. // Size: Size of this ad. Applicable when type is AD_SERVING_DEFAULT_AD.
  1307. Size *Size `json:"size,omitempty"`
  1308. // SslCompliant: Whether this ad is ssl compliant. This is a read-only
  1309. // field that is auto-generated when the ad is inserted or updated.
  1310. SslCompliant bool `json:"sslCompliant,omitempty"`
  1311. // SslRequired: Whether this ad requires ssl. This is a read-only field
  1312. // that is auto-generated when the ad is inserted or updated.
  1313. SslRequired bool `json:"sslRequired,omitempty"`
  1314. // StartTime: Date and time that this ad should start serving. If
  1315. // creating an ad, this field must be a time in the future. This is a
  1316. // required field on insertion.
  1317. StartTime string `json:"startTime,omitempty"`
  1318. // SubaccountId: Subaccount ID of this ad. This is a read-only field
  1319. // that can be left blank.
  1320. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1321. // TargetingTemplateId: Targeting template ID, used to apply
  1322. // preconfigured targeting information to this ad. This cannot be set
  1323. // while any of dayPartTargeting, geoTargeting,
  1324. // keyValueTargetingExpression, languageTargeting,
  1325. // remarketingListExpression, or technologyTargeting are set. Applicable
  1326. // when type is AD_SERVING_STANDARD_AD.
  1327. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  1328. // TechnologyTargeting: Technology platform targeting information for
  1329. // this ad. This field must be left blank if the ad is using a targeting
  1330. // template. Applicable when type is AD_SERVING_STANDARD_AD.
  1331. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  1332. // Type: Type of ad. This is a required field on insertion. Note that
  1333. // default ads (AD_SERVING_DEFAULT_AD) cannot be created directly (see
  1334. // Creative resource).
  1335. //
  1336. // Possible values:
  1337. // "AD_SERVING_CLICK_TRACKER"
  1338. // "AD_SERVING_DEFAULT_AD"
  1339. // "AD_SERVING_STANDARD_AD"
  1340. // "AD_SERVING_TRACKING"
  1341. Type string `json:"type,omitempty"`
  1342. // ServerResponse contains the HTTP response code and headers from the
  1343. // server.
  1344. googleapi.ServerResponse `json:"-"`
  1345. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1346. // unconditionally include in API requests. By default, fields with
  1347. // empty values are omitted from API requests. However, any non-pointer,
  1348. // non-interface field appearing in ForceSendFields will be sent to the
  1349. // server regardless of whether the field is empty or not. This may be
  1350. // used to include empty fields in Patch requests.
  1351. ForceSendFields []string `json:"-"`
  1352. // NullFields is a list of field names (e.g. "AccountId") to include in
  1353. // API requests with the JSON null value. By default, fields with empty
  1354. // values are omitted from API requests. However, any field with an
  1355. // empty value appearing in NullFields will be sent to the server as
  1356. // null. It is an error if a field in this list has a non-empty value.
  1357. // This may be used to include null fields in Patch requests.
  1358. NullFields []string `json:"-"`
  1359. }
  1360. func (s *Ad) MarshalJSON() ([]byte, error) {
  1361. type NoMethod Ad
  1362. raw := NoMethod(*s)
  1363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1364. }
  1365. // AdSlot: Ad Slot
  1366. type AdSlot struct {
  1367. // Comment: Comment for this ad slot.
  1368. Comment string `json:"comment,omitempty"`
  1369. // Compatibility: Ad slot compatibility. DISPLAY and
  1370. // DISPLAY_INTERSTITIAL refer to rendering either on desktop, mobile
  1371. // devices or in mobile apps for regular or interstitial ads
  1372. // respectively. APP and APP_INTERSTITIAL are for rendering in mobile
  1373. // apps. IN_STREAM_VIDEO refers to rendering in in-stream video ads
  1374. // developed with the VAST standard.
  1375. //
  1376. // Possible values:
  1377. // "APP"
  1378. // "APP_INTERSTITIAL"
  1379. // "DISPLAY"
  1380. // "DISPLAY_INTERSTITIAL"
  1381. // "IN_STREAM_VIDEO"
  1382. Compatibility string `json:"compatibility,omitempty"`
  1383. // Height: Height of this ad slot.
  1384. Height int64 `json:"height,omitempty,string"`
  1385. // LinkedPlacementId: ID of the placement from an external platform that
  1386. // is linked to this ad slot.
  1387. LinkedPlacementId int64 `json:"linkedPlacementId,omitempty,string"`
  1388. // Name: Name of this ad slot.
  1389. Name string `json:"name,omitempty"`
  1390. // PaymentSourceType: Payment source type of this ad slot.
  1391. //
  1392. // Possible values:
  1393. // "PLANNING_PAYMENT_SOURCE_TYPE_AGENCY_PAID"
  1394. // "PLANNING_PAYMENT_SOURCE_TYPE_PUBLISHER_PAID"
  1395. PaymentSourceType string `json:"paymentSourceType,omitempty"`
  1396. // Primary: Primary ad slot of a roadblock inventory item.
  1397. Primary bool `json:"primary,omitempty"`
  1398. // Width: Width of this ad slot.
  1399. Width int64 `json:"width,omitempty,string"`
  1400. // ForceSendFields is a list of field names (e.g. "Comment") to
  1401. // unconditionally include in API requests. By default, fields with
  1402. // empty values are omitted from API requests. However, any non-pointer,
  1403. // non-interface field appearing in ForceSendFields will be sent to the
  1404. // server regardless of whether the field is empty or not. This may be
  1405. // used to include empty fields in Patch requests.
  1406. ForceSendFields []string `json:"-"`
  1407. // NullFields is a list of field names (e.g. "Comment") to include in
  1408. // API requests with the JSON null value. By default, fields with empty
  1409. // values are omitted from API requests. However, any field with an
  1410. // empty value appearing in NullFields will be sent to the server as
  1411. // null. It is an error if a field in this list has a non-empty value.
  1412. // This may be used to include null fields in Patch requests.
  1413. NullFields []string `json:"-"`
  1414. }
  1415. func (s *AdSlot) MarshalJSON() ([]byte, error) {
  1416. type NoMethod AdSlot
  1417. raw := NoMethod(*s)
  1418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1419. }
  1420. // AdsListResponse: Ad List Response
  1421. type AdsListResponse struct {
  1422. // Ads: Ad collection.
  1423. Ads []*Ad `json:"ads,omitempty"`
  1424. // Kind: Identifies what kind of resource this is. Value: the fixed
  1425. // string "dfareporting#adsListResponse".
  1426. Kind string `json:"kind,omitempty"`
  1427. // NextPageToken: Pagination token to be used for the next list
  1428. // operation.
  1429. NextPageToken string `json:"nextPageToken,omitempty"`
  1430. // ServerResponse contains the HTTP response code and headers from the
  1431. // server.
  1432. googleapi.ServerResponse `json:"-"`
  1433. // ForceSendFields is a list of field names (e.g. "Ads") to
  1434. // unconditionally include in API requests. By default, fields with
  1435. // empty values are omitted from API requests. However, any non-pointer,
  1436. // non-interface field appearing in ForceSendFields will be sent to the
  1437. // server regardless of whether the field is empty or not. This may be
  1438. // used to include empty fields in Patch requests.
  1439. ForceSendFields []string `json:"-"`
  1440. // NullFields is a list of field names (e.g. "Ads") to include in API
  1441. // requests with the JSON null value. By default, fields with empty
  1442. // values are omitted from API requests. However, any field with an
  1443. // empty value appearing in NullFields will be sent to the server as
  1444. // null. It is an error if a field in this list has a non-empty value.
  1445. // This may be used to include null fields in Patch requests.
  1446. NullFields []string `json:"-"`
  1447. }
  1448. func (s *AdsListResponse) MarshalJSON() ([]byte, error) {
  1449. type NoMethod AdsListResponse
  1450. raw := NoMethod(*s)
  1451. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1452. }
  1453. // Advertiser: Contains properties of a DCM advertiser.
  1454. type Advertiser struct {
  1455. // AccountId: Account ID of this advertiser.This is a read-only field
  1456. // that can be left blank.
  1457. AccountId int64 `json:"accountId,omitempty,string"`
  1458. // AdvertiserGroupId: ID of the advertiser group this advertiser belongs
  1459. // to. You can group advertisers for reporting purposes, allowing you to
  1460. // see aggregated information for all advertisers in each group.
  1461. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1462. // ClickThroughUrlSuffix: Suffix added to click-through URL of ad
  1463. // creative associations under this advertiser. Must be less than 129
  1464. // characters long.
  1465. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  1466. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  1467. // apply by default to the landing pages of this advertiser's campaigns.
  1468. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  1469. // DefaultEmail: Default email address used in sender field for tag
  1470. // emails.
  1471. DefaultEmail string `json:"defaultEmail,omitempty"`
  1472. // FloodlightConfigurationId: Floodlight configuration ID of this
  1473. // advertiser. The floodlight configuration ID will be created
  1474. // automatically, so on insert this field should be left blank. This
  1475. // field can be set to another advertiser's floodlight configuration ID
  1476. // in order to share that advertiser's floodlight configuration with
  1477. // this advertiser, so long as:
  1478. // - This advertiser's original floodlight configuration is not already
  1479. // associated with floodlight activities or floodlight activity groups.
  1480. //
  1481. // - This advertiser's original floodlight configuration is not already
  1482. // shared with another advertiser.
  1483. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  1484. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  1485. // of the floodlight configuration. This is a read-only, auto-generated
  1486. // field.
  1487. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  1488. // Id: ID of this advertiser. This is a read-only, auto-generated field.
  1489. Id int64 `json:"id,omitempty,string"`
  1490. // IdDimensionValue: Dimension value for the ID of this advertiser. This
  1491. // is a read-only, auto-generated field.
  1492. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1493. // Kind: Identifies what kind of resource this is. Value: the fixed
  1494. // string "dfareporting#advertiser".
  1495. Kind string `json:"kind,omitempty"`
  1496. // Name: Name of this advertiser. This is a required field and must be
  1497. // less than 256 characters long and unique among advertisers of the
  1498. // same account.
  1499. Name string `json:"name,omitempty"`
  1500. // OriginalFloodlightConfigurationId: Original floodlight configuration
  1501. // before any sharing occurred. Set the floodlightConfigurationId of
  1502. // this advertiser to originalFloodlightConfigurationId to unshare the
  1503. // advertiser's current floodlight configuration. You cannot unshare an
  1504. // advertiser's floodlight configuration if the shared configuration has
  1505. // activities associated with any campaign or placement.
  1506. OriginalFloodlightConfigurationId int64 `json:"originalFloodlightConfigurationId,omitempty,string"`
  1507. // Status: Status of this advertiser.
  1508. //
  1509. // Possible values:
  1510. // "APPROVED"
  1511. // "ON_HOLD"
  1512. Status string `json:"status,omitempty"`
  1513. // SubaccountId: Subaccount ID of this advertiser.This is a read-only
  1514. // field that can be left blank.
  1515. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1516. // Suspended: Suspension status of this advertiser.
  1517. Suspended bool `json:"suspended,omitempty"`
  1518. // ServerResponse contains the HTTP response code and headers from the
  1519. // server.
  1520. googleapi.ServerResponse `json:"-"`
  1521. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1522. // unconditionally include in API requests. By default, fields with
  1523. // empty values are omitted from API requests. However, any non-pointer,
  1524. // non-interface field appearing in ForceSendFields will be sent to the
  1525. // server regardless of whether the field is empty or not. This may be
  1526. // used to include empty fields in Patch requests.
  1527. ForceSendFields []string `json:"-"`
  1528. // NullFields is a list of field names (e.g. "AccountId") to include in
  1529. // API requests with the JSON null value. By default, fields with empty
  1530. // values are omitted from API requests. However, any field with an
  1531. // empty value appearing in NullFields will be sent to the server as
  1532. // null. It is an error if a field in this list has a non-empty value.
  1533. // This may be used to include null fields in Patch requests.
  1534. NullFields []string `json:"-"`
  1535. }
  1536. func (s *Advertiser) MarshalJSON() ([]byte, error) {
  1537. type NoMethod Advertiser
  1538. raw := NoMethod(*s)
  1539. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1540. }
  1541. // AdvertiserGroup: Groups advertisers together so that reports can be
  1542. // generated for the entire group at once.
  1543. type AdvertiserGroup struct {
  1544. // AccountId: Account ID of this advertiser group. This is a read-only
  1545. // field that can be left blank.
  1546. AccountId int64 `json:"accountId,omitempty,string"`
  1547. // Id: ID of this advertiser group. This is a read-only, auto-generated
  1548. // field.
  1549. Id int64 `json:"id,omitempty,string"`
  1550. // Kind: Identifies what kind of resource this is. Value: the fixed
  1551. // string "dfareporting#advertiserGroup".
  1552. Kind string `json:"kind,omitempty"`
  1553. // Name: Name of this advertiser group. This is a required field and
  1554. // must be less than 256 characters long and unique among advertiser
  1555. // groups of the same account.
  1556. Name string `json:"name,omitempty"`
  1557. // ServerResponse contains the HTTP response code and headers from the
  1558. // server.
  1559. googleapi.ServerResponse `json:"-"`
  1560. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1561. // unconditionally include in API requests. By default, fields with
  1562. // empty values are omitted from API requests. However, any non-pointer,
  1563. // non-interface field appearing in ForceSendFields will be sent to the
  1564. // server regardless of whether the field is empty or not. This may be
  1565. // used to include empty fields in Patch requests.
  1566. ForceSendFields []string `json:"-"`
  1567. // NullFields is a list of field names (e.g. "AccountId") to include in
  1568. // API requests with the JSON null value. By default, fields with empty
  1569. // values are omitted from API requests. However, any field with an
  1570. // empty value appearing in NullFields will be sent to the server as
  1571. // null. It is an error if a field in this list has a non-empty value.
  1572. // This may be used to include null fields in Patch requests.
  1573. NullFields []string `json:"-"`
  1574. }
  1575. func (s *AdvertiserGroup) MarshalJSON() ([]byte, error) {
  1576. type NoMethod AdvertiserGroup
  1577. raw := NoMethod(*s)
  1578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1579. }
  1580. // AdvertiserGroupsListResponse: Advertiser Group List Response
  1581. type AdvertiserGroupsListResponse struct {
  1582. // AdvertiserGroups: Advertiser group collection.
  1583. AdvertiserGroups []*AdvertiserGroup `json:"advertiserGroups,omitempty"`
  1584. // Kind: Identifies what kind of resource this is. Value: the fixed
  1585. // string "dfareporting#advertiserGroupsListResponse".
  1586. Kind string `json:"kind,omitempty"`
  1587. // NextPageToken: Pagination token to be used for the next list
  1588. // operation.
  1589. NextPageToken string `json:"nextPageToken,omitempty"`
  1590. // ServerResponse contains the HTTP response code and headers from the
  1591. // server.
  1592. googleapi.ServerResponse `json:"-"`
  1593. // ForceSendFields is a list of field names (e.g. "AdvertiserGroups") to
  1594. // unconditionally include in API requests. By default, fields with
  1595. // empty values are omitted from API requests. However, any non-pointer,
  1596. // non-interface field appearing in ForceSendFields will be sent to the
  1597. // server regardless of whether the field is empty or not. This may be
  1598. // used to include empty fields in Patch requests.
  1599. ForceSendFields []string `json:"-"`
  1600. // NullFields is a list of field names (e.g. "AdvertiserGroups") to
  1601. // include in API requests with the JSON null value. By default, fields
  1602. // with empty values are omitted from API requests. However, any field
  1603. // with an empty value appearing in NullFields will be sent to the
  1604. // server as null. It is an error if a field in this list has a
  1605. // non-empty value. This may be used to include null fields in Patch
  1606. // requests.
  1607. NullFields []string `json:"-"`
  1608. }
  1609. func (s *AdvertiserGroupsListResponse) MarshalJSON() ([]byte, error) {
  1610. type NoMethod AdvertiserGroupsListResponse
  1611. raw := NoMethod(*s)
  1612. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1613. }
  1614. // AdvertisersListResponse: Advertiser List Response
  1615. type AdvertisersListResponse struct {
  1616. // Advertisers: Advertiser collection.
  1617. Advertisers []*Advertiser `json:"advertisers,omitempty"`
  1618. // Kind: Identifies what kind of resource this is. Value: the fixed
  1619. // string "dfareporting#advertisersListResponse".
  1620. Kind string `json:"kind,omitempty"`
  1621. // NextPageToken: Pagination token to be used for the next list
  1622. // operation.
  1623. NextPageToken string `json:"nextPageToken,omitempty"`
  1624. // ServerResponse contains the HTTP response code and headers from the
  1625. // server.
  1626. googleapi.ServerResponse `json:"-"`
  1627. // ForceSendFields is a list of field names (e.g. "Advertisers") to
  1628. // unconditionally include in API requests. By default, fields with
  1629. // empty values are omitted from API requests. However, any non-pointer,
  1630. // non-interface field appearing in ForceSendFields will be sent to the
  1631. // server regardless of whether the field is empty or not. This may be
  1632. // used to include empty fields in Patch requests.
  1633. ForceSendFields []string `json:"-"`
  1634. // NullFields is a list of field names (e.g. "Advertisers") to include
  1635. // in API requests with the JSON null value. By default, fields with
  1636. // empty values are omitted from API requests. However, any field with
  1637. // an empty value appearing in NullFields will be sent to the server as
  1638. // null. It is an error if a field in this list has a non-empty value.
  1639. // This may be used to include null fields in Patch requests.
  1640. NullFields []string `json:"-"`
  1641. }
  1642. func (s *AdvertisersListResponse) MarshalJSON() ([]byte, error) {
  1643. type NoMethod AdvertisersListResponse
  1644. raw := NoMethod(*s)
  1645. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1646. }
  1647. // AudienceSegment: Audience Segment.
  1648. type AudienceSegment struct {
  1649. // Allocation: Weight allocated to this segment. The weight assigned
  1650. // will be understood in proportion to the weights assigned to other
  1651. // segments in the same segment group. Acceptable values are 1 to 1000,
  1652. // inclusive.
  1653. Allocation int64 `json:"allocation,omitempty"`
  1654. // Id: ID of this audience segment. This is a read-only, auto-generated
  1655. // field.
  1656. Id int64 `json:"id,omitempty,string"`
  1657. // Name: Name of this audience segment. This is a required field and
  1658. // must be less than 65 characters long.
  1659. Name string `json:"name,omitempty"`
  1660. // ForceSendFields is a list of field names (e.g. "Allocation") to
  1661. // unconditionally include in API requests. By default, fields with
  1662. // empty values are omitted from API requests. However, any non-pointer,
  1663. // non-interface field appearing in ForceSendFields will be sent to the
  1664. // server regardless of whether the field is empty or not. This may be
  1665. // used to include empty fields in Patch requests.
  1666. ForceSendFields []string `json:"-"`
  1667. // NullFields is a list of field names (e.g. "Allocation") to include in
  1668. // API requests with the JSON null value. By default, fields with empty
  1669. // values are omitted from API requests. However, any field with an
  1670. // empty value appearing in NullFields will be sent to the server as
  1671. // null. It is an error if a field in this list has a non-empty value.
  1672. // This may be used to include null fields in Patch requests.
  1673. NullFields []string `json:"-"`
  1674. }
  1675. func (s *AudienceSegment) MarshalJSON() ([]byte, error) {
  1676. type NoMethod AudienceSegment
  1677. raw := NoMethod(*s)
  1678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1679. }
  1680. // AudienceSegmentGroup: Audience Segment Group.
  1681. type AudienceSegmentGroup struct {
  1682. // AudienceSegments: Audience segments assigned to this group. The
  1683. // number of segments must be between 2 and 100.
  1684. AudienceSegments []*AudienceSegment `json:"audienceSegments,omitempty"`
  1685. // Id: ID of this audience segment group. This is a read-only,
  1686. // auto-generated field.
  1687. Id int64 `json:"id,omitempty,string"`
  1688. // Name: Name of this audience segment group. This is a required field
  1689. // and must be less than 65 characters long.
  1690. Name string `json:"name,omitempty"`
  1691. // ForceSendFields is a list of field names (e.g. "AudienceSegments") to
  1692. // unconditionally include in API requests. By default, fields with
  1693. // empty values are omitted from API requests. However, any non-pointer,
  1694. // non-interface field appearing in ForceSendFields will be sent to the
  1695. // server regardless of whether the field is empty or not. This may be
  1696. // used to include empty fields in Patch requests.
  1697. ForceSendFields []string `json:"-"`
  1698. // NullFields is a list of field names (e.g. "AudienceSegments") to
  1699. // include in API requests with the JSON null value. By default, fields
  1700. // with empty values are omitted from API requests. However, any field
  1701. // with an empty value appearing in NullFields will be sent to the
  1702. // server as null. It is an error if a field in this list has a
  1703. // non-empty value. This may be used to include null fields in Patch
  1704. // requests.
  1705. NullFields []string `json:"-"`
  1706. }
  1707. func (s *AudienceSegmentGroup) MarshalJSON() ([]byte, error) {
  1708. type NoMethod AudienceSegmentGroup
  1709. raw := NoMethod(*s)
  1710. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1711. }
  1712. // Browser: Contains information about a browser that can be targeted by
  1713. // ads.
  1714. type Browser struct {
  1715. // BrowserVersionId: ID referring to this grouping of browser and
  1716. // version numbers. This is the ID used for targeting.
  1717. BrowserVersionId int64 `json:"browserVersionId,omitempty,string"`
  1718. // DartId: DART ID of this browser. This is the ID used when generating
  1719. // reports.
  1720. DartId int64 `json:"dartId,omitempty,string"`
  1721. // Kind: Identifies what kind of resource this is. Value: the fixed
  1722. // string "dfareporting#browser".
  1723. Kind string `json:"kind,omitempty"`
  1724. // MajorVersion: Major version number (leftmost number) of this browser.
  1725. // For example, for Chrome 5.0.376.86 beta, this field should be set to
  1726. // 5. An asterisk (*) may be used to target any version number, and a
  1727. // question mark (?) may be used to target cases where the version
  1728. // number cannot be identified. For example, Chrome *.* targets any
  1729. // version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1730. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1731. // server knows the browser is Firefox but can't tell which version it
  1732. // is.
  1733. MajorVersion string `json:"majorVersion,omitempty"`
  1734. // MinorVersion: Minor version number (number after first dot on left)
  1735. // of this browser. For example, for Chrome 5.0.375.86 beta, this field
  1736. // should be set to 0. An asterisk (*) may be used to target any version
  1737. // number, and a question mark (?) may be used to target cases where the
  1738. // version number cannot be identified. For example, Chrome *.* targets
  1739. // any version of Chrome: 1.2, 2.5, 3.5, and so on. Chrome 3.* targets
  1740. // Chrome 3.1, 3.5, but not 4.0. Firefox ?.? targets cases where the ad
  1741. // server knows the browser is Firefox but can't tell which version it
  1742. // is.
  1743. MinorVersion string `json:"minorVersion,omitempty"`
  1744. // Name: Name of this browser.
  1745. Name string `json:"name,omitempty"`
  1746. // ForceSendFields is a list of field names (e.g. "BrowserVersionId") to
  1747. // unconditionally include in API requests. By default, fields with
  1748. // empty values are omitted from API requests. However, any non-pointer,
  1749. // non-interface field appearing in ForceSendFields will be sent to the
  1750. // server regardless of whether the field is empty or not. This may be
  1751. // used to include empty fields in Patch requests.
  1752. ForceSendFields []string `json:"-"`
  1753. // NullFields is a list of field names (e.g. "BrowserVersionId") to
  1754. // include in API requests with the JSON null value. By default, fields
  1755. // with empty values are omitted from API requests. However, any field
  1756. // with an empty value appearing in NullFields will be sent to the
  1757. // server as null. It is an error if a field in this list has a
  1758. // non-empty value. This may be used to include null fields in Patch
  1759. // requests.
  1760. NullFields []string `json:"-"`
  1761. }
  1762. func (s *Browser) MarshalJSON() ([]byte, error) {
  1763. type NoMethod Browser
  1764. raw := NoMethod(*s)
  1765. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1766. }
  1767. // BrowsersListResponse: Browser List Response
  1768. type BrowsersListResponse struct {
  1769. // Browsers: Browser collection.
  1770. Browsers []*Browser `json:"browsers,omitempty"`
  1771. // Kind: Identifies what kind of resource this is. Value: the fixed
  1772. // string "dfareporting#browsersListResponse".
  1773. Kind string `json:"kind,omitempty"`
  1774. // ServerResponse contains the HTTP response code and headers from the
  1775. // server.
  1776. googleapi.ServerResponse `json:"-"`
  1777. // ForceSendFields is a list of field names (e.g. "Browsers") to
  1778. // unconditionally include in API requests. By default, fields with
  1779. // empty values are omitted from API requests. However, any non-pointer,
  1780. // non-interface field appearing in ForceSendFields will be sent to the
  1781. // server regardless of whether the field is empty or not. This may be
  1782. // used to include empty fields in Patch requests.
  1783. ForceSendFields []string `json:"-"`
  1784. // NullFields is a list of field names (e.g. "Browsers") to include in
  1785. // API requests with the JSON null value. By default, fields with empty
  1786. // values are omitted from API requests. However, any field with an
  1787. // empty value appearing in NullFields will be sent to the server as
  1788. // null. It is an error if a field in this list has a non-empty value.
  1789. // This may be used to include null fields in Patch requests.
  1790. NullFields []string `json:"-"`
  1791. }
  1792. func (s *BrowsersListResponse) MarshalJSON() ([]byte, error) {
  1793. type NoMethod BrowsersListResponse
  1794. raw := NoMethod(*s)
  1795. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1796. }
  1797. // Campaign: Contains properties of a DCM campaign.
  1798. type Campaign struct {
  1799. // AccountId: Account ID of this campaign. This is a read-only field
  1800. // that can be left blank.
  1801. AccountId int64 `json:"accountId,omitempty,string"`
  1802. // AdditionalCreativeOptimizationConfigurations: Additional creative
  1803. // optimization configurations for the campaign.
  1804. AdditionalCreativeOptimizationConfigurations []*CreativeOptimizationConfiguration `json:"additionalCreativeOptimizationConfigurations,omitempty"`
  1805. // AdvertiserGroupId: Advertiser group ID of the associated advertiser.
  1806. AdvertiserGroupId int64 `json:"advertiserGroupId,omitempty,string"`
  1807. // AdvertiserId: Advertiser ID of this campaign. This is a required
  1808. // field.
  1809. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  1810. // AdvertiserIdDimensionValue: Dimension value for the advertiser ID of
  1811. // this campaign. This is a read-only, auto-generated field.
  1812. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  1813. // Archived: Whether this campaign has been archived.
  1814. Archived bool `json:"archived,omitempty"`
  1815. // AudienceSegmentGroups: Audience segment groups assigned to this
  1816. // campaign. Cannot have more than 300 segment groups.
  1817. AudienceSegmentGroups []*AudienceSegmentGroup `json:"audienceSegmentGroups,omitempty"`
  1818. // BillingInvoiceCode: Billing invoice code included in the DCM client
  1819. // billing invoices associated with the campaign.
  1820. BillingInvoiceCode string `json:"billingInvoiceCode,omitempty"`
  1821. // ClickThroughUrlSuffixProperties: Click-through URL suffix override
  1822. // properties for this campaign.
  1823. ClickThroughUrlSuffixProperties *ClickThroughUrlSuffixProperties `json:"clickThroughUrlSuffixProperties,omitempty"`
  1824. // Comment: Arbitrary comments about this campaign. Must be less than
  1825. // 256 characters long.
  1826. Comment string `json:"comment,omitempty"`
  1827. // CreateInfo: Information about the creation of this campaign. This is
  1828. // a read-only field.
  1829. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  1830. // CreativeGroupIds: List of creative group IDs that are assigned to the
  1831. // campaign.
  1832. CreativeGroupIds googleapi.Int64s `json:"creativeGroupIds,omitempty"`
  1833. // CreativeOptimizationConfiguration: Creative optimization
  1834. // configuration for the campaign.
  1835. CreativeOptimizationConfiguration *CreativeOptimizationConfiguration `json:"creativeOptimizationConfiguration,omitempty"`
  1836. // DefaultClickThroughEventTagProperties: Click-through event tag ID
  1837. // override properties for this campaign.
  1838. DefaultClickThroughEventTagProperties *DefaultClickThroughEventTagProperties `json:"defaultClickThroughEventTagProperties,omitempty"`
  1839. // EndDate: Date on which the campaign will stop running. On insert, the
  1840. // end date must be today or a future date. The end date must be later
  1841. // than or be the same as the start date. If, for example, you set
  1842. // 6/25/2015 as both the start and end dates, the effective campaign run
  1843. // date is just that day only, 6/25/2015. The hours, minutes, and
  1844. // seconds of the end date should not be set, as doing so will result in
  1845. // an error. This is a required field.
  1846. EndDate string `json:"endDate,omitempty"`
  1847. // EventTagOverrides: Overrides that can be used to activate or
  1848. // deactivate advertiser event tags.
  1849. EventTagOverrides []*EventTagOverride `json:"eventTagOverrides,omitempty"`
  1850. // ExternalId: External ID for this campaign.
  1851. ExternalId string `json:"externalId,omitempty"`
  1852. // Id: ID of this campaign. This is a read-only auto-generated field.
  1853. Id int64 `json:"id,omitempty,string"`
  1854. // IdDimensionValue: Dimension value for the ID of this campaign. This
  1855. // is a read-only, auto-generated field.
  1856. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  1857. // Kind: Identifies what kind of resource this is. Value: the fixed
  1858. // string "dfareporting#campaign".
  1859. Kind string `json:"kind,omitempty"`
  1860. // LastModifiedInfo: Information about the most recent modification of
  1861. // this campaign. This is a read-only field.
  1862. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  1863. // LookbackConfiguration: Lookback window settings for the campaign.
  1864. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  1865. // Name: Name of this campaign. This is a required field and must be
  1866. // less than 256 characters long and unique among campaigns of the same
  1867. // advertiser.
  1868. Name string `json:"name,omitempty"`
  1869. // NielsenOcrEnabled: Whether Nielsen reports are enabled for this
  1870. // campaign.
  1871. NielsenOcrEnabled bool `json:"nielsenOcrEnabled,omitempty"`
  1872. // StartDate: Date on which the campaign starts running. The start date
  1873. // can be any date. The hours, minutes, and seconds of the start date
  1874. // should not be set, as doing so will result in an error. This is a
  1875. // required field.
  1876. StartDate string `json:"startDate,omitempty"`
  1877. // SubaccountId: Subaccount ID of this campaign. This is a read-only
  1878. // field that can be left blank.
  1879. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  1880. // TraffickerEmails: Campaign trafficker contact emails.
  1881. TraffickerEmails []string `json:"traffickerEmails,omitempty"`
  1882. // ServerResponse contains the HTTP response code and headers from the
  1883. // server.
  1884. googleapi.ServerResponse `json:"-"`
  1885. // ForceSendFields is a list of field names (e.g. "AccountId") to
  1886. // unconditionally include in API requests. By default, fields with
  1887. // empty values are omitted from API requests. However, any non-pointer,
  1888. // non-interface field appearing in ForceSendFields will be sent to the
  1889. // server regardless of whether the field is empty or not. This may be
  1890. // used to include empty fields in Patch requests.
  1891. ForceSendFields []string `json:"-"`
  1892. // NullFields is a list of field names (e.g. "AccountId") to include in
  1893. // API requests with the JSON null value. By default, fields with empty
  1894. // values are omitted from API requests. However, any field with an
  1895. // empty value appearing in NullFields will be sent to the server as
  1896. // null. It is an error if a field in this list has a non-empty value.
  1897. // This may be used to include null fields in Patch requests.
  1898. NullFields []string `json:"-"`
  1899. }
  1900. func (s *Campaign) MarshalJSON() ([]byte, error) {
  1901. type NoMethod Campaign
  1902. raw := NoMethod(*s)
  1903. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1904. }
  1905. // CampaignCreativeAssociation: Identifies a creative which has been
  1906. // associated with a given campaign.
  1907. type CampaignCreativeAssociation struct {
  1908. // CreativeId: ID of the creative associated with the campaign. This is
  1909. // a required field.
  1910. CreativeId int64 `json:"creativeId,omitempty,string"`
  1911. // Kind: Identifies what kind of resource this is. Value: the fixed
  1912. // string "dfareporting#campaignCreativeAssociation".
  1913. Kind string `json:"kind,omitempty"`
  1914. // ServerResponse contains the HTTP response code and headers from the
  1915. // server.
  1916. googleapi.ServerResponse `json:"-"`
  1917. // ForceSendFields is a list of field names (e.g. "CreativeId") to
  1918. // unconditionally include in API requests. By default, fields with
  1919. // empty values are omitted from API requests. However, any non-pointer,
  1920. // non-interface field appearing in ForceSendFields will be sent to the
  1921. // server regardless of whether the field is empty or not. This may be
  1922. // used to include empty fields in Patch requests.
  1923. ForceSendFields []string `json:"-"`
  1924. // NullFields is a list of field names (e.g. "CreativeId") to include in
  1925. // API requests with the JSON null value. By default, fields with empty
  1926. // values are omitted from API requests. However, any field with an
  1927. // empty value appearing in NullFields will be sent to the server as
  1928. // null. It is an error if a field in this list has a non-empty value.
  1929. // This may be used to include null fields in Patch requests.
  1930. NullFields []string `json:"-"`
  1931. }
  1932. func (s *CampaignCreativeAssociation) MarshalJSON() ([]byte, error) {
  1933. type NoMethod CampaignCreativeAssociation
  1934. raw := NoMethod(*s)
  1935. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1936. }
  1937. // CampaignCreativeAssociationsListResponse: Campaign Creative
  1938. // Association List Response
  1939. type CampaignCreativeAssociationsListResponse struct {
  1940. // CampaignCreativeAssociations: Campaign creative association
  1941. // collection
  1942. CampaignCreativeAssociations []*CampaignCreativeAssociation `json:"campaignCreativeAssociations,omitempty"`
  1943. // Kind: Identifies what kind of resource this is. Value: the fixed
  1944. // string "dfareporting#campaignCreativeAssociationsListResponse".
  1945. Kind string `json:"kind,omitempty"`
  1946. // NextPageToken: Pagination token to be used for the next list
  1947. // operation.
  1948. NextPageToken string `json:"nextPageToken,omitempty"`
  1949. // ServerResponse contains the HTTP response code and headers from the
  1950. // server.
  1951. googleapi.ServerResponse `json:"-"`
  1952. // ForceSendFields is a list of field names (e.g.
  1953. // "CampaignCreativeAssociations") to unconditionally include in API
  1954. // requests. By default, fields with empty values are omitted from API
  1955. // requests. However, any non-pointer, non-interface field appearing in
  1956. // ForceSendFields will be sent to the server regardless of whether the
  1957. // field is empty or not. This may be used to include empty fields in
  1958. // Patch requests.
  1959. ForceSendFields []string `json:"-"`
  1960. // NullFields is a list of field names (e.g.
  1961. // "CampaignCreativeAssociations") to include in API requests with the
  1962. // JSON null value. By default, fields with empty values are omitted
  1963. // from API requests. However, any field with an empty value appearing
  1964. // in NullFields will be sent to the server as null. It is an error if a
  1965. // field in this list has a non-empty value. This may be used to include
  1966. // null fields in Patch requests.
  1967. NullFields []string `json:"-"`
  1968. }
  1969. func (s *CampaignCreativeAssociationsListResponse) MarshalJSON() ([]byte, error) {
  1970. type NoMethod CampaignCreativeAssociationsListResponse
  1971. raw := NoMethod(*s)
  1972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1973. }
  1974. // CampaignsListResponse: Campaign List Response
  1975. type CampaignsListResponse struct {
  1976. // Campaigns: Campaign collection.
  1977. Campaigns []*Campaign `json:"campaigns,omitempty"`
  1978. // Kind: Identifies what kind of resource this is. Value: the fixed
  1979. // string "dfareporting#campaignsListResponse".
  1980. Kind string `json:"kind,omitempty"`
  1981. // NextPageToken: Pagination token to be used for the next list
  1982. // operation.
  1983. NextPageToken string `json:"nextPageToken,omitempty"`
  1984. // ServerResponse contains the HTTP response code and headers from the
  1985. // server.
  1986. googleapi.ServerResponse `json:"-"`
  1987. // ForceSendFields is a list of field names (e.g. "Campaigns") to
  1988. // unconditionally include in API requests. By default, fields with
  1989. // empty values are omitted from API requests. However, any non-pointer,
  1990. // non-interface field appearing in ForceSendFields will be sent to the
  1991. // server regardless of whether the field is empty or not. This may be
  1992. // used to include empty fields in Patch requests.
  1993. ForceSendFields []string `json:"-"`
  1994. // NullFields is a list of field names (e.g. "Campaigns") to include in
  1995. // API requests with the JSON null value. By default, fields with empty
  1996. // values are omitted from API requests. However, any field with an
  1997. // empty value appearing in NullFields will be sent to the server as
  1998. // null. It is an error if a field in this list has a non-empty value.
  1999. // This may be used to include null fields in Patch requests.
  2000. NullFields []string `json:"-"`
  2001. }
  2002. func (s *CampaignsListResponse) MarshalJSON() ([]byte, error) {
  2003. type NoMethod CampaignsListResponse
  2004. raw := NoMethod(*s)
  2005. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2006. }
  2007. // ChangeLog: Describes a change that a user has made to a resource.
  2008. type ChangeLog struct {
  2009. // AccountId: Account ID of the modified object.
  2010. AccountId int64 `json:"accountId,omitempty,string"`
  2011. // Action: Action which caused the change.
  2012. Action string `json:"action,omitempty"`
  2013. // ChangeTime: Time when the object was modified.
  2014. ChangeTime string `json:"changeTime,omitempty"`
  2015. // FieldName: Field name of the object which changed.
  2016. FieldName string `json:"fieldName,omitempty"`
  2017. // Id: ID of this change log.
  2018. Id int64 `json:"id,omitempty,string"`
  2019. // Kind: Identifies what kind of resource this is. Value: the fixed
  2020. // string "dfareporting#changeLog".
  2021. Kind string `json:"kind,omitempty"`
  2022. // NewValue: New value of the object field.
  2023. NewValue string `json:"newValue,omitempty"`
  2024. // ObjectId: ID of the object of this change log. The object could be a
  2025. // campaign, placement, ad, or other type.
  2026. ObjectId int64 `json:"objectId,omitempty,string"`
  2027. // ObjectType: Object type of the change log.
  2028. ObjectType string `json:"objectType,omitempty"`
  2029. // OldValue: Old value of the object field.
  2030. OldValue string `json:"oldValue,omitempty"`
  2031. // SubaccountId: Subaccount ID of the modified object.
  2032. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  2033. // TransactionId: Transaction ID of this change log. When a single API
  2034. // call results in many changes, each change will have a separate ID in
  2035. // the change log but will share the same transactionId.
  2036. TransactionId int64 `json:"transactionId,omitempty,string"`
  2037. // UserProfileId: ID of the user who modified the object.
  2038. UserProfileId int64 `json:"userProfileId,omitempty,string"`
  2039. // UserProfileName: User profile name of the user who modified the
  2040. // object.
  2041. UserProfileName string `json:"userProfileName,omitempty"`
  2042. // ServerResponse contains the HTTP response code and headers from the
  2043. // server.
  2044. googleapi.ServerResponse `json:"-"`
  2045. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2046. // unconditionally include in API requests. By default, fields with
  2047. // empty values are omitted from API requests. However, any non-pointer,
  2048. // non-interface field appearing in ForceSendFields will be sent to the
  2049. // server regardless of whether the field is empty or not. This may be
  2050. // used to include empty fields in Patch requests.
  2051. ForceSendFields []string `json:"-"`
  2052. // NullFields is a list of field names (e.g. "AccountId") to include in
  2053. // API requests with the JSON null value. By default, fields with empty
  2054. // values are omitted from API requests. However, any field with an
  2055. // empty value appearing in NullFields will be sent to the server as
  2056. // null. It is an error if a field in this list has a non-empty value.
  2057. // This may be used to include null fields in Patch requests.
  2058. NullFields []string `json:"-"`
  2059. }
  2060. func (s *ChangeLog) MarshalJSON() ([]byte, error) {
  2061. type NoMethod ChangeLog
  2062. raw := NoMethod(*s)
  2063. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2064. }
  2065. // ChangeLogsListResponse: Change Log List Response
  2066. type ChangeLogsListResponse struct {
  2067. // ChangeLogs: Change log collection.
  2068. ChangeLogs []*ChangeLog `json:"changeLogs,omitempty"`
  2069. // Kind: Identifies what kind of resource this is. Value: the fixed
  2070. // string "dfareporting#changeLogsListResponse".
  2071. Kind string `json:"kind,omitempty"`
  2072. // NextPageToken: Pagination token to be used for the next list
  2073. // operation.
  2074. NextPageToken string `json:"nextPageToken,omitempty"`
  2075. // ServerResponse contains the HTTP response code and headers from the
  2076. // server.
  2077. googleapi.ServerResponse `json:"-"`
  2078. // ForceSendFields is a list of field names (e.g. "ChangeLogs") to
  2079. // unconditionally include in API requests. By default, fields with
  2080. // empty values are omitted from API requests. However, any non-pointer,
  2081. // non-interface field appearing in ForceSendFields will be sent to the
  2082. // server regardless of whether the field is empty or not. This may be
  2083. // used to include empty fields in Patch requests.
  2084. ForceSendFields []string `json:"-"`
  2085. // NullFields is a list of field names (e.g. "ChangeLogs") to include in
  2086. // API requests with the JSON null value. By default, fields with empty
  2087. // values are omitted from API requests. However, any field with an
  2088. // empty value appearing in NullFields will be sent to the server as
  2089. // null. It is an error if a field in this list has a non-empty value.
  2090. // This may be used to include null fields in Patch requests.
  2091. NullFields []string `json:"-"`
  2092. }
  2093. func (s *ChangeLogsListResponse) MarshalJSON() ([]byte, error) {
  2094. type NoMethod ChangeLogsListResponse
  2095. raw := NoMethod(*s)
  2096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2097. }
  2098. // CitiesListResponse: City List Response
  2099. type CitiesListResponse struct {
  2100. // Cities: City collection.
  2101. Cities []*City `json:"cities,omitempty"`
  2102. // Kind: Identifies what kind of resource this is. Value: the fixed
  2103. // string "dfareporting#citiesListResponse".
  2104. Kind string `json:"kind,omitempty"`
  2105. // ServerResponse contains the HTTP response code and headers from the
  2106. // server.
  2107. googleapi.ServerResponse `json:"-"`
  2108. // ForceSendFields is a list of field names (e.g. "Cities") to
  2109. // unconditionally include in API requests. By default, fields with
  2110. // empty values are omitted from API requests. However, any non-pointer,
  2111. // non-interface field appearing in ForceSendFields will be sent to the
  2112. // server regardless of whether the field is empty or not. This may be
  2113. // used to include empty fields in Patch requests.
  2114. ForceSendFields []string `json:"-"`
  2115. // NullFields is a list of field names (e.g. "Cities") to include in API
  2116. // requests with the JSON null value. By default, fields with empty
  2117. // values are omitted from API requests. However, any field with an
  2118. // empty value appearing in NullFields will be sent to the server as
  2119. // null. It is an error if a field in this list has a non-empty value.
  2120. // This may be used to include null fields in Patch requests.
  2121. NullFields []string `json:"-"`
  2122. }
  2123. func (s *CitiesListResponse) MarshalJSON() ([]byte, error) {
  2124. type NoMethod CitiesListResponse
  2125. raw := NoMethod(*s)
  2126. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2127. }
  2128. // City: Contains information about a city that can be targeted by ads.
  2129. type City struct {
  2130. // CountryCode: Country code of the country to which this city belongs.
  2131. CountryCode string `json:"countryCode,omitempty"`
  2132. // CountryDartId: DART ID of the country to which this city belongs.
  2133. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  2134. // DartId: DART ID of this city. This is the ID used for targeting and
  2135. // generating reports.
  2136. DartId int64 `json:"dartId,omitempty,string"`
  2137. // Kind: Identifies what kind of resource this is. Value: the fixed
  2138. // string "dfareporting#city".
  2139. Kind string `json:"kind,omitempty"`
  2140. // MetroCode: Metro region code of the metro region (DMA) to which this
  2141. // city belongs.
  2142. MetroCode string `json:"metroCode,omitempty"`
  2143. // MetroDmaId: ID of the metro region (DMA) to which this city belongs.
  2144. MetroDmaId int64 `json:"metroDmaId,omitempty,string"`
  2145. // Name: Name of this city.
  2146. Name string `json:"name,omitempty"`
  2147. // RegionCode: Region code of the region to which this city belongs.
  2148. RegionCode string `json:"regionCode,omitempty"`
  2149. // RegionDartId: DART ID of the region to which this city belongs.
  2150. RegionDartId int64 `json:"regionDartId,omitempty,string"`
  2151. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2152. // unconditionally include in API requests. By default, fields with
  2153. // empty values are omitted from API requests. However, any non-pointer,
  2154. // non-interface field appearing in ForceSendFields will be sent to the
  2155. // server regardless of whether the field is empty or not. This may be
  2156. // used to include empty fields in Patch requests.
  2157. ForceSendFields []string `json:"-"`
  2158. // NullFields is a list of field names (e.g. "CountryCode") to include
  2159. // in API requests with the JSON null value. By default, fields with
  2160. // empty values are omitted from API requests. However, any field with
  2161. // an empty value appearing in NullFields will be sent to the server as
  2162. // null. It is an error if a field in this list has a non-empty value.
  2163. // This may be used to include null fields in Patch requests.
  2164. NullFields []string `json:"-"`
  2165. }
  2166. func (s *City) MarshalJSON() ([]byte, error) {
  2167. type NoMethod City
  2168. raw := NoMethod(*s)
  2169. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2170. }
  2171. // ClickTag: Creative Click Tag.
  2172. type ClickTag struct {
  2173. // EventName: Advertiser event name associated with the click tag. This
  2174. // field is used by DISPLAY_IMAGE_GALLERY and HTML5_BANNER creatives.
  2175. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  2176. EventName string `json:"eventName,omitempty"`
  2177. // Name: Parameter name for the specified click tag. For
  2178. // DISPLAY_IMAGE_GALLERY creative assets, this field must match the
  2179. // value of the creative asset's creativeAssetId.name field.
  2180. Name string `json:"name,omitempty"`
  2181. // Value: Parameter value for the specified click tag. This field
  2182. // contains a click-through url.
  2183. Value string `json:"value,omitempty"`
  2184. // ForceSendFields is a list of field names (e.g. "EventName") to
  2185. // unconditionally include in API requests. By default, fields with
  2186. // empty values are omitted from API requests. However, any non-pointer,
  2187. // non-interface field appearing in ForceSendFields will be sent to the
  2188. // server regardless of whether the field is empty or not. This may be
  2189. // used to include empty fields in Patch requests.
  2190. ForceSendFields []string `json:"-"`
  2191. // NullFields is a list of field names (e.g. "EventName") to include in
  2192. // API requests with the JSON null value. By default, fields with empty
  2193. // values are omitted from API requests. However, any field with an
  2194. // empty value appearing in NullFields will be sent to the server as
  2195. // null. It is an error if a field in this list has a non-empty value.
  2196. // This may be used to include null fields in Patch requests.
  2197. NullFields []string `json:"-"`
  2198. }
  2199. func (s *ClickTag) MarshalJSON() ([]byte, error) {
  2200. type NoMethod ClickTag
  2201. raw := NoMethod(*s)
  2202. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2203. }
  2204. // ClickThroughUrl: Click-through URL
  2205. type ClickThroughUrl struct {
  2206. // ComputedClickThroughUrl: Read-only convenience field representing the
  2207. // actual URL that will be used for this click-through. The URL is
  2208. // computed as follows:
  2209. // - If defaultLandingPage is enabled then the campaign's default
  2210. // landing page URL is assigned to this field.
  2211. // - If defaultLandingPage is not enabled and a landingPageId is
  2212. // specified then that landing page's URL is assigned to this field.
  2213. // - If neither of the above cases apply, then the customClickThroughUrl
  2214. // is assigned to this field.
  2215. ComputedClickThroughUrl string `json:"computedClickThroughUrl,omitempty"`
  2216. // CustomClickThroughUrl: Custom click-through URL. Applicable if the
  2217. // defaultLandingPage field is set to false and the landingPageId field
  2218. // is left unset.
  2219. CustomClickThroughUrl string `json:"customClickThroughUrl,omitempty"`
  2220. // DefaultLandingPage: Whether the campaign default landing page is
  2221. // used.
  2222. DefaultLandingPage bool `json:"defaultLandingPage,omitempty"`
  2223. // LandingPageId: ID of the landing page for the click-through URL.
  2224. // Applicable if the defaultLandingPage field is set to false.
  2225. LandingPageId int64 `json:"landingPageId,omitempty,string"`
  2226. // ForceSendFields is a list of field names (e.g.
  2227. // "ComputedClickThroughUrl") to unconditionally include in API
  2228. // requests. By default, fields with empty values are omitted from API
  2229. // requests. However, any non-pointer, non-interface field appearing in
  2230. // ForceSendFields will be sent to the server regardless of whether the
  2231. // field is empty or not. This may be used to include empty fields in
  2232. // Patch requests.
  2233. ForceSendFields []string `json:"-"`
  2234. // NullFields is a list of field names (e.g. "ComputedClickThroughUrl")
  2235. // to include in API requests with the JSON null value. By default,
  2236. // fields with empty values are omitted from API requests. However, any
  2237. // field with an empty value appearing in NullFields will be sent to the
  2238. // server as null. It is an error if a field in this list has a
  2239. // non-empty value. This may be used to include null fields in Patch
  2240. // requests.
  2241. NullFields []string `json:"-"`
  2242. }
  2243. func (s *ClickThroughUrl) MarshalJSON() ([]byte, error) {
  2244. type NoMethod ClickThroughUrl
  2245. raw := NoMethod(*s)
  2246. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2247. }
  2248. // ClickThroughUrlSuffixProperties: Click Through URL Suffix settings.
  2249. type ClickThroughUrlSuffixProperties struct {
  2250. // ClickThroughUrlSuffix: Click-through URL suffix to apply to all ads
  2251. // in this entity's scope. Must be less than 128 characters long.
  2252. ClickThroughUrlSuffix string `json:"clickThroughUrlSuffix,omitempty"`
  2253. // OverrideInheritedSuffix: Whether this entity should override the
  2254. // inherited click-through URL suffix with its own defined value.
  2255. OverrideInheritedSuffix bool `json:"overrideInheritedSuffix,omitempty"`
  2256. // ForceSendFields is a list of field names (e.g.
  2257. // "ClickThroughUrlSuffix") to unconditionally include in API requests.
  2258. // By default, fields with empty values are omitted from API requests.
  2259. // However, any non-pointer, non-interface field appearing in
  2260. // ForceSendFields will be sent to the server regardless of whether the
  2261. // field is empty or not. This may be used to include empty fields in
  2262. // Patch requests.
  2263. ForceSendFields []string `json:"-"`
  2264. // NullFields is a list of field names (e.g. "ClickThroughUrlSuffix") to
  2265. // include in API requests with the JSON null value. By default, fields
  2266. // with empty values are omitted from API requests. However, any field
  2267. // with an empty value appearing in NullFields will be sent to the
  2268. // server as null. It is an error if a field in this list has a
  2269. // non-empty value. This may be used to include null fields in Patch
  2270. // requests.
  2271. NullFields []string `json:"-"`
  2272. }
  2273. func (s *ClickThroughUrlSuffixProperties) MarshalJSON() ([]byte, error) {
  2274. type NoMethod ClickThroughUrlSuffixProperties
  2275. raw := NoMethod(*s)
  2276. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2277. }
  2278. // CompanionClickThroughOverride: Companion Click-through override.
  2279. type CompanionClickThroughOverride struct {
  2280. // ClickThroughUrl: Click-through URL of this companion click-through
  2281. // override.
  2282. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  2283. // CreativeId: ID of the creative for this companion click-through
  2284. // override.
  2285. CreativeId int64 `json:"creativeId,omitempty,string"`
  2286. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  2287. // unconditionally include in API requests. By default, fields with
  2288. // empty values are omitted from API requests. However, any non-pointer,
  2289. // non-interface field appearing in ForceSendFields will be sent to the
  2290. // server regardless of whether the field is empty or not. This may be
  2291. // used to include empty fields in Patch requests.
  2292. ForceSendFields []string `json:"-"`
  2293. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  2294. // include in API requests with the JSON null value. By default, fields
  2295. // with empty values are omitted from API requests. However, any field
  2296. // with an empty value appearing in NullFields will be sent to the
  2297. // server as null. It is an error if a field in this list has a
  2298. // non-empty value. This may be used to include null fields in Patch
  2299. // requests.
  2300. NullFields []string `json:"-"`
  2301. }
  2302. func (s *CompanionClickThroughOverride) MarshalJSON() ([]byte, error) {
  2303. type NoMethod CompanionClickThroughOverride
  2304. raw := NoMethod(*s)
  2305. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2306. }
  2307. // CompanionSetting: Companion Settings
  2308. type CompanionSetting struct {
  2309. // CompanionsDisabled: Whether companions are disabled for this
  2310. // placement.
  2311. CompanionsDisabled bool `json:"companionsDisabled,omitempty"`
  2312. // EnabledSizes: Whitelist of companion sizes to be served to this
  2313. // placement. Set this list to null or empty to serve all companion
  2314. // sizes.
  2315. EnabledSizes []*Size `json:"enabledSizes,omitempty"`
  2316. // ImageOnly: Whether to serve only static images as companions.
  2317. ImageOnly bool `json:"imageOnly,omitempty"`
  2318. // Kind: Identifies what kind of resource this is. Value: the fixed
  2319. // string "dfareporting#companionSetting".
  2320. Kind string `json:"kind,omitempty"`
  2321. // ForceSendFields is a list of field names (e.g. "CompanionsDisabled")
  2322. // to unconditionally include in API requests. By default, fields with
  2323. // empty values are omitted from API requests. However, any non-pointer,
  2324. // non-interface field appearing in ForceSendFields will be sent to the
  2325. // server regardless of whether the field is empty or not. This may be
  2326. // used to include empty fields in Patch requests.
  2327. ForceSendFields []string `json:"-"`
  2328. // NullFields is a list of field names (e.g. "CompanionsDisabled") to
  2329. // include in API requests with the JSON null value. By default, fields
  2330. // with empty values are omitted from API requests. However, any field
  2331. // with an empty value appearing in NullFields will be sent to the
  2332. // server as null. It is an error if a field in this list has a
  2333. // non-empty value. This may be used to include null fields in Patch
  2334. // requests.
  2335. NullFields []string `json:"-"`
  2336. }
  2337. func (s *CompanionSetting) MarshalJSON() ([]byte, error) {
  2338. type NoMethod CompanionSetting
  2339. raw := NoMethod(*s)
  2340. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2341. }
  2342. // CompatibleFields: Represents a response to the queryCompatibleFields
  2343. // method.
  2344. type CompatibleFields struct {
  2345. // CrossDimensionReachReportCompatibleFields: Contains items that are
  2346. // compatible to be selected for a report of type
  2347. // "CROSS_DIMENSION_REACH".
  2348. CrossDimensionReachReportCompatibleFields *CrossDimensionReachReportCompatibleFields `json:"crossDimensionReachReportCompatibleFields,omitempty"`
  2349. // FloodlightReportCompatibleFields: Contains items that are compatible
  2350. // to be selected for a report of type "FLOODLIGHT".
  2351. FloodlightReportCompatibleFields *FloodlightReportCompatibleFields `json:"floodlightReportCompatibleFields,omitempty"`
  2352. // Kind: The kind of resource this is, in this case
  2353. // dfareporting#compatibleFields.
  2354. Kind string `json:"kind,omitempty"`
  2355. // PathToConversionReportCompatibleFields: Contains items that are
  2356. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  2357. PathToConversionReportCompatibleFields *PathToConversionReportCompatibleFields `json:"pathToConversionReportCompatibleFields,omitempty"`
  2358. // ReachReportCompatibleFields: Contains items that are compatible to be
  2359. // selected for a report of type "REACH".
  2360. ReachReportCompatibleFields *ReachReportCompatibleFields `json:"reachReportCompatibleFields,omitempty"`
  2361. // ReportCompatibleFields: Contains items that are compatible to be
  2362. // selected for a report of type "STANDARD".
  2363. ReportCompatibleFields *ReportCompatibleFields `json:"reportCompatibleFields,omitempty"`
  2364. // ServerResponse contains the HTTP response code and headers from the
  2365. // server.
  2366. googleapi.ServerResponse `json:"-"`
  2367. // ForceSendFields is a list of field names (e.g.
  2368. // "CrossDimensionReachReportCompatibleFields") to unconditionally
  2369. // include in API requests. By default, fields with empty values are
  2370. // omitted from API requests. However, any non-pointer, non-interface
  2371. // field appearing in ForceSendFields will be sent to the server
  2372. // regardless of whether the field is empty or not. This may be used to
  2373. // include empty fields in Patch requests.
  2374. ForceSendFields []string `json:"-"`
  2375. // NullFields is a list of field names (e.g.
  2376. // "CrossDimensionReachReportCompatibleFields") to include in API
  2377. // requests with the JSON null value. By default, fields with empty
  2378. // values are omitted from API requests. However, any field with an
  2379. // empty value appearing in NullFields will be sent to the server as
  2380. // null. It is an error if a field in this list has a non-empty value.
  2381. // This may be used to include null fields in Patch requests.
  2382. NullFields []string `json:"-"`
  2383. }
  2384. func (s *CompatibleFields) MarshalJSON() ([]byte, error) {
  2385. type NoMethod CompatibleFields
  2386. raw := NoMethod(*s)
  2387. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2388. }
  2389. // ConnectionType: Contains information about an internet connection
  2390. // type that can be targeted by ads. Clients can use the connection type
  2391. // to target mobile vs. broadband users.
  2392. type ConnectionType struct {
  2393. // Id: ID of this connection type.
  2394. Id int64 `json:"id,omitempty,string"`
  2395. // Kind: Identifies what kind of resource this is. Value: the fixed
  2396. // string "dfareporting#connectionType".
  2397. Kind string `json:"kind,omitempty"`
  2398. // Name: Name of this connection type.
  2399. Name string `json:"name,omitempty"`
  2400. // ServerResponse contains the HTTP response code and headers from the
  2401. // server.
  2402. googleapi.ServerResponse `json:"-"`
  2403. // ForceSendFields is a list of field names (e.g. "Id") to
  2404. // 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. "Id") to include in API
  2411. // requests with the JSON null value. By default, fields with empty
  2412. // values are omitted from API requests. However, any field with an
  2413. // empty value appearing in NullFields will be sent to the server as
  2414. // null. It is an error if a field in this list has a non-empty value.
  2415. // This may be used to include null fields in Patch requests.
  2416. NullFields []string `json:"-"`
  2417. }
  2418. func (s *ConnectionType) MarshalJSON() ([]byte, error) {
  2419. type NoMethod ConnectionType
  2420. raw := NoMethod(*s)
  2421. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2422. }
  2423. // ConnectionTypesListResponse: Connection Type List Response
  2424. type ConnectionTypesListResponse struct {
  2425. // ConnectionTypes: Collection of connection types such as broadband and
  2426. // mobile.
  2427. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  2428. // Kind: Identifies what kind of resource this is. Value: the fixed
  2429. // string "dfareporting#connectionTypesListResponse".
  2430. Kind string `json:"kind,omitempty"`
  2431. // ServerResponse contains the HTTP response code and headers from the
  2432. // server.
  2433. googleapi.ServerResponse `json:"-"`
  2434. // ForceSendFields is a list of field names (e.g. "ConnectionTypes") to
  2435. // unconditionally include in API requests. By default, fields with
  2436. // empty values are omitted from API requests. However, any non-pointer,
  2437. // non-interface field appearing in ForceSendFields will be sent to the
  2438. // server regardless of whether the field is empty or not. This may be
  2439. // used to include empty fields in Patch requests.
  2440. ForceSendFields []string `json:"-"`
  2441. // NullFields is a list of field names (e.g. "ConnectionTypes") to
  2442. // include in API requests with the JSON null value. By default, fields
  2443. // with empty values are omitted from API requests. However, any field
  2444. // with an empty value appearing in NullFields will be sent to the
  2445. // server as null. It is an error if a field in this list has a
  2446. // non-empty value. This may be used to include null fields in Patch
  2447. // requests.
  2448. NullFields []string `json:"-"`
  2449. }
  2450. func (s *ConnectionTypesListResponse) MarshalJSON() ([]byte, error) {
  2451. type NoMethod ConnectionTypesListResponse
  2452. raw := NoMethod(*s)
  2453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2454. }
  2455. // ContentCategoriesListResponse: Content Category List Response
  2456. type ContentCategoriesListResponse struct {
  2457. // ContentCategories: Content category collection.
  2458. ContentCategories []*ContentCategory `json:"contentCategories,omitempty"`
  2459. // Kind: Identifies what kind of resource this is. Value: the fixed
  2460. // string "dfareporting#contentCategoriesListResponse".
  2461. Kind string `json:"kind,omitempty"`
  2462. // NextPageToken: Pagination token to be used for the next list
  2463. // operation.
  2464. NextPageToken string `json:"nextPageToken,omitempty"`
  2465. // ServerResponse contains the HTTP response code and headers from the
  2466. // server.
  2467. googleapi.ServerResponse `json:"-"`
  2468. // ForceSendFields is a list of field names (e.g. "ContentCategories")
  2469. // to unconditionally include in API requests. By default, fields with
  2470. // empty values are omitted from API requests. However, any non-pointer,
  2471. // non-interface field appearing in ForceSendFields will be sent to the
  2472. // server regardless of whether the field is empty or not. This may be
  2473. // used to include empty fields in Patch requests.
  2474. ForceSendFields []string `json:"-"`
  2475. // NullFields is a list of field names (e.g. "ContentCategories") to
  2476. // include in API requests with the JSON null value. By default, fields
  2477. // with empty values are omitted from API requests. However, any field
  2478. // with an empty value appearing in NullFields will be sent to the
  2479. // server as null. It is an error if a field in this list has a
  2480. // non-empty value. This may be used to include null fields in Patch
  2481. // requests.
  2482. NullFields []string `json:"-"`
  2483. }
  2484. func (s *ContentCategoriesListResponse) MarshalJSON() ([]byte, error) {
  2485. type NoMethod ContentCategoriesListResponse
  2486. raw := NoMethod(*s)
  2487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2488. }
  2489. // ContentCategory: Organizes placements according to the contents of
  2490. // their associated webpages.
  2491. type ContentCategory struct {
  2492. // AccountId: Account ID of this content category. This is a read-only
  2493. // field that can be left blank.
  2494. AccountId int64 `json:"accountId,omitempty,string"`
  2495. // Id: ID of this content category. This is a read-only, auto-generated
  2496. // field.
  2497. Id int64 `json:"id,omitempty,string"`
  2498. // Kind: Identifies what kind of resource this is. Value: the fixed
  2499. // string "dfareporting#contentCategory".
  2500. Kind string `json:"kind,omitempty"`
  2501. // Name: Name of this content category. This is a required field and
  2502. // must be less than 256 characters long and unique among content
  2503. // categories of the same account.
  2504. Name string `json:"name,omitempty"`
  2505. // ServerResponse contains the HTTP response code and headers from the
  2506. // server.
  2507. googleapi.ServerResponse `json:"-"`
  2508. // ForceSendFields is a list of field names (e.g. "AccountId") to
  2509. // unconditionally include in API requests. By default, fields with
  2510. // empty values are omitted from API requests. However, any non-pointer,
  2511. // non-interface field appearing in ForceSendFields will be sent to the
  2512. // server regardless of whether the field is empty or not. This may be
  2513. // used to include empty fields in Patch requests.
  2514. ForceSendFields []string `json:"-"`
  2515. // NullFields is a list of field names (e.g. "AccountId") to include in
  2516. // API requests with the JSON null value. By default, fields with empty
  2517. // values are omitted from API requests. However, any field with an
  2518. // empty value appearing in NullFields will be sent to the server as
  2519. // null. It is an error if a field in this list has a non-empty value.
  2520. // This may be used to include null fields in Patch requests.
  2521. NullFields []string `json:"-"`
  2522. }
  2523. func (s *ContentCategory) MarshalJSON() ([]byte, error) {
  2524. type NoMethod ContentCategory
  2525. raw := NoMethod(*s)
  2526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2527. }
  2528. // Conversion: A Conversion represents when a user successfully performs
  2529. // a desired action after seeing an ad.
  2530. type Conversion struct {
  2531. // ChildDirectedTreatment: Whether the conversion was directed toward
  2532. // children.
  2533. ChildDirectedTreatment bool `json:"childDirectedTreatment,omitempty"`
  2534. // CustomVariables: Custom floodlight variables.
  2535. CustomVariables []*CustomFloodlightVariable `json:"customVariables,omitempty"`
  2536. // EncryptedUserId: The alphanumeric encrypted user ID. When set,
  2537. // encryptionInfo should also be specified. This field is mutually
  2538. // exclusive with encryptedUserIdCandidates[] and mobileDeviceId. This
  2539. // or encryptedUserIdCandidates[] or mobileDeviceId is a required field.
  2540. EncryptedUserId string `json:"encryptedUserId,omitempty"`
  2541. // EncryptedUserIdCandidates: A list of the alphanumeric encrypted user
  2542. // IDs. Any user ID with exposure prior to the conversion timestamp will
  2543. // be used in the inserted conversion. If no such user ID is found then
  2544. // the conversion will be rejected with NO_COOKIE_MATCH_FOUND error.
  2545. // When set, encryptionInfo should also be specified. This field should
  2546. // only be used when calling conversions.batchinsert. This field is
  2547. // mutually exclusive with encryptedUserId and mobileDeviceId. This or
  2548. // encryptedUserId or mobileDeviceId is a required field.
  2549. EncryptedUserIdCandidates []string `json:"encryptedUserIdCandidates,omitempty"`
  2550. // FloodlightActivityId: Floodlight Activity ID of this conversion. This
  2551. // is a required field.
  2552. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  2553. // FloodlightConfigurationId: Floodlight Configuration ID of this
  2554. // conversion. This is a required field.
  2555. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  2556. // Kind: Identifies what kind of resource this is. Value: the fixed
  2557. // string "dfareporting#conversion".
  2558. Kind string `json:"kind,omitempty"`
  2559. // LimitAdTracking: Whether Limit Ad Tracking is enabled. When set to
  2560. // true, the conversion will be used for reporting but not targeting.
  2561. // This will prevent remarketing.
  2562. LimitAdTracking bool `json:"limitAdTracking,omitempty"`
  2563. // MobileDeviceId: The mobile device ID. This field is mutually
  2564. // exclusive with encryptedUserId and encryptedUserIdCandidates[]. This
  2565. // or encryptedUserId or encryptedUserIdCandidates[] is a required
  2566. // field.
  2567. MobileDeviceId string `json:"mobileDeviceId,omitempty"`
  2568. // Ordinal: The ordinal of the conversion. Use this field to control how
  2569. // conversions of the same user and day are de-duplicated. This is a
  2570. // required field.
  2571. Ordinal string `json:"ordinal,omitempty"`
  2572. // Quantity: The quantity of the conversion.
  2573. Quantity int64 `json:"quantity,omitempty,string"`
  2574. // TimestampMicros: The timestamp of conversion, in Unix epoch micros.
  2575. // This is a required field.
  2576. TimestampMicros int64 `json:"timestampMicros,omitempty,string"`
  2577. // Value: The value of the conversion.
  2578. Value float64 `json:"value,omitempty"`
  2579. // ForceSendFields is a list of field names (e.g.
  2580. // "ChildDirectedTreatment") to unconditionally include in API requests.
  2581. // By default, fields with empty values are omitted from API requests.
  2582. // However, any non-pointer, non-interface field appearing in
  2583. // ForceSendFields will be sent to the server regardless of whether the
  2584. // field is empty or not. This may be used to include empty fields in
  2585. // Patch requests.
  2586. ForceSendFields []string `json:"-"`
  2587. // NullFields is a list of field names (e.g. "ChildDirectedTreatment")
  2588. // to include in API requests with the JSON null value. By default,
  2589. // fields with empty values are omitted from API requests. However, any
  2590. // field with an empty value appearing in NullFields will be sent to the
  2591. // server as null. It is an error if a field in this list has a
  2592. // non-empty value. This may be used to include null fields in Patch
  2593. // requests.
  2594. NullFields []string `json:"-"`
  2595. }
  2596. func (s *Conversion) MarshalJSON() ([]byte, error) {
  2597. type NoMethod Conversion
  2598. raw := NoMethod(*s)
  2599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2600. }
  2601. func (s *Conversion) UnmarshalJSON(data []byte) error {
  2602. type NoMethod Conversion
  2603. var s1 struct {
  2604. Value gensupport.JSONFloat64 `json:"value"`
  2605. *NoMethod
  2606. }
  2607. s1.NoMethod = (*NoMethod)(s)
  2608. if err := json.Unmarshal(data, &s1); err != nil {
  2609. return err
  2610. }
  2611. s.Value = float64(s1.Value)
  2612. return nil
  2613. }
  2614. // ConversionError: The error code and description for a conversion that
  2615. // failed to insert or update.
  2616. type ConversionError struct {
  2617. // Code: The error code.
  2618. //
  2619. // Possible values:
  2620. // "INTERNAL"
  2621. // "INVALID_ARGUMENT"
  2622. // "NOT_FOUND"
  2623. // "PERMISSION_DENIED"
  2624. Code string `json:"code,omitempty"`
  2625. // Kind: Identifies what kind of resource this is. Value: the fixed
  2626. // string "dfareporting#conversionError".
  2627. Kind string `json:"kind,omitempty"`
  2628. // Message: A description of the error.
  2629. Message string `json:"message,omitempty"`
  2630. // ForceSendFields is a list of field names (e.g. "Code") to
  2631. // unconditionally include in API requests. By default, fields with
  2632. // empty values are omitted from API requests. However, any non-pointer,
  2633. // non-interface field appearing in ForceSendFields will be sent to the
  2634. // server regardless of whether the field is empty or not. This may be
  2635. // used to include empty fields in Patch requests.
  2636. ForceSendFields []string `json:"-"`
  2637. // NullFields is a list of field names (e.g. "Code") to include in API
  2638. // requests with the JSON null value. By default, fields with empty
  2639. // values are omitted from API requests. However, any field with an
  2640. // empty value appearing in NullFields will be sent to the server as
  2641. // null. It is an error if a field in this list has a non-empty value.
  2642. // This may be used to include null fields in Patch requests.
  2643. NullFields []string `json:"-"`
  2644. }
  2645. func (s *ConversionError) MarshalJSON() ([]byte, error) {
  2646. type NoMethod ConversionError
  2647. raw := NoMethod(*s)
  2648. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2649. }
  2650. // ConversionStatus: The original conversion that was inserted or
  2651. // updated and whether there were any errors.
  2652. type ConversionStatus struct {
  2653. // Conversion: The original conversion that was inserted or updated.
  2654. Conversion *Conversion `json:"conversion,omitempty"`
  2655. // Errors: A list of errors related to this conversion.
  2656. Errors []*ConversionError `json:"errors,omitempty"`
  2657. // Kind: Identifies what kind of resource this is. Value: the fixed
  2658. // string "dfareporting#conversionStatus".
  2659. Kind string `json:"kind,omitempty"`
  2660. // ForceSendFields is a list of field names (e.g. "Conversion") to
  2661. // unconditionally include in API requests. By default, fields with
  2662. // empty values are omitted from API requests. However, any non-pointer,
  2663. // non-interface field appearing in ForceSendFields will be sent to the
  2664. // server regardless of whether the field is empty or not. This may be
  2665. // used to include empty fields in Patch requests.
  2666. ForceSendFields []string `json:"-"`
  2667. // NullFields is a list of field names (e.g. "Conversion") to include in
  2668. // API requests with the JSON null value. By default, fields with empty
  2669. // values are omitted from API requests. However, any field with an
  2670. // empty value appearing in NullFields will be sent to the server as
  2671. // null. It is an error if a field in this list has a non-empty value.
  2672. // This may be used to include null fields in Patch requests.
  2673. NullFields []string `json:"-"`
  2674. }
  2675. func (s *ConversionStatus) MarshalJSON() ([]byte, error) {
  2676. type NoMethod ConversionStatus
  2677. raw := NoMethod(*s)
  2678. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2679. }
  2680. // ConversionsBatchInsertRequest: Insert Conversions Request.
  2681. type ConversionsBatchInsertRequest struct {
  2682. // Conversions: The set of conversions to insert.
  2683. Conversions []*Conversion `json:"conversions,omitempty"`
  2684. // EncryptionInfo: Describes how encryptedUserId or
  2685. // encryptedUserIdCandidates[] is encrypted. This is a required field if
  2686. // encryptedUserId or encryptedUserIdCandidates[] is used.
  2687. EncryptionInfo *EncryptionInfo `json:"encryptionInfo,omitempty"`
  2688. // Kind: Identifies what kind of resource this is. Value: the fixed
  2689. // string "dfareporting#conversionsBatchInsertRequest".
  2690. Kind string `json:"kind,omitempty"`
  2691. // ForceSendFields is a list of field names (e.g. "Conversions") to
  2692. // unconditionally include in API requests. By default, fields with
  2693. // empty values are omitted from API requests. However, any non-pointer,
  2694. // non-interface field appearing in ForceSendFields will be sent to the
  2695. // server regardless of whether the field is empty or not. This may be
  2696. // used to include empty fields in Patch requests.
  2697. ForceSendFields []string `json:"-"`
  2698. // NullFields is a list of field names (e.g. "Conversions") to include
  2699. // in API requests with the JSON null value. By default, fields with
  2700. // empty values are omitted from API requests. However, any field with
  2701. // an empty value appearing in NullFields will be sent to the server as
  2702. // null. It is an error if a field in this list has a non-empty value.
  2703. // This may be used to include null fields in Patch requests.
  2704. NullFields []string `json:"-"`
  2705. }
  2706. func (s *ConversionsBatchInsertRequest) MarshalJSON() ([]byte, error) {
  2707. type NoMethod ConversionsBatchInsertRequest
  2708. raw := NoMethod(*s)
  2709. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2710. }
  2711. // ConversionsBatchInsertResponse: Insert Conversions Response.
  2712. type ConversionsBatchInsertResponse struct {
  2713. // HasFailures: Indicates that some or all conversions failed to insert.
  2714. HasFailures bool `json:"hasFailures,omitempty"`
  2715. // Kind: Identifies what kind of resource this is. Value: the fixed
  2716. // string "dfareporting#conversionsBatchInsertResponse".
  2717. Kind string `json:"kind,omitempty"`
  2718. // Status: The insert status of each conversion. Statuses are returned
  2719. // in the same order that conversions are inserted.
  2720. Status []*ConversionStatus `json:"status,omitempty"`
  2721. // ServerResponse contains the HTTP response code and headers from the
  2722. // server.
  2723. googleapi.ServerResponse `json:"-"`
  2724. // ForceSendFields is a list of field names (e.g. "HasFailures") to
  2725. // unconditionally include in API requests. By default, fields with
  2726. // empty values are omitted from API requests. However, any non-pointer,
  2727. // non-interface field appearing in ForceSendFields will be sent to the
  2728. // server regardless of whether the field is empty or not. This may be
  2729. // used to include empty fields in Patch requests.
  2730. ForceSendFields []string `json:"-"`
  2731. // NullFields is a list of field names (e.g. "HasFailures") to include
  2732. // in API requests with the JSON null value. By default, fields with
  2733. // empty values are omitted from API requests. However, any field with
  2734. // an empty value appearing in NullFields will be sent to the server as
  2735. // null. It is an error if a field in this list has a non-empty value.
  2736. // This may be used to include null fields in Patch requests.
  2737. NullFields []string `json:"-"`
  2738. }
  2739. func (s *ConversionsBatchInsertResponse) MarshalJSON() ([]byte, error) {
  2740. type NoMethod ConversionsBatchInsertResponse
  2741. raw := NoMethod(*s)
  2742. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2743. }
  2744. // CountriesListResponse: Country List Response
  2745. type CountriesListResponse struct {
  2746. // Countries: Country collection.
  2747. Countries []*Country `json:"countries,omitempty"`
  2748. // Kind: Identifies what kind of resource this is. Value: the fixed
  2749. // string "dfareporting#countriesListResponse".
  2750. Kind string `json:"kind,omitempty"`
  2751. // ServerResponse contains the HTTP response code and headers from the
  2752. // server.
  2753. googleapi.ServerResponse `json:"-"`
  2754. // ForceSendFields is a list of field names (e.g. "Countries") to
  2755. // unconditionally include in API requests. By default, fields with
  2756. // empty values are omitted from API requests. However, any non-pointer,
  2757. // non-interface field appearing in ForceSendFields will be sent to the
  2758. // server regardless of whether the field is empty or not. This may be
  2759. // used to include empty fields in Patch requests.
  2760. ForceSendFields []string `json:"-"`
  2761. // NullFields is a list of field names (e.g. "Countries") to include in
  2762. // API requests with the JSON null value. By default, fields with empty
  2763. // values are omitted from API requests. However, any field with an
  2764. // empty value appearing in NullFields will be sent to the server as
  2765. // null. It is an error if a field in this list has a non-empty value.
  2766. // This may be used to include null fields in Patch requests.
  2767. NullFields []string `json:"-"`
  2768. }
  2769. func (s *CountriesListResponse) MarshalJSON() ([]byte, error) {
  2770. type NoMethod CountriesListResponse
  2771. raw := NoMethod(*s)
  2772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2773. }
  2774. // Country: Contains information about a country that can be targeted by
  2775. // ads.
  2776. type Country struct {
  2777. // CountryCode: Country code.
  2778. CountryCode string `json:"countryCode,omitempty"`
  2779. // DartId: DART ID of this country. This is the ID used for targeting
  2780. // and generating reports.
  2781. DartId int64 `json:"dartId,omitempty,string"`
  2782. // Kind: Identifies what kind of resource this is. Value: the fixed
  2783. // string "dfareporting#country".
  2784. Kind string `json:"kind,omitempty"`
  2785. // Name: Name of this country.
  2786. Name string `json:"name,omitempty"`
  2787. // SslEnabled: Whether ad serving supports secure servers in this
  2788. // country.
  2789. SslEnabled bool `json:"sslEnabled,omitempty"`
  2790. // ServerResponse contains the HTTP response code and headers from the
  2791. // server.
  2792. googleapi.ServerResponse `json:"-"`
  2793. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  2794. // unconditionally include in API requests. By default, fields with
  2795. // empty values are omitted from API requests. However, any non-pointer,
  2796. // non-interface field appearing in ForceSendFields will be sent to the
  2797. // server regardless of whether the field is empty or not. This may be
  2798. // used to include empty fields in Patch requests.
  2799. ForceSendFields []string `json:"-"`
  2800. // NullFields is a list of field names (e.g. "CountryCode") to include
  2801. // in API requests with the JSON null value. By default, fields with
  2802. // empty values are omitted from API requests. However, any field with
  2803. // an empty value appearing in NullFields will be sent to the server as
  2804. // null. It is an error if a field in this list has a non-empty value.
  2805. // This may be used to include null fields in Patch requests.
  2806. NullFields []string `json:"-"`
  2807. }
  2808. func (s *Country) MarshalJSON() ([]byte, error) {
  2809. type NoMethod Country
  2810. raw := NoMethod(*s)
  2811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2812. }
  2813. // Creative: Contains properties of a Creative.
  2814. type Creative struct {
  2815. // AccountId: Account ID of this creative. This field, if left unset,
  2816. // will be auto-generated for both insert and update operations.
  2817. // Applicable to all creative types.
  2818. AccountId int64 `json:"accountId,omitempty,string"`
  2819. // Active: Whether the creative is active. Applicable to all creative
  2820. // types.
  2821. Active bool `json:"active,omitempty"`
  2822. // AdParameters: Ad parameters user for VPAID creative. This is a
  2823. // read-only field. Applicable to the following creative types: all
  2824. // VPAID.
  2825. AdParameters string `json:"adParameters,omitempty"`
  2826. // AdTagKeys: Keywords for a Rich Media creative. Keywords let you
  2827. // customize the creative settings of a Rich Media ad running on your
  2828. // site without having to contact the advertiser. You can use keywords
  2829. // to dynamically change the look or functionality of a creative.
  2830. // Applicable to the following creative types: all RICH_MEDIA, and all
  2831. // VPAID.
  2832. AdTagKeys []string `json:"adTagKeys,omitempty"`
  2833. // AdvertiserId: Advertiser ID of this creative. This is a required
  2834. // field. Applicable to all creative types.
  2835. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  2836. // AllowScriptAccess: Whether script access is allowed for this
  2837. // creative. This is a read-only and deprecated field which will
  2838. // automatically be set to true on update. Applicable to the following
  2839. // creative types: FLASH_INPAGE.
  2840. AllowScriptAccess bool `json:"allowScriptAccess,omitempty"`
  2841. // Archived: Whether the creative is archived. Applicable to all
  2842. // creative types.
  2843. Archived bool `json:"archived,omitempty"`
  2844. // ArtworkType: Type of artwork used for the creative. This is a
  2845. // read-only field. Applicable to the following creative types: all
  2846. // RICH_MEDIA, and all VPAID.
  2847. //
  2848. // Possible values:
  2849. // "ARTWORK_TYPE_FLASH"
  2850. // "ARTWORK_TYPE_HTML5"
  2851. // "ARTWORK_TYPE_IMAGE"
  2852. // "ARTWORK_TYPE_MIXED"
  2853. ArtworkType string `json:"artworkType,omitempty"`
  2854. // AuthoringSource: Source application where creative was authored.
  2855. // Presently, only DBM authored creatives will have this field set.
  2856. // Applicable to all creative types.
  2857. //
  2858. // Possible values:
  2859. // "CREATIVE_AUTHORING_SOURCE_DBM"
  2860. // "CREATIVE_AUTHORING_SOURCE_DCM"
  2861. // "CREATIVE_AUTHORING_SOURCE_STUDIO"
  2862. AuthoringSource string `json:"authoringSource,omitempty"`
  2863. // AuthoringTool: Authoring tool for HTML5 banner creatives. This is a
  2864. // read-only field. Applicable to the following creative types:
  2865. // HTML5_BANNER.
  2866. //
  2867. // Possible values:
  2868. // "NINJA"
  2869. // "SWIFFY"
  2870. AuthoringTool string `json:"authoringTool,omitempty"`
  2871. // AutoAdvanceImages: Whether images are automatically advanced for
  2872. // image gallery creatives. Applicable to the following creative types:
  2873. // DISPLAY_IMAGE_GALLERY.
  2874. AutoAdvanceImages bool `json:"auto_advance_images,omitempty"`
  2875. // BackgroundColor: The 6-character HTML color code, beginning with #,
  2876. // for the background of the window area where the Flash file is
  2877. // displayed. Default is white. Applicable to the following creative
  2878. // types: FLASH_INPAGE.
  2879. BackgroundColor string `json:"backgroundColor,omitempty"`
  2880. // BackupImageClickThroughUrl: Click-through URL for backup image.
  2881. // Applicable to the following creative types: FLASH_INPAGE, and
  2882. // HTML5_BANNER. Applicable to DISPLAY when the primary asset type is
  2883. // not HTML_IMAGE.
  2884. BackupImageClickThroughUrl string `json:"backupImageClickThroughUrl,omitempty"`
  2885. // BackupImageFeatures: List of feature dependencies that will cause a
  2886. // backup image to be served if the browser that serves the ad does not
  2887. // support them. Feature dependencies are features that a browser must
  2888. // be able to support in order to render your HTML5 creative asset
  2889. // correctly. This field is initially auto-generated to contain all
  2890. // features detected by DCM for all the assets of this creative and can
  2891. // then be modified by the client. To reset this field, copy over all
  2892. // the creativeAssets' detected features. Applicable to the following
  2893. // creative types: HTML5_BANNER. Applicable to DISPLAY when the primary
  2894. // asset type is not HTML_IMAGE.
  2895. //
  2896. // Possible values:
  2897. // "APPLICATION_CACHE"
  2898. // "AUDIO"
  2899. // "CANVAS"
  2900. // "CANVAS_TEXT"
  2901. // "CSS_ANIMATIONS"
  2902. // "CSS_BACKGROUND_SIZE"
  2903. // "CSS_BORDER_IMAGE"
  2904. // "CSS_BORDER_RADIUS"
  2905. // "CSS_BOX_SHADOW"
  2906. // "CSS_COLUMNS"
  2907. // "CSS_FLEX_BOX"
  2908. // "CSS_FONT_FACE"
  2909. // "CSS_GENERATED_CONTENT"
  2910. // "CSS_GRADIENTS"
  2911. // "CSS_HSLA"
  2912. // "CSS_MULTIPLE_BGS"
  2913. // "CSS_OPACITY"
  2914. // "CSS_REFLECTIONS"
  2915. // "CSS_RGBA"
  2916. // "CSS_TEXT_SHADOW"
  2917. // "CSS_TRANSFORMS"
  2918. // "CSS_TRANSFORMS3D"
  2919. // "CSS_TRANSITIONS"
  2920. // "DRAG_AND_DROP"
  2921. // "GEO_LOCATION"
  2922. // "HASH_CHANGE"
  2923. // "HISTORY"
  2924. // "INDEXED_DB"
  2925. // "INLINE_SVG"
  2926. // "INPUT_ATTR_AUTOCOMPLETE"
  2927. // "INPUT_ATTR_AUTOFOCUS"
  2928. // "INPUT_ATTR_LIST"
  2929. // "INPUT_ATTR_MAX"
  2930. // "INPUT_ATTR_MIN"
  2931. // "INPUT_ATTR_MULTIPLE"
  2932. // "INPUT_ATTR_PATTERN"
  2933. // "INPUT_ATTR_PLACEHOLDER"
  2934. // "INPUT_ATTR_REQUIRED"
  2935. // "INPUT_ATTR_STEP"
  2936. // "INPUT_TYPE_COLOR"
  2937. // "INPUT_TYPE_DATE"
  2938. // "INPUT_TYPE_DATETIME"
  2939. // "INPUT_TYPE_DATETIME_LOCAL"
  2940. // "INPUT_TYPE_EMAIL"
  2941. // "INPUT_TYPE_MONTH"
  2942. // "INPUT_TYPE_NUMBER"
  2943. // "INPUT_TYPE_RANGE"
  2944. // "INPUT_TYPE_SEARCH"
  2945. // "INPUT_TYPE_TEL"
  2946. // "INPUT_TYPE_TIME"
  2947. // "INPUT_TYPE_URL"
  2948. // "INPUT_TYPE_WEEK"
  2949. // "LOCAL_STORAGE"
  2950. // "POST_MESSAGE"
  2951. // "SESSION_STORAGE"
  2952. // "SMIL"
  2953. // "SVG_CLIP_PATHS"
  2954. // "SVG_FE_IMAGE"
  2955. // "SVG_FILTERS"
  2956. // "SVG_HREF"
  2957. // "TOUCH"
  2958. // "VIDEO"
  2959. // "WEBGL"
  2960. // "WEB_SOCKETS"
  2961. // "WEB_SQL_DATABASE"
  2962. // "WEB_WORKERS"
  2963. BackupImageFeatures []string `json:"backupImageFeatures,omitempty"`
  2964. // BackupImageReportingLabel: Reporting label used for HTML5 banner
  2965. // backup image. Applicable to the following creative types: DISPLAY
  2966. // when the primary asset type is not HTML_IMAGE.
  2967. BackupImageReportingLabel string `json:"backupImageReportingLabel,omitempty"`
  2968. // BackupImageTargetWindow: Target window for backup image. Applicable
  2969. // to the following creative types: FLASH_INPAGE and HTML5_BANNER.
  2970. // Applicable to DISPLAY when the primary asset type is not HTML_IMAGE.
  2971. BackupImageTargetWindow *TargetWindow `json:"backupImageTargetWindow,omitempty"`
  2972. // ClickTags: Click tags of the creative. For DISPLAY, FLASH_INPAGE, and
  2973. // HTML5_BANNER creatives, this is a subset of detected click tags for
  2974. // the assets associated with this creative. After creating a flash
  2975. // asset, detected click tags will be returned in the
  2976. // creativeAssetMetadata. When inserting the creative, populate the
  2977. // creative clickTags field using the creativeAssetMetadata.clickTags
  2978. // field. For DISPLAY_IMAGE_GALLERY creatives, there should be exactly
  2979. // one entry in this list for each image creative asset. A click tag is
  2980. // matched with a corresponding creative asset by matching the
  2981. // clickTag.name field with the creativeAsset.assetIdentifier.name
  2982. // field. Applicable to the following creative types:
  2983. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER. Applicable to
  2984. // DISPLAY when the primary asset type is not HTML_IMAGE.
  2985. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  2986. // CommercialId: Industry standard ID assigned to creative for reach and
  2987. // frequency. Applicable to the following creative types: all
  2988. // INSTREAM_VIDEO and all VPAID.
  2989. CommercialId string `json:"commercialId,omitempty"`
  2990. // CompanionCreatives: List of companion creatives assigned to an
  2991. // in-Stream videocreative. Acceptable values include IDs of existing
  2992. // flash and image creatives. Applicable to the following creative
  2993. // types: all VPAID and all INSTREAM_VIDEO with dynamicAssetSelection
  2994. // set to false.
  2995. CompanionCreatives googleapi.Int64s `json:"companionCreatives,omitempty"`
  2996. // Compatibility: Compatibilities associated with this creative. This is
  2997. // a read-only field. DISPLAY and DISPLAY_INTERSTITIAL refer to
  2998. // rendering either on desktop or on mobile devices or in mobile apps
  2999. // for regular or interstitial ads, respectively. APP and
  3000. // APP_INTERSTITIAL are for rendering in mobile apps. Only pre-existing
  3001. // creatives may have these compatibilities since new creatives will
  3002. // either be assigned DISPLAY or DISPLAY_INTERSTITIAL instead.
  3003. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  3004. // with the VAST standard. Applicable to all creative types.
  3005. //
  3006. // Acceptable values are:
  3007. // - "APP"
  3008. // - "APP_INTERSTITIAL"
  3009. // - "IN_STREAM_VIDEO"
  3010. // - "DISPLAY"
  3011. // - "DISPLAY_INTERSTITIAL"
  3012. //
  3013. // Possible values:
  3014. // "APP"
  3015. // "APP_INTERSTITIAL"
  3016. // "DISPLAY"
  3017. // "DISPLAY_INTERSTITIAL"
  3018. // "IN_STREAM_VIDEO"
  3019. Compatibility []string `json:"compatibility,omitempty"`
  3020. // ConvertFlashToHtml5: Whether Flash assets associated with the
  3021. // creative need to be automatically converted to HTML5. This flag is
  3022. // enabled by default and users can choose to disable it if they don't
  3023. // want the system to generate and use HTML5 asset for this creative.
  3024. // Applicable to the following creative type: FLASH_INPAGE. Applicable
  3025. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3026. ConvertFlashToHtml5 bool `json:"convertFlashToHtml5,omitempty"`
  3027. // CounterCustomEvents: List of counter events configured for the
  3028. // creative. For DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3029. // and auto-generated from clickTags. Applicable to the following
  3030. // creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3031. CounterCustomEvents []*CreativeCustomEvent `json:"counterCustomEvents,omitempty"`
  3032. // CreativeAssetSelection: Required if dynamicAssetSelection is true.
  3033. CreativeAssetSelection *CreativeAssetSelection `json:"creativeAssetSelection,omitempty"`
  3034. // CreativeAssets: Assets associated with a creative. Applicable to all
  3035. // but the following creative types: INTERNAL_REDIRECT,
  3036. // INTERSTITIAL_INTERNAL_REDIRECT, and REDIRECT
  3037. CreativeAssets []*CreativeAsset `json:"creativeAssets,omitempty"`
  3038. // CreativeFieldAssignments: Creative field assignments for this
  3039. // creative. Applicable to all creative types.
  3040. CreativeFieldAssignments []*CreativeFieldAssignment `json:"creativeFieldAssignments,omitempty"`
  3041. // CustomKeyValues: Custom key-values for a Rich Media creative.
  3042. // Key-values let you customize the creative settings of a Rich Media ad
  3043. // running on your site without having to contact the advertiser. You
  3044. // can use key-values to dynamically change the look or functionality of
  3045. // a creative. Applicable to the following creative types: all
  3046. // RICH_MEDIA, and all VPAID.
  3047. CustomKeyValues []string `json:"customKeyValues,omitempty"`
  3048. // DynamicAssetSelection: Set this to true to enable the use of rules to
  3049. // target individual assets in this creative. When set to true
  3050. // creativeAssetSelection must be set. This also controls asset-level
  3051. // companions. When this is true, companion creatives should be assigned
  3052. // to creative assets. Learn more. Applicable to INSTREAM_VIDEO
  3053. // creatives.
  3054. DynamicAssetSelection bool `json:"dynamicAssetSelection,omitempty"`
  3055. // ExitCustomEvents: List of exit events configured for the creative.
  3056. // For DISPLAY and DISPLAY_IMAGE_GALLERY creatives, these are read-only
  3057. // and auto-generated from clickTags, For DISPLAY, an event is also
  3058. // created from the backupImageReportingLabel. Applicable to the
  3059. // following creative types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and
  3060. // all VPAID. Applicable to DISPLAY when the primary asset type is not
  3061. // HTML_IMAGE.
  3062. ExitCustomEvents []*CreativeCustomEvent `json:"exitCustomEvents,omitempty"`
  3063. // FsCommand: OpenWindow FSCommand of this creative. This lets the SWF
  3064. // file communicate with either Flash Player or the program hosting
  3065. // Flash Player, such as a web browser. This is only triggered if
  3066. // allowScriptAccess field is true. Applicable to the following creative
  3067. // types: FLASH_INPAGE.
  3068. FsCommand *FsCommand `json:"fsCommand,omitempty"`
  3069. // HtmlCode: HTML code for the creative. This is a required field when
  3070. // applicable. This field is ignored if htmlCodeLocked is true.
  3071. // Applicable to the following creative types: all CUSTOM, FLASH_INPAGE,
  3072. // and HTML5_BANNER, and all RICH_MEDIA.
  3073. HtmlCode string `json:"htmlCode,omitempty"`
  3074. // HtmlCodeLocked: Whether HTML code is DCM-generated or manually
  3075. // entered. Set to true to ignore changes to htmlCode. Applicable to the
  3076. // following creative types: FLASH_INPAGE and HTML5_BANNER.
  3077. HtmlCodeLocked bool `json:"htmlCodeLocked,omitempty"`
  3078. // Id: ID of this creative. This is a read-only, auto-generated field.
  3079. // Applicable to all creative types.
  3080. Id int64 `json:"id,omitempty,string"`
  3081. // IdDimensionValue: Dimension value for the ID of this creative. This
  3082. // is a read-only field. Applicable to all creative types.
  3083. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3084. // Kind: Identifies what kind of resource this is. Value: the fixed
  3085. // string "dfareporting#creative".
  3086. Kind string `json:"kind,omitempty"`
  3087. // LastModifiedInfo: Creative last modification information. This is a
  3088. // read-only field. Applicable to all creative types.
  3089. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  3090. // LatestTraffickedCreativeId: Latest Studio trafficked creative ID
  3091. // associated with rich media and VPAID creatives. This is a read-only
  3092. // field. Applicable to the following creative types: all RICH_MEDIA,
  3093. // and all VPAID.
  3094. LatestTraffickedCreativeId int64 `json:"latestTraffickedCreativeId,omitempty,string"`
  3095. // Name: Name of the creative. This is a required field and must be less
  3096. // than 256 characters long. Applicable to all creative types.
  3097. Name string `json:"name,omitempty"`
  3098. // OverrideCss: Override CSS value for rich media creatives. Applicable
  3099. // to the following creative types: all RICH_MEDIA.
  3100. OverrideCss string `json:"overrideCss,omitempty"`
  3101. // ProgressOffset: Amount of time to play the video before counting a
  3102. // view. Applicable to the following creative types: all INSTREAM_VIDEO.
  3103. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  3104. // RedirectUrl: URL of hosted image or hosted video or another ad tag.
  3105. // For INSTREAM_VIDEO_REDIRECT creatives this is the in-stream video
  3106. // redirect URL. The standard for a VAST (Video Ad Serving Template) ad
  3107. // response allows for a redirect link to another VAST 2.0 or 3.0 call.
  3108. // This is a required field when applicable. Applicable to the following
  3109. // creative types: DISPLAY_REDIRECT, INTERNAL_REDIRECT,
  3110. // INTERSTITIAL_INTERNAL_REDIRECT, and INSTREAM_VIDEO_REDIRECT
  3111. RedirectUrl string `json:"redirectUrl,omitempty"`
  3112. // RenderingId: ID of current rendering version. This is a read-only
  3113. // field. Applicable to all creative types.
  3114. RenderingId int64 `json:"renderingId,omitempty,string"`
  3115. // RenderingIdDimensionValue: Dimension value for the rendering ID of
  3116. // this creative. This is a read-only field. Applicable to all creative
  3117. // types.
  3118. RenderingIdDimensionValue *DimensionValue `json:"renderingIdDimensionValue,omitempty"`
  3119. // RequiredFlashPluginVersion: The minimum required Flash plugin version
  3120. // for this creative. For example, 11.2.202.235. This is a read-only
  3121. // field. Applicable to the following creative types: all RICH_MEDIA,
  3122. // and all VPAID.
  3123. RequiredFlashPluginVersion string `json:"requiredFlashPluginVersion,omitempty"`
  3124. // RequiredFlashVersion: The internal Flash version for this creative as
  3125. // calculated by DoubleClick Studio. This is a read-only field.
  3126. // Applicable to the following creative types: FLASH_INPAGE all
  3127. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3128. // asset type is not HTML_IMAGE.
  3129. RequiredFlashVersion int64 `json:"requiredFlashVersion,omitempty"`
  3130. // Size: Size associated with this creative. When inserting or updating
  3131. // a creative either the size ID field or size width and height fields
  3132. // can be used. This is a required field when applicable; however for
  3133. // IMAGE, FLASH_INPAGE creatives, and for DISPLAY creatives with a
  3134. // primary asset of type HTML_IMAGE, if left blank, this field will be
  3135. // automatically set using the actual size of the associated image
  3136. // assets. Applicable to the following creative types: DISPLAY,
  3137. // DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER, IMAGE, and all
  3138. // RICH_MEDIA.
  3139. Size *Size `json:"size,omitempty"`
  3140. // SkipOffset: Amount of time to play the video before the skip button
  3141. // appears. Applicable to the following creative types: all
  3142. // INSTREAM_VIDEO.
  3143. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  3144. // Skippable: Whether the user can choose to skip the creative.
  3145. // Applicable to the following creative types: all INSTREAM_VIDEO and
  3146. // all VPAID.
  3147. Skippable bool `json:"skippable,omitempty"`
  3148. // SslCompliant: Whether the creative is SSL-compliant. This is a
  3149. // read-only field. Applicable to all creative types.
  3150. SslCompliant bool `json:"sslCompliant,omitempty"`
  3151. // SslOverride: Whether creative should be treated as SSL compliant even
  3152. // if the system scan shows it's not. Applicable to all creative types.
  3153. SslOverride bool `json:"sslOverride,omitempty"`
  3154. // StudioAdvertiserId: Studio advertiser ID associated with rich media
  3155. // and VPAID creatives. This is a read-only field. Applicable to the
  3156. // following creative types: all RICH_MEDIA, and all VPAID.
  3157. StudioAdvertiserId int64 `json:"studioAdvertiserId,omitempty,string"`
  3158. // StudioCreativeId: Studio creative ID associated with rich media and
  3159. // VPAID creatives. This is a read-only field. Applicable to the
  3160. // following creative types: all RICH_MEDIA, and all VPAID.
  3161. StudioCreativeId int64 `json:"studioCreativeId,omitempty,string"`
  3162. // StudioTraffickedCreativeId: Studio trafficked creative ID associated
  3163. // with rich media and VPAID creatives. This is a read-only field.
  3164. // Applicable to the following creative types: all RICH_MEDIA, and all
  3165. // VPAID.
  3166. StudioTraffickedCreativeId int64 `json:"studioTraffickedCreativeId,omitempty,string"`
  3167. // SubaccountId: Subaccount ID of this creative. This field, if left
  3168. // unset, will be auto-generated for both insert and update operations.
  3169. // Applicable to all creative types.
  3170. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  3171. // ThirdPartyBackupImageImpressionsUrl: Third-party URL used to record
  3172. // backup image impressions. Applicable to the following creative types:
  3173. // all RICH_MEDIA.
  3174. ThirdPartyBackupImageImpressionsUrl string `json:"thirdPartyBackupImageImpressionsUrl,omitempty"`
  3175. // ThirdPartyRichMediaImpressionsUrl: Third-party URL used to record
  3176. // rich media impressions. Applicable to the following creative types:
  3177. // all RICH_MEDIA.
  3178. ThirdPartyRichMediaImpressionsUrl string `json:"thirdPartyRichMediaImpressionsUrl,omitempty"`
  3179. // ThirdPartyUrls: Third-party URLs for tracking in-stream video
  3180. // creative events. Applicable to the following creative types: all
  3181. // INSTREAM_VIDEO and all VPAID.
  3182. ThirdPartyUrls []*ThirdPartyTrackingUrl `json:"thirdPartyUrls,omitempty"`
  3183. // TimerCustomEvents: List of timer events configured for the creative.
  3184. // For DISPLAY_IMAGE_GALLERY creatives, these are read-only and
  3185. // auto-generated from clickTags. Applicable to the following creative
  3186. // types: DISPLAY_IMAGE_GALLERY, all RICH_MEDIA, and all VPAID.
  3187. // Applicable to DISPLAY when the primary asset is not HTML_IMAGE.
  3188. TimerCustomEvents []*CreativeCustomEvent `json:"timerCustomEvents,omitempty"`
  3189. // TotalFileSize: Combined size of all creative assets. This is a
  3190. // read-only field. Applicable to the following creative types: all
  3191. // RICH_MEDIA, and all VPAID.
  3192. TotalFileSize int64 `json:"totalFileSize,omitempty,string"`
  3193. // Type: Type of this creative. This is a required field. Applicable to
  3194. // all creative types.
  3195. //
  3196. // Note: FLASH_INPAGE, HTML5_BANNER, and IMAGE are only used for
  3197. // existing creatives. New creatives should use DISPLAY as a replacement
  3198. // for these types.
  3199. //
  3200. // Possible values:
  3201. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  3202. // "CUSTOM_DISPLAY"
  3203. // "CUSTOM_DISPLAY_INTERSTITIAL"
  3204. // "DISPLAY"
  3205. // "DISPLAY_IMAGE_GALLERY"
  3206. // "DISPLAY_REDIRECT"
  3207. // "FLASH_INPAGE"
  3208. // "HTML5_BANNER"
  3209. // "IMAGE"
  3210. // "INSTREAM_VIDEO"
  3211. // "INSTREAM_VIDEO_REDIRECT"
  3212. // "INTERNAL_REDIRECT"
  3213. // "INTERSTITIAL_INTERNAL_REDIRECT"
  3214. // "RICH_MEDIA_DISPLAY_BANNER"
  3215. // "RICH_MEDIA_DISPLAY_EXPANDING"
  3216. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  3217. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  3218. // "RICH_MEDIA_IM_EXPAND"
  3219. // "RICH_MEDIA_INPAGE_FLOATING"
  3220. // "RICH_MEDIA_MOBILE_IN_APP"
  3221. // "RICH_MEDIA_PEEL_DOWN"
  3222. // "TRACKING_TEXT"
  3223. // "VPAID_LINEAR_VIDEO"
  3224. // "VPAID_NON_LINEAR_VIDEO"
  3225. Type string `json:"type,omitempty"`
  3226. // Version: The version number helps you keep track of multiple versions
  3227. // of your creative in your reports. The version number will always be
  3228. // auto-generated during insert operations to start at 1. For tracking
  3229. // creatives the version cannot be incremented and will always remain at
  3230. // 1. For all other creative types the version can be incremented only
  3231. // by 1 during update operations. In addition, the version will be
  3232. // automatically incremented by 1 when undergoing Rich Media creative
  3233. // merging. Applicable to all creative types.
  3234. Version int64 `json:"version,omitempty"`
  3235. // VideoDescription: Description of the video ad. Applicable to the
  3236. // following creative types: all INSTREAM_VIDEO and all VPAID.
  3237. VideoDescription string `json:"videoDescription,omitempty"`
  3238. // VideoDuration: Creative video duration in seconds. This is a
  3239. // read-only field. Applicable to the following creative types:
  3240. // INSTREAM_VIDEO, all RICH_MEDIA, and all VPAID.
  3241. VideoDuration float64 `json:"videoDuration,omitempty"`
  3242. // ServerResponse contains the HTTP response code and headers from the
  3243. // server.
  3244. googleapi.ServerResponse `json:"-"`
  3245. // ForceSendFields is a list of field names (e.g. "AccountId") to
  3246. // unconditionally include in API requests. By default, fields with
  3247. // empty values are omitted from API requests. However, any non-pointer,
  3248. // non-interface field appearing in ForceSendFields will be sent to the
  3249. // server regardless of whether the field is empty or not. This may be
  3250. // used to include empty fields in Patch requests.
  3251. ForceSendFields []string `json:"-"`
  3252. // NullFields is a list of field names (e.g. "AccountId") to include in
  3253. // API requests with the JSON null value. By default, fields with empty
  3254. // values are omitted from API requests. However, any field with an
  3255. // empty value appearing in NullFields will be sent to the server as
  3256. // null. It is an error if a field in this list has a non-empty value.
  3257. // This may be used to include null fields in Patch requests.
  3258. NullFields []string `json:"-"`
  3259. }
  3260. func (s *Creative) MarshalJSON() ([]byte, error) {
  3261. type NoMethod Creative
  3262. raw := NoMethod(*s)
  3263. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3264. }
  3265. func (s *Creative) UnmarshalJSON(data []byte) error {
  3266. type NoMethod Creative
  3267. var s1 struct {
  3268. VideoDuration gensupport.JSONFloat64 `json:"videoDuration"`
  3269. *NoMethod
  3270. }
  3271. s1.NoMethod = (*NoMethod)(s)
  3272. if err := json.Unmarshal(data, &s1); err != nil {
  3273. return err
  3274. }
  3275. s.VideoDuration = float64(s1.VideoDuration)
  3276. return nil
  3277. }
  3278. // CreativeAsset: Creative Asset.
  3279. type CreativeAsset struct {
  3280. // ActionScript3: Whether ActionScript3 is enabled for the flash asset.
  3281. // This is a read-only field. Applicable to the following creative type:
  3282. // FLASH_INPAGE. Applicable to DISPLAY when the primary asset type is
  3283. // not HTML_IMAGE.
  3284. ActionScript3 bool `json:"actionScript3,omitempty"`
  3285. // Active: Whether the video asset is active. This is a read-only field
  3286. // for VPAID_NON_LINEAR_VIDEO assets. Applicable to the following
  3287. // creative types: INSTREAM_VIDEO and all VPAID.
  3288. Active bool `json:"active,omitempty"`
  3289. // Alignment: Possible alignments for an asset. This is a read-only
  3290. // field. Applicable to the following creative types:
  3291. // RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL.
  3292. //
  3293. // Possible values:
  3294. // "ALIGNMENT_BOTTOM"
  3295. // "ALIGNMENT_LEFT"
  3296. // "ALIGNMENT_RIGHT"
  3297. // "ALIGNMENT_TOP"
  3298. Alignment string `json:"alignment,omitempty"`
  3299. // ArtworkType: Artwork type of rich media creative. This is a read-only
  3300. // field. Applicable to the following creative types: all RICH_MEDIA.
  3301. //
  3302. // Possible values:
  3303. // "ARTWORK_TYPE_FLASH"
  3304. // "ARTWORK_TYPE_HTML5"
  3305. // "ARTWORK_TYPE_IMAGE"
  3306. // "ARTWORK_TYPE_MIXED"
  3307. ArtworkType string `json:"artworkType,omitempty"`
  3308. // AssetIdentifier: Identifier of this asset. This is the same
  3309. // identifier returned during creative asset insert operation. This is a
  3310. // required field. Applicable to all but the following creative types:
  3311. // all REDIRECT and TRACKING_TEXT.
  3312. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3313. // BackupImageExit: Exit event configured for the backup image.
  3314. // Applicable to the following creative types: all RICH_MEDIA.
  3315. BackupImageExit *CreativeCustomEvent `json:"backupImageExit,omitempty"`
  3316. // BitRate: Detected bit-rate for video asset. This is a read-only
  3317. // field. Applicable to the following creative types: INSTREAM_VIDEO and
  3318. // all VPAID.
  3319. BitRate int64 `json:"bitRate,omitempty"`
  3320. // ChildAssetType: Rich media child asset type. This is a read-only
  3321. // field. Applicable to the following creative types: all VPAID.
  3322. //
  3323. // Possible values:
  3324. // "CHILD_ASSET_TYPE_DATA"
  3325. // "CHILD_ASSET_TYPE_FLASH"
  3326. // "CHILD_ASSET_TYPE_IMAGE"
  3327. // "CHILD_ASSET_TYPE_VIDEO"
  3328. ChildAssetType string `json:"childAssetType,omitempty"`
  3329. // CollapsedSize: Size of an asset when collapsed. This is a read-only
  3330. // field. Applicable to the following creative types: all RICH_MEDIA and
  3331. // all VPAID. Additionally, applicable to assets whose displayType is
  3332. // ASSET_DISPLAY_TYPE_EXPANDING or ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3333. CollapsedSize *Size `json:"collapsedSize,omitempty"`
  3334. // CompanionCreativeIds: List of companion creatives assigned to an
  3335. // in-stream video creative asset. Acceptable values include IDs of
  3336. // existing flash and image creatives. Applicable to INSTREAM_VIDEO
  3337. // creative type with dynamicAssetSelection set to true.
  3338. CompanionCreativeIds googleapi.Int64s `json:"companionCreativeIds,omitempty"`
  3339. // CustomStartTimeValue: Custom start time in seconds for making the
  3340. // asset visible. Applicable to the following creative types: all
  3341. // RICH_MEDIA. Value must be greater than or equal to 0.
  3342. CustomStartTimeValue int64 `json:"customStartTimeValue,omitempty"`
  3343. // DetectedFeatures: List of feature dependencies for the creative asset
  3344. // that are detected by DCM. Feature dependencies are features that a
  3345. // browser must be able to support in order to render your HTML5
  3346. // creative correctly. This is a read-only, auto-generated field.
  3347. // Applicable to the following creative types: HTML5_BANNER. Applicable
  3348. // to DISPLAY when the primary asset type is not HTML_IMAGE.
  3349. //
  3350. // Possible values:
  3351. // "APPLICATION_CACHE"
  3352. // "AUDIO"
  3353. // "CANVAS"
  3354. // "CANVAS_TEXT"
  3355. // "CSS_ANIMATIONS"
  3356. // "CSS_BACKGROUND_SIZE"
  3357. // "CSS_BORDER_IMAGE"
  3358. // "CSS_BORDER_RADIUS"
  3359. // "CSS_BOX_SHADOW"
  3360. // "CSS_COLUMNS"
  3361. // "CSS_FLEX_BOX"
  3362. // "CSS_FONT_FACE"
  3363. // "CSS_GENERATED_CONTENT"
  3364. // "CSS_GRADIENTS"
  3365. // "CSS_HSLA"
  3366. // "CSS_MULTIPLE_BGS"
  3367. // "CSS_OPACITY"
  3368. // "CSS_REFLECTIONS"
  3369. // "CSS_RGBA"
  3370. // "CSS_TEXT_SHADOW"
  3371. // "CSS_TRANSFORMS"
  3372. // "CSS_TRANSFORMS3D"
  3373. // "CSS_TRANSITIONS"
  3374. // "DRAG_AND_DROP"
  3375. // "GEO_LOCATION"
  3376. // "HASH_CHANGE"
  3377. // "HISTORY"
  3378. // "INDEXED_DB"
  3379. // "INLINE_SVG"
  3380. // "INPUT_ATTR_AUTOCOMPLETE"
  3381. // "INPUT_ATTR_AUTOFOCUS"
  3382. // "INPUT_ATTR_LIST"
  3383. // "INPUT_ATTR_MAX"
  3384. // "INPUT_ATTR_MIN"
  3385. // "INPUT_ATTR_MULTIPLE"
  3386. // "INPUT_ATTR_PATTERN"
  3387. // "INPUT_ATTR_PLACEHOLDER"
  3388. // "INPUT_ATTR_REQUIRED"
  3389. // "INPUT_ATTR_STEP"
  3390. // "INPUT_TYPE_COLOR"
  3391. // "INPUT_TYPE_DATE"
  3392. // "INPUT_TYPE_DATETIME"
  3393. // "INPUT_TYPE_DATETIME_LOCAL"
  3394. // "INPUT_TYPE_EMAIL"
  3395. // "INPUT_TYPE_MONTH"
  3396. // "INPUT_TYPE_NUMBER"
  3397. // "INPUT_TYPE_RANGE"
  3398. // "INPUT_TYPE_SEARCH"
  3399. // "INPUT_TYPE_TEL"
  3400. // "INPUT_TYPE_TIME"
  3401. // "INPUT_TYPE_URL"
  3402. // "INPUT_TYPE_WEEK"
  3403. // "LOCAL_STORAGE"
  3404. // "POST_MESSAGE"
  3405. // "SESSION_STORAGE"
  3406. // "SMIL"
  3407. // "SVG_CLIP_PATHS"
  3408. // "SVG_FE_IMAGE"
  3409. // "SVG_FILTERS"
  3410. // "SVG_HREF"
  3411. // "TOUCH"
  3412. // "VIDEO"
  3413. // "WEBGL"
  3414. // "WEB_SOCKETS"
  3415. // "WEB_SQL_DATABASE"
  3416. // "WEB_WORKERS"
  3417. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3418. // DisplayType: Type of rich media asset. This is a read-only field.
  3419. // Applicable to the following creative types: all RICH_MEDIA.
  3420. //
  3421. // Possible values:
  3422. // "ASSET_DISPLAY_TYPE_BACKDROP"
  3423. // "ASSET_DISPLAY_TYPE_EXPANDING"
  3424. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH"
  3425. // "ASSET_DISPLAY_TYPE_FLASH_IN_FLASH_EXPANDING"
  3426. // "ASSET_DISPLAY_TYPE_FLOATING"
  3427. // "ASSET_DISPLAY_TYPE_INPAGE"
  3428. // "ASSET_DISPLAY_TYPE_OVERLAY"
  3429. // "ASSET_DISPLAY_TYPE_PEEL_DOWN"
  3430. // "ASSET_DISPLAY_TYPE_VPAID_LINEAR"
  3431. // "ASSET_DISPLAY_TYPE_VPAID_NON_LINEAR"
  3432. DisplayType string `json:"displayType,omitempty"`
  3433. // Duration: Duration in seconds for which an asset will be displayed.
  3434. // Applicable to the following creative types: INSTREAM_VIDEO and
  3435. // VPAID_LINEAR_VIDEO. Value must be greater than or equal to 1.
  3436. Duration int64 `json:"duration,omitempty"`
  3437. // DurationType: Duration type for which an asset will be displayed.
  3438. // Applicable to the following creative types: all RICH_MEDIA.
  3439. //
  3440. // Possible values:
  3441. // "ASSET_DURATION_TYPE_AUTO"
  3442. // "ASSET_DURATION_TYPE_CUSTOM"
  3443. // "ASSET_DURATION_TYPE_NONE"
  3444. DurationType string `json:"durationType,omitempty"`
  3445. // ExpandedDimension: Detected expanded dimension for video asset. This
  3446. // is a read-only field. Applicable to the following creative types:
  3447. // INSTREAM_VIDEO and all VPAID.
  3448. ExpandedDimension *Size `json:"expandedDimension,omitempty"`
  3449. // FileSize: File size associated with this creative asset. This is a
  3450. // read-only field. Applicable to all but the following creative types:
  3451. // all REDIRECT and TRACKING_TEXT.
  3452. FileSize int64 `json:"fileSize,omitempty,string"`
  3453. // FlashVersion: Flash version of the asset. This is a read-only field.
  3454. // Applicable to the following creative types: FLASH_INPAGE, all
  3455. // RICH_MEDIA, and all VPAID. Applicable to DISPLAY when the primary
  3456. // asset type is not HTML_IMAGE.
  3457. FlashVersion int64 `json:"flashVersion,omitempty"`
  3458. // HideFlashObjects: Whether to hide Flash objects flag for an asset.
  3459. // Applicable to the following creative types: all RICH_MEDIA.
  3460. HideFlashObjects bool `json:"hideFlashObjects,omitempty"`
  3461. // HideSelectionBoxes: Whether to hide selection boxes flag for an
  3462. // asset. Applicable to the following creative types: all RICH_MEDIA.
  3463. HideSelectionBoxes bool `json:"hideSelectionBoxes,omitempty"`
  3464. // HorizontallyLocked: Whether the asset is horizontally locked. This is
  3465. // a read-only field. Applicable to the following creative types: all
  3466. // RICH_MEDIA.
  3467. HorizontallyLocked bool `json:"horizontallyLocked,omitempty"`
  3468. // Id: Numeric ID of this creative asset. This is a required field and
  3469. // should not be modified. Applicable to all but the following creative
  3470. // types: all REDIRECT and TRACKING_TEXT.
  3471. Id int64 `json:"id,omitempty,string"`
  3472. // IdDimensionValue: Dimension value for the ID of the asset. This is a
  3473. // read-only, auto-generated field.
  3474. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3475. // MimeType: Detected MIME type for video asset. This is a read-only
  3476. // field. Applicable to the following creative types: INSTREAM_VIDEO and
  3477. // all VPAID.
  3478. MimeType string `json:"mimeType,omitempty"`
  3479. // Offset: Offset position for an asset in collapsed mode. This is a
  3480. // read-only field. Applicable to the following creative types: all
  3481. // RICH_MEDIA and all VPAID. Additionally, only applicable to assets
  3482. // whose displayType is ASSET_DISPLAY_TYPE_EXPANDING or
  3483. // ASSET_DISPLAY_TYPE_PEEL_DOWN.
  3484. Offset *OffsetPosition `json:"offset,omitempty"`
  3485. // OriginalBackup: Whether the backup asset is original or changed by
  3486. // the user in DCM. Applicable to the following creative types: all
  3487. // RICH_MEDIA.
  3488. OriginalBackup bool `json:"originalBackup,omitempty"`
  3489. // Position: Offset position for an asset. Applicable to the following
  3490. // creative types: all RICH_MEDIA.
  3491. Position *OffsetPosition `json:"position,omitempty"`
  3492. // PositionLeftUnit: Offset left unit for an asset. This is a read-only
  3493. // field. Applicable to the following creative types: all RICH_MEDIA.
  3494. //
  3495. // Possible values:
  3496. // "OFFSET_UNIT_PERCENT"
  3497. // "OFFSET_UNIT_PIXEL"
  3498. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3499. PositionLeftUnit string `json:"positionLeftUnit,omitempty"`
  3500. // PositionTopUnit: Offset top unit for an asset. This is a read-only
  3501. // field if the asset displayType is ASSET_DISPLAY_TYPE_OVERLAY.
  3502. // Applicable to the following creative types: all RICH_MEDIA.
  3503. //
  3504. // Possible values:
  3505. // "OFFSET_UNIT_PERCENT"
  3506. // "OFFSET_UNIT_PIXEL"
  3507. // "OFFSET_UNIT_PIXEL_FROM_CENTER"
  3508. PositionTopUnit string `json:"positionTopUnit,omitempty"`
  3509. // ProgressiveServingUrl: Progressive URL for video asset. This is a
  3510. // read-only field. Applicable to the following creative types:
  3511. // INSTREAM_VIDEO and all VPAID.
  3512. ProgressiveServingUrl string `json:"progressiveServingUrl,omitempty"`
  3513. // Pushdown: Whether the asset pushes down other content. Applicable to
  3514. // the following creative types: all RICH_MEDIA. Additionally, only
  3515. // applicable when the asset offsets are 0, the collapsedSize.width
  3516. // matches size.width, and the collapsedSize.height is less than
  3517. // size.height.
  3518. Pushdown bool `json:"pushdown,omitempty"`
  3519. // PushdownDuration: Pushdown duration in seconds for an asset.
  3520. // Applicable to the following creative types: all
  3521. // RICH_MEDIA.Additionally, only applicable when the asset pushdown
  3522. // field is true, the offsets are 0, the collapsedSize.width matches
  3523. // size.width, and the collapsedSize.height is less than size.height.
  3524. // Acceptable values are 0 to 9.99, inclusive.
  3525. PushdownDuration float64 `json:"pushdownDuration,omitempty"`
  3526. // Role: Role of the asset in relation to creative. Applicable to all
  3527. // but the following creative types: all REDIRECT and TRACKING_TEXT.
  3528. // This is a required field.
  3529. // PRIMARY applies to DISPLAY, FLASH_INPAGE, HTML5_BANNER, IMAGE,
  3530. // DISPLAY_IMAGE_GALLERY, all RICH_MEDIA (which may contain multiple
  3531. // primary assets), and all VPAID creatives.
  3532. // BACKUP_IMAGE applies to FLASH_INPAGE, HTML5_BANNER, all RICH_MEDIA,
  3533. // and all VPAID creatives. Applicable to DISPLAY when the primary asset
  3534. // type is not HTML_IMAGE.
  3535. // ADDITIONAL_IMAGE and ADDITIONAL_FLASH apply to FLASH_INPAGE
  3536. // creatives.
  3537. // OTHER refers to assets from sources other than DCM, such as Studio
  3538. // uploaded assets, applicable to all RICH_MEDIA and all VPAID
  3539. // creatives.
  3540. // PARENT_VIDEO refers to videos uploaded by the user in DCM and is
  3541. // applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3542. // creatives.
  3543. // TRANSCODED_VIDEO refers to videos transcoded by DCM from PARENT_VIDEO
  3544. // assets and is applicable to INSTREAM_VIDEO and VPAID_LINEAR_VIDEO
  3545. // creatives.
  3546. // ALTERNATE_VIDEO refers to the DCM representation of child asset
  3547. // videos from Studio, and is applicable to VPAID_LINEAR_VIDEO
  3548. // creatives. These cannot be added or removed within DCM.
  3549. // For VPAID_LINEAR_VIDEO creatives, PARENT_VIDEO, TRANSCODED_VIDEO and
  3550. // ALTERNATE_VIDEO assets that are marked active serve as backup in case
  3551. // the VPAID creative cannot be served. Only PARENT_VIDEO assets can be
  3552. // added or removed for an INSTREAM_VIDEO or VPAID_LINEAR_VIDEO
  3553. // creative.
  3554. //
  3555. // Possible values:
  3556. // "ADDITIONAL_FLASH"
  3557. // "ADDITIONAL_IMAGE"
  3558. // "ALTERNATE_VIDEO"
  3559. // "BACKUP_IMAGE"
  3560. // "OTHER"
  3561. // "PARENT_VIDEO"
  3562. // "PRIMARY"
  3563. // "TRANSCODED_VIDEO"
  3564. Role string `json:"role,omitempty"`
  3565. // Size: Size associated with this creative asset. This is a required
  3566. // field when applicable; however for IMAGE and FLASH_INPAGE, creatives
  3567. // if left blank, this field will be automatically set using the actual
  3568. // size of the associated image asset. Applicable to the following
  3569. // creative types: DISPLAY_IMAGE_GALLERY, FLASH_INPAGE, HTML5_BANNER,
  3570. // IMAGE, and all RICH_MEDIA. Applicable to DISPLAY when the primary
  3571. // asset type is not HTML_IMAGE.
  3572. Size *Size `json:"size,omitempty"`
  3573. // SslCompliant: Whether the asset is SSL-compliant. This is a read-only
  3574. // field. Applicable to all but the following creative types: all
  3575. // REDIRECT and TRACKING_TEXT.
  3576. SslCompliant bool `json:"sslCompliant,omitempty"`
  3577. // StartTimeType: Initial wait time type before making the asset
  3578. // visible. Applicable to the following creative types: all RICH_MEDIA.
  3579. //
  3580. // Possible values:
  3581. // "ASSET_START_TIME_TYPE_CUSTOM"
  3582. // "ASSET_START_TIME_TYPE_NONE"
  3583. StartTimeType string `json:"startTimeType,omitempty"`
  3584. // StreamingServingUrl: Streaming URL for video asset. This is a
  3585. // read-only field. Applicable to the following creative types:
  3586. // INSTREAM_VIDEO and all VPAID.
  3587. StreamingServingUrl string `json:"streamingServingUrl,omitempty"`
  3588. // Transparency: Whether the asset is transparent. Applicable to the
  3589. // following creative types: all RICH_MEDIA. Additionally, only
  3590. // applicable to HTML5 assets.
  3591. Transparency bool `json:"transparency,omitempty"`
  3592. // VerticallyLocked: Whether the asset is vertically locked. This is a
  3593. // read-only field. Applicable to the following creative types: all
  3594. // RICH_MEDIA.
  3595. VerticallyLocked bool `json:"verticallyLocked,omitempty"`
  3596. // VideoDuration: Detected video duration for video asset. This is a
  3597. // read-only field. Applicable to the following creative types:
  3598. // INSTREAM_VIDEO and all VPAID.
  3599. VideoDuration float64 `json:"videoDuration,omitempty"`
  3600. // WindowMode: Window mode options for flash assets. Applicable to the
  3601. // following creative types: FLASH_INPAGE, RICH_MEDIA_DISPLAY_EXPANDING,
  3602. // RICH_MEDIA_IM_EXPAND, RICH_MEDIA_DISPLAY_BANNER, and
  3603. // RICH_MEDIA_INPAGE_FLOATING.
  3604. //
  3605. // Possible values:
  3606. // "OPAQUE"
  3607. // "TRANSPARENT"
  3608. // "WINDOW"
  3609. WindowMode string `json:"windowMode,omitempty"`
  3610. // ZIndex: zIndex value of an asset. Applicable to the following
  3611. // creative types: all RICH_MEDIA.Additionally, only applicable to
  3612. // assets whose displayType is NOT one of the following types:
  3613. // ASSET_DISPLAY_TYPE_INPAGE or ASSET_DISPLAY_TYPE_OVERLAY. Acceptable
  3614. // values are -999999999 to 999999999, inclusive.
  3615. ZIndex int64 `json:"zIndex,omitempty"`
  3616. // ZipFilename: File name of zip file. This is a read-only field.
  3617. // Applicable to the following creative types: HTML5_BANNER.
  3618. ZipFilename string `json:"zipFilename,omitempty"`
  3619. // ZipFilesize: Size of zip file. This is a read-only field. Applicable
  3620. // to the following creative types: HTML5_BANNER.
  3621. ZipFilesize string `json:"zipFilesize,omitempty"`
  3622. // ForceSendFields is a list of field names (e.g. "ActionScript3") to
  3623. // unconditionally include in API requests. By default, fields with
  3624. // empty values are omitted from API requests. However, any non-pointer,
  3625. // non-interface field appearing in ForceSendFields will be sent to the
  3626. // server regardless of whether the field is empty or not. This may be
  3627. // used to include empty fields in Patch requests.
  3628. ForceSendFields []string `json:"-"`
  3629. // NullFields is a list of field names (e.g. "ActionScript3") to include
  3630. // in API requests with the JSON null value. By default, fields with
  3631. // empty values are omitted from API requests. However, any field with
  3632. // an empty value appearing in NullFields will be sent to the server as
  3633. // null. It is an error if a field in this list has a non-empty value.
  3634. // This may be used to include null fields in Patch requests.
  3635. NullFields []string `json:"-"`
  3636. }
  3637. func (s *CreativeAsset) MarshalJSON() ([]byte, error) {
  3638. type NoMethod CreativeAsset
  3639. raw := NoMethod(*s)
  3640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3641. }
  3642. func (s *CreativeAsset) UnmarshalJSON(data []byte) error {
  3643. type NoMethod CreativeAsset
  3644. var s1 struct {
  3645. PushdownDuration gensupport.JSONFloat64 `json:"pushdownDuration"`
  3646. VideoDuration gensupport.JSONFloat64 `json:"videoDuration"`
  3647. *NoMethod
  3648. }
  3649. s1.NoMethod = (*NoMethod)(s)
  3650. if err := json.Unmarshal(data, &s1); err != nil {
  3651. return err
  3652. }
  3653. s.PushdownDuration = float64(s1.PushdownDuration)
  3654. s.VideoDuration = float64(s1.VideoDuration)
  3655. return nil
  3656. }
  3657. // CreativeAssetId: Creative Asset ID.
  3658. type CreativeAssetId struct {
  3659. // Name: Name of the creative asset. This is a required field while
  3660. // inserting an asset. After insertion, this assetIdentifier is used to
  3661. // identify the uploaded asset. Characters in the name must be
  3662. // alphanumeric or one of the following: ".-_ ". Spaces are allowed.
  3663. Name string `json:"name,omitempty"`
  3664. // Type: Type of asset to upload. This is a required field. FLASH and
  3665. // IMAGE are no longer supported for new uploads. All image assets
  3666. // should use HTML_IMAGE.
  3667. //
  3668. // Possible values:
  3669. // "FLASH"
  3670. // "HTML"
  3671. // "HTML_IMAGE"
  3672. // "IMAGE"
  3673. // "VIDEO"
  3674. Type string `json:"type,omitempty"`
  3675. // ForceSendFields is a list of field names (e.g. "Name") to
  3676. // unconditionally include in API requests. By default, fields with
  3677. // empty values are omitted from API requests. However, any non-pointer,
  3678. // non-interface field appearing in ForceSendFields will be sent to the
  3679. // server regardless of whether the field is empty or not. This may be
  3680. // used to include empty fields in Patch requests.
  3681. ForceSendFields []string `json:"-"`
  3682. // NullFields is a list of field names (e.g. "Name") to include in API
  3683. // requests with the JSON null value. By default, fields with empty
  3684. // values are omitted from API requests. However, any field with an
  3685. // empty value appearing in NullFields will be sent to the server as
  3686. // null. It is an error if a field in this list has a non-empty value.
  3687. // This may be used to include null fields in Patch requests.
  3688. NullFields []string `json:"-"`
  3689. }
  3690. func (s *CreativeAssetId) MarshalJSON() ([]byte, error) {
  3691. type NoMethod CreativeAssetId
  3692. raw := NoMethod(*s)
  3693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3694. }
  3695. // CreativeAssetMetadata: CreativeAssets contains properties of a
  3696. // creative asset file which will be uploaded or has already been
  3697. // uploaded. Refer to the creative sample code for how to upload assets
  3698. // and insert a creative.
  3699. type CreativeAssetMetadata struct {
  3700. // AssetIdentifier: ID of the creative asset. This is a required field.
  3701. AssetIdentifier *CreativeAssetId `json:"assetIdentifier,omitempty"`
  3702. // ClickTags: List of detected click tags for assets. This is a
  3703. // read-only auto-generated field.
  3704. ClickTags []*ClickTag `json:"clickTags,omitempty"`
  3705. // DetectedFeatures: List of feature dependencies for the creative asset
  3706. // that are detected by DCM. Feature dependencies are features that a
  3707. // browser must be able to support in order to render your HTML5
  3708. // creative correctly. This is a read-only, auto-generated field.
  3709. //
  3710. // Possible values:
  3711. // "APPLICATION_CACHE"
  3712. // "AUDIO"
  3713. // "CANVAS"
  3714. // "CANVAS_TEXT"
  3715. // "CSS_ANIMATIONS"
  3716. // "CSS_BACKGROUND_SIZE"
  3717. // "CSS_BORDER_IMAGE"
  3718. // "CSS_BORDER_RADIUS"
  3719. // "CSS_BOX_SHADOW"
  3720. // "CSS_COLUMNS"
  3721. // "CSS_FLEX_BOX"
  3722. // "CSS_FONT_FACE"
  3723. // "CSS_GENERATED_CONTENT"
  3724. // "CSS_GRADIENTS"
  3725. // "CSS_HSLA"
  3726. // "CSS_MULTIPLE_BGS"
  3727. // "CSS_OPACITY"
  3728. // "CSS_REFLECTIONS"
  3729. // "CSS_RGBA"
  3730. // "CSS_TEXT_SHADOW"
  3731. // "CSS_TRANSFORMS"
  3732. // "CSS_TRANSFORMS3D"
  3733. // "CSS_TRANSITIONS"
  3734. // "DRAG_AND_DROP"
  3735. // "GEO_LOCATION"
  3736. // "HASH_CHANGE"
  3737. // "HISTORY"
  3738. // "INDEXED_DB"
  3739. // "INLINE_SVG"
  3740. // "INPUT_ATTR_AUTOCOMPLETE"
  3741. // "INPUT_ATTR_AUTOFOCUS"
  3742. // "INPUT_ATTR_LIST"
  3743. // "INPUT_ATTR_MAX"
  3744. // "INPUT_ATTR_MIN"
  3745. // "INPUT_ATTR_MULTIPLE"
  3746. // "INPUT_ATTR_PATTERN"
  3747. // "INPUT_ATTR_PLACEHOLDER"
  3748. // "INPUT_ATTR_REQUIRED"
  3749. // "INPUT_ATTR_STEP"
  3750. // "INPUT_TYPE_COLOR"
  3751. // "INPUT_TYPE_DATE"
  3752. // "INPUT_TYPE_DATETIME"
  3753. // "INPUT_TYPE_DATETIME_LOCAL"
  3754. // "INPUT_TYPE_EMAIL"
  3755. // "INPUT_TYPE_MONTH"
  3756. // "INPUT_TYPE_NUMBER"
  3757. // "INPUT_TYPE_RANGE"
  3758. // "INPUT_TYPE_SEARCH"
  3759. // "INPUT_TYPE_TEL"
  3760. // "INPUT_TYPE_TIME"
  3761. // "INPUT_TYPE_URL"
  3762. // "INPUT_TYPE_WEEK"
  3763. // "LOCAL_STORAGE"
  3764. // "POST_MESSAGE"
  3765. // "SESSION_STORAGE"
  3766. // "SMIL"
  3767. // "SVG_CLIP_PATHS"
  3768. // "SVG_FE_IMAGE"
  3769. // "SVG_FILTERS"
  3770. // "SVG_HREF"
  3771. // "TOUCH"
  3772. // "VIDEO"
  3773. // "WEBGL"
  3774. // "WEB_SOCKETS"
  3775. // "WEB_SQL_DATABASE"
  3776. // "WEB_WORKERS"
  3777. DetectedFeatures []string `json:"detectedFeatures,omitempty"`
  3778. // Id: Numeric ID of the asset. This is a read-only, auto-generated
  3779. // field.
  3780. Id int64 `json:"id,omitempty,string"`
  3781. // IdDimensionValue: Dimension value for the numeric ID of the asset.
  3782. // This is a read-only, auto-generated field.
  3783. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  3784. // Kind: Identifies what kind of resource this is. Value: the fixed
  3785. // string "dfareporting#creativeAssetMetadata".
  3786. Kind string `json:"kind,omitempty"`
  3787. // WarnedValidationRules: Rules validated during code generation that
  3788. // generated a warning. This is a read-only, auto-generated
  3789. // field.
  3790. //
  3791. // Possible values are:
  3792. // - "ADMOB_REFERENCED"
  3793. // - "ASSET_FORMAT_UNSUPPORTED_DCM"
  3794. // - "ASSET_INVALID"
  3795. // - "CLICK_TAG_HARD_CODED"
  3796. // - "CLICK_TAG_INVALID"
  3797. // - "CLICK_TAG_IN_GWD"
  3798. // - "CLICK_TAG_MISSING"
  3799. // - "CLICK_TAG_MORE_THAN_ONE"
  3800. // - "CLICK_TAG_NON_TOP_LEVEL"
  3801. // - "COMPONENT_UNSUPPORTED_DCM"
  3802. // - "ENABLER_UNSUPPORTED_METHOD_DCM"
  3803. // - "EXTERNAL_FILE_REFERENCED"
  3804. // - "FILE_DETAIL_EMPTY"
  3805. // - "FILE_TYPE_INVALID"
  3806. // - "GWD_PROPERTIES_INVALID"
  3807. // - "HTML5_FEATURE_UNSUPPORTED"
  3808. // - "LINKED_FILE_NOT_FOUND"
  3809. // - "MAX_FLASH_VERSION_11"
  3810. // - "MRAID_REFERENCED"
  3811. // - "NOT_SSL_COMPLIANT"
  3812. // - "ORPHANED_ASSET"
  3813. // - "PRIMARY_HTML_MISSING"
  3814. // - "SVG_INVALID"
  3815. // - "ZIP_INVALID"
  3816. //
  3817. // Possible values:
  3818. // "ADMOB_REFERENCED"
  3819. // "ASSET_FORMAT_UNSUPPORTED_DCM"
  3820. // "ASSET_INVALID"
  3821. // "CLICK_TAG_HARD_CODED"
  3822. // "CLICK_TAG_INVALID"
  3823. // "CLICK_TAG_IN_GWD"
  3824. // "CLICK_TAG_MISSING"
  3825. // "CLICK_TAG_MORE_THAN_ONE"
  3826. // "CLICK_TAG_NON_TOP_LEVEL"
  3827. // "COMPONENT_UNSUPPORTED_DCM"
  3828. // "ENABLER_UNSUPPORTED_METHOD_DCM"
  3829. // "EXTERNAL_FILE_REFERENCED"
  3830. // "FILE_DETAIL_EMPTY"
  3831. // "FILE_TYPE_INVALID"
  3832. // "GWD_PROPERTIES_INVALID"
  3833. // "HTML5_FEATURE_UNSUPPORTED"
  3834. // "LINKED_FILE_NOT_FOUND"
  3835. // "MAX_FLASH_VERSION_11"
  3836. // "MRAID_REFERENCED"
  3837. // "NOT_SSL_COMPLIANT"
  3838. // "ORPHANED_ASSET"
  3839. // "PRIMARY_HTML_MISSING"
  3840. // "SVG_INVALID"
  3841. // "ZIP_INVALID"
  3842. WarnedValidationRules []string `json:"warnedValidationRules,omitempty"`
  3843. // ServerResponse contains the HTTP response code and headers from the
  3844. // server.
  3845. googleapi.ServerResponse `json:"-"`
  3846. // ForceSendFields is a list of field names (e.g. "AssetIdentifier") to
  3847. // unconditionally include in API requests. By default, fields with
  3848. // empty values are omitted from API requests. However, any non-pointer,
  3849. // non-interface field appearing in ForceSendFields will be sent to the
  3850. // server regardless of whether the field is empty or not. This may be
  3851. // used to include empty fields in Patch requests.
  3852. ForceSendFields []string `json:"-"`
  3853. // NullFields is a list of field names (e.g. "AssetIdentifier") to
  3854. // include in API requests with the JSON null value. By default, fields
  3855. // with empty values are omitted from API requests. However, any field
  3856. // with an empty value appearing in NullFields will be sent to the
  3857. // server as null. It is an error if a field in this list has a
  3858. // non-empty value. This may be used to include null fields in Patch
  3859. // requests.
  3860. NullFields []string `json:"-"`
  3861. }
  3862. func (s *CreativeAssetMetadata) MarshalJSON() ([]byte, error) {
  3863. type NoMethod CreativeAssetMetadata
  3864. raw := NoMethod(*s)
  3865. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3866. }
  3867. // CreativeAssetSelection: Encapsulates the list of rules for asset
  3868. // selection and a default asset in case none of the rules match.
  3869. // Applicable to INSTREAM_VIDEO creatives.
  3870. type CreativeAssetSelection struct {
  3871. // DefaultAssetId: A creativeAssets[].id. This should refer to one of
  3872. // the parent assets in this creative, and will be served if none of the
  3873. // rules match. This is a required field.
  3874. DefaultAssetId int64 `json:"defaultAssetId,omitempty,string"`
  3875. // Rules: Rules determine which asset will be served to a viewer. Rules
  3876. // will be evaluated in the order in which they are stored in this list.
  3877. // This list must contain at least one rule. Applicable to
  3878. // INSTREAM_VIDEO creatives.
  3879. Rules []*Rule `json:"rules,omitempty"`
  3880. // ForceSendFields is a list of field names (e.g. "DefaultAssetId") to
  3881. // unconditionally include in API requests. By default, fields with
  3882. // empty values are omitted from API requests. However, any non-pointer,
  3883. // non-interface field appearing in ForceSendFields will be sent to the
  3884. // server regardless of whether the field is empty or not. This may be
  3885. // used to include empty fields in Patch requests.
  3886. ForceSendFields []string `json:"-"`
  3887. // NullFields is a list of field names (e.g. "DefaultAssetId") to
  3888. // include in API requests with the JSON null value. By default, fields
  3889. // with empty values are omitted from API requests. However, any field
  3890. // with an empty value appearing in NullFields will be sent to the
  3891. // server as null. It is an error if a field in this list has a
  3892. // non-empty value. This may be used to include null fields in Patch
  3893. // requests.
  3894. NullFields []string `json:"-"`
  3895. }
  3896. func (s *CreativeAssetSelection) MarshalJSON() ([]byte, error) {
  3897. type NoMethod CreativeAssetSelection
  3898. raw := NoMethod(*s)
  3899. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3900. }
  3901. // CreativeAssignment: Creative Assignment.
  3902. type CreativeAssignment struct {
  3903. // Active: Whether this creative assignment is active. When true, the
  3904. // creative will be included in the ad's rotation.
  3905. Active bool `json:"active,omitempty"`
  3906. // ApplyEventTags: Whether applicable event tags should fire when this
  3907. // creative assignment is rendered. If this value is unset when the ad
  3908. // is inserted or updated, it will default to true for all creative
  3909. // types EXCEPT for INTERNAL_REDIRECT, INTERSTITIAL_INTERNAL_REDIRECT,
  3910. // and INSTREAM_VIDEO.
  3911. ApplyEventTags bool `json:"applyEventTags,omitempty"`
  3912. // ClickThroughUrl: Click-through URL of the creative assignment.
  3913. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  3914. // CompanionCreativeOverrides: Companion creative overrides for this
  3915. // creative assignment. Applicable to video ads.
  3916. CompanionCreativeOverrides []*CompanionClickThroughOverride `json:"companionCreativeOverrides,omitempty"`
  3917. // CreativeGroupAssignments: Creative group assignments for this
  3918. // creative assignment. Only one assignment per creative group number is
  3919. // allowed for a maximum of two assignments.
  3920. CreativeGroupAssignments []*CreativeGroupAssignment `json:"creativeGroupAssignments,omitempty"`
  3921. // CreativeId: ID of the creative to be assigned. This is a required
  3922. // field.
  3923. CreativeId int64 `json:"creativeId,omitempty,string"`
  3924. // CreativeIdDimensionValue: Dimension value for the ID of the creative.
  3925. // This is a read-only, auto-generated field.
  3926. CreativeIdDimensionValue *DimensionValue `json:"creativeIdDimensionValue,omitempty"`
  3927. // EndTime: Date and time that the assigned creative should stop
  3928. // serving. Must be later than the start time.
  3929. EndTime string `json:"endTime,omitempty"`
  3930. // RichMediaExitOverrides: Rich media exit overrides for this creative
  3931. // assignment.
  3932. // Applicable when the creative type is any of the following:
  3933. // - DISPLAY
  3934. // - RICH_MEDIA_INPAGE
  3935. // - RICH_MEDIA_INPAGE_FLOATING
  3936. // - RICH_MEDIA_IM_EXPAND
  3937. // - RICH_MEDIA_EXPANDING
  3938. // - RICH_MEDIA_INTERSTITIAL_FLOAT
  3939. // - RICH_MEDIA_MOBILE_IN_APP
  3940. // - RICH_MEDIA_MULTI_FLOATING
  3941. // - RICH_MEDIA_PEEL_DOWN
  3942. // - VPAID_LINEAR
  3943. // - VPAID_NON_LINEAR
  3944. RichMediaExitOverrides []*RichMediaExitOverride `json:"richMediaExitOverrides,omitempty"`
  3945. // Sequence: Sequence number of the creative assignment, applicable when
  3946. // the rotation type is CREATIVE_ROTATION_TYPE_SEQUENTIAL. Acceptable
  3947. // values are 1 to 65535, inclusive.
  3948. Sequence int64 `json:"sequence,omitempty"`
  3949. // SslCompliant: Whether the creative to be assigned is SSL-compliant.
  3950. // This is a read-only field that is auto-generated when the ad is
  3951. // inserted or updated.
  3952. SslCompliant bool `json:"sslCompliant,omitempty"`
  3953. // StartTime: Date and time that the assigned creative should start
  3954. // serving.
  3955. StartTime string `json:"startTime,omitempty"`
  3956. // Weight: Weight of the creative assignment, applicable when the
  3957. // rotation type is CREATIVE_ROTATION_TYPE_RANDOM. Value must be greater
  3958. // than or equal to 1.
  3959. Weight int64 `json:"weight,omitempty"`
  3960. // ForceSendFields is a list of field names (e.g. "Active") to
  3961. // unconditionally include in API requests. By default, fields with
  3962. // empty values are omitted from API requests. However, any non-pointer,
  3963. // non-interface field appearing in ForceSendFields will be sent to the
  3964. // server regardless of whether the field is empty or not. This may be
  3965. // used to include empty fields in Patch requests.
  3966. ForceSendFields []string `json:"-"`
  3967. // NullFields is a list of field names (e.g. "Active") to include in API
  3968. // requests with the JSON null value. By default, fields with empty
  3969. // values are omitted from API requests. However, any field with an
  3970. // empty value appearing in NullFields will be sent to the server as
  3971. // null. It is an error if a field in this list has a non-empty value.
  3972. // This may be used to include null fields in Patch requests.
  3973. NullFields []string `json:"-"`
  3974. }
  3975. func (s *CreativeAssignment) MarshalJSON() ([]byte, error) {
  3976. type NoMethod CreativeAssignment
  3977. raw := NoMethod(*s)
  3978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3979. }
  3980. // CreativeCustomEvent: Creative Custom Event.
  3981. type CreativeCustomEvent struct {
  3982. // AdvertiserCustomEventId: Unique ID of this event used by DDM
  3983. // Reporting and Data Transfer. This is a read-only field.
  3984. AdvertiserCustomEventId int64 `json:"advertiserCustomEventId,omitempty,string"`
  3985. // AdvertiserCustomEventName: User-entered name for the event.
  3986. AdvertiserCustomEventName string `json:"advertiserCustomEventName,omitempty"`
  3987. // AdvertiserCustomEventType: Type of the event. This is a read-only
  3988. // field.
  3989. //
  3990. // Possible values:
  3991. // "ADVERTISER_EVENT_COUNTER"
  3992. // "ADVERTISER_EVENT_EXIT"
  3993. // "ADVERTISER_EVENT_TIMER"
  3994. AdvertiserCustomEventType string `json:"advertiserCustomEventType,omitempty"`
  3995. // ArtworkLabel: Artwork label column, used to link events in DCM back
  3996. // to events in Studio. This is a required field and should not be
  3997. // modified after insertion.
  3998. ArtworkLabel string `json:"artworkLabel,omitempty"`
  3999. // ArtworkType: Artwork type used by the creative.This is a read-only
  4000. // field.
  4001. //
  4002. // Possible values:
  4003. // "ARTWORK_TYPE_FLASH"
  4004. // "ARTWORK_TYPE_HTML5"
  4005. // "ARTWORK_TYPE_IMAGE"
  4006. // "ARTWORK_TYPE_MIXED"
  4007. ArtworkType string `json:"artworkType,omitempty"`
  4008. // ExitUrl: Exit URL of the event. This field is used only for exit
  4009. // events.
  4010. ExitUrl string `json:"exitUrl,omitempty"`
  4011. // Id: ID of this event. This is a required field and should not be
  4012. // modified after insertion.
  4013. Id int64 `json:"id,omitempty,string"`
  4014. // PopupWindowProperties: Properties for rich media popup windows. This
  4015. // field is used only for exit events.
  4016. PopupWindowProperties *PopupWindowProperties `json:"popupWindowProperties,omitempty"`
  4017. // TargetType: Target type used by the event.
  4018. //
  4019. // Possible values:
  4020. // "TARGET_BLANK"
  4021. // "TARGET_PARENT"
  4022. // "TARGET_POPUP"
  4023. // "TARGET_SELF"
  4024. // "TARGET_TOP"
  4025. TargetType string `json:"targetType,omitempty"`
  4026. // VideoReportingId: Video reporting ID, used to differentiate multiple
  4027. // videos in a single creative. This is a read-only field.
  4028. VideoReportingId string `json:"videoReportingId,omitempty"`
  4029. // ForceSendFields is a list of field names (e.g.
  4030. // "AdvertiserCustomEventId") to unconditionally include in API
  4031. // requests. By default, fields with empty values are omitted from API
  4032. // requests. However, any non-pointer, non-interface field appearing in
  4033. // ForceSendFields will be sent to the server regardless of whether the
  4034. // field is empty or not. This may be used to include empty fields in
  4035. // Patch requests.
  4036. ForceSendFields []string `json:"-"`
  4037. // NullFields is a list of field names (e.g. "AdvertiserCustomEventId")
  4038. // to include in API requests with the JSON null value. By default,
  4039. // fields with empty values are omitted from API requests. However, any
  4040. // field with an empty value appearing in NullFields will be sent to the
  4041. // server as null. It is an error if a field in this list has a
  4042. // non-empty value. This may be used to include null fields in Patch
  4043. // requests.
  4044. NullFields []string `json:"-"`
  4045. }
  4046. func (s *CreativeCustomEvent) MarshalJSON() ([]byte, error) {
  4047. type NoMethod CreativeCustomEvent
  4048. raw := NoMethod(*s)
  4049. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4050. }
  4051. // CreativeField: Contains properties of a creative field.
  4052. type CreativeField struct {
  4053. // AccountId: Account ID of this creative field. This is a read-only
  4054. // field that can be left blank.
  4055. AccountId int64 `json:"accountId,omitempty,string"`
  4056. // AdvertiserId: Advertiser ID of this creative field. This is a
  4057. // required field on insertion.
  4058. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4059. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4060. // advertiser. This is a read-only, auto-generated field.
  4061. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4062. // Id: ID of this creative field. This is a read-only, auto-generated
  4063. // field.
  4064. Id int64 `json:"id,omitempty,string"`
  4065. // Kind: Identifies what kind of resource this is. Value: the fixed
  4066. // string "dfareporting#creativeField".
  4067. Kind string `json:"kind,omitempty"`
  4068. // Name: Name of this creative field. This is a required field and must
  4069. // be less than 256 characters long and unique among creative fields of
  4070. // the same advertiser.
  4071. Name string `json:"name,omitempty"`
  4072. // SubaccountId: Subaccount ID of this creative field. This is a
  4073. // read-only field that can be left blank.
  4074. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4075. // ServerResponse contains the HTTP response code and headers from the
  4076. // server.
  4077. googleapi.ServerResponse `json:"-"`
  4078. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4079. // unconditionally include in API requests. By default, fields with
  4080. // empty values are omitted from API requests. However, any non-pointer,
  4081. // non-interface field appearing in ForceSendFields will be sent to the
  4082. // server regardless of whether the field is empty or not. This may be
  4083. // used to include empty fields in Patch requests.
  4084. ForceSendFields []string `json:"-"`
  4085. // NullFields is a list of field names (e.g. "AccountId") to include in
  4086. // API requests with the JSON null value. By default, fields with empty
  4087. // values are omitted from API requests. However, any field with an
  4088. // empty value appearing in NullFields will be sent to the server as
  4089. // null. It is an error if a field in this list has a non-empty value.
  4090. // This may be used to include null fields in Patch requests.
  4091. NullFields []string `json:"-"`
  4092. }
  4093. func (s *CreativeField) MarshalJSON() ([]byte, error) {
  4094. type NoMethod CreativeField
  4095. raw := NoMethod(*s)
  4096. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4097. }
  4098. // CreativeFieldAssignment: Creative Field Assignment.
  4099. type CreativeFieldAssignment struct {
  4100. // CreativeFieldId: ID of the creative field.
  4101. CreativeFieldId int64 `json:"creativeFieldId,omitempty,string"`
  4102. // CreativeFieldValueId: ID of the creative field value.
  4103. CreativeFieldValueId int64 `json:"creativeFieldValueId,omitempty,string"`
  4104. // ForceSendFields is a list of field names (e.g. "CreativeFieldId") to
  4105. // unconditionally include in API requests. By default, fields with
  4106. // empty values are omitted from API requests. However, any non-pointer,
  4107. // non-interface field appearing in ForceSendFields will be sent to the
  4108. // server regardless of whether the field is empty or not. This may be
  4109. // used to include empty fields in Patch requests.
  4110. ForceSendFields []string `json:"-"`
  4111. // NullFields is a list of field names (e.g. "CreativeFieldId") to
  4112. // include in API requests with the JSON null value. By default, fields
  4113. // with empty values are omitted from API requests. However, any field
  4114. // with an empty value appearing in NullFields will be sent to the
  4115. // server as null. It is an error if a field in this list has a
  4116. // non-empty value. This may be used to include null fields in Patch
  4117. // requests.
  4118. NullFields []string `json:"-"`
  4119. }
  4120. func (s *CreativeFieldAssignment) MarshalJSON() ([]byte, error) {
  4121. type NoMethod CreativeFieldAssignment
  4122. raw := NoMethod(*s)
  4123. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4124. }
  4125. // CreativeFieldValue: Contains properties of a creative field value.
  4126. type CreativeFieldValue struct {
  4127. // Id: ID of this creative field value. This is a read-only,
  4128. // auto-generated field.
  4129. Id int64 `json:"id,omitempty,string"`
  4130. // Kind: Identifies what kind of resource this is. Value: the fixed
  4131. // string "dfareporting#creativeFieldValue".
  4132. Kind string `json:"kind,omitempty"`
  4133. // Value: Value of this creative field value. It needs to be less than
  4134. // 256 characters in length and unique per creative field.
  4135. Value string `json:"value,omitempty"`
  4136. // ServerResponse contains the HTTP response code and headers from the
  4137. // server.
  4138. googleapi.ServerResponse `json:"-"`
  4139. // ForceSendFields is a list of field names (e.g. "Id") to
  4140. // unconditionally include in API requests. By default, fields with
  4141. // empty values are omitted from API requests. However, any non-pointer,
  4142. // non-interface field appearing in ForceSendFields will be sent to the
  4143. // server regardless of whether the field is empty or not. This may be
  4144. // used to include empty fields in Patch requests.
  4145. ForceSendFields []string `json:"-"`
  4146. // NullFields is a list of field names (e.g. "Id") to include in API
  4147. // requests with the JSON null value. By default, fields with empty
  4148. // values are omitted from API requests. However, any field with an
  4149. // empty value appearing in NullFields will be sent to the server as
  4150. // null. It is an error if a field in this list has a non-empty value.
  4151. // This may be used to include null fields in Patch requests.
  4152. NullFields []string `json:"-"`
  4153. }
  4154. func (s *CreativeFieldValue) MarshalJSON() ([]byte, error) {
  4155. type NoMethod CreativeFieldValue
  4156. raw := NoMethod(*s)
  4157. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4158. }
  4159. // CreativeFieldValuesListResponse: Creative Field Value List Response
  4160. type CreativeFieldValuesListResponse struct {
  4161. // CreativeFieldValues: Creative field value collection.
  4162. CreativeFieldValues []*CreativeFieldValue `json:"creativeFieldValues,omitempty"`
  4163. // Kind: Identifies what kind of resource this is. Value: the fixed
  4164. // string "dfareporting#creativeFieldValuesListResponse".
  4165. Kind string `json:"kind,omitempty"`
  4166. // NextPageToken: Pagination token to be used for the next list
  4167. // operation.
  4168. NextPageToken string `json:"nextPageToken,omitempty"`
  4169. // ServerResponse contains the HTTP response code and headers from the
  4170. // server.
  4171. googleapi.ServerResponse `json:"-"`
  4172. // ForceSendFields is a list of field names (e.g. "CreativeFieldValues")
  4173. // to unconditionally include in API requests. By default, fields with
  4174. // empty values are omitted from API requests. However, any non-pointer,
  4175. // non-interface field appearing in ForceSendFields will be sent to the
  4176. // server regardless of whether the field is empty or not. This may be
  4177. // used to include empty fields in Patch requests.
  4178. ForceSendFields []string `json:"-"`
  4179. // NullFields is a list of field names (e.g. "CreativeFieldValues") to
  4180. // include in API requests with the JSON null value. By default, fields
  4181. // with empty values are omitted from API requests. However, any field
  4182. // with an empty value appearing in NullFields will be sent to the
  4183. // server as null. It is an error if a field in this list has a
  4184. // non-empty value. This may be used to include null fields in Patch
  4185. // requests.
  4186. NullFields []string `json:"-"`
  4187. }
  4188. func (s *CreativeFieldValuesListResponse) MarshalJSON() ([]byte, error) {
  4189. type NoMethod CreativeFieldValuesListResponse
  4190. raw := NoMethod(*s)
  4191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4192. }
  4193. // CreativeFieldsListResponse: Creative Field List Response
  4194. type CreativeFieldsListResponse struct {
  4195. // CreativeFields: Creative field collection.
  4196. CreativeFields []*CreativeField `json:"creativeFields,omitempty"`
  4197. // Kind: Identifies what kind of resource this is. Value: the fixed
  4198. // string "dfareporting#creativeFieldsListResponse".
  4199. Kind string `json:"kind,omitempty"`
  4200. // NextPageToken: Pagination token to be used for the next list
  4201. // operation.
  4202. NextPageToken string `json:"nextPageToken,omitempty"`
  4203. // ServerResponse contains the HTTP response code and headers from the
  4204. // server.
  4205. googleapi.ServerResponse `json:"-"`
  4206. // ForceSendFields is a list of field names (e.g. "CreativeFields") to
  4207. // unconditionally include in API requests. By default, fields with
  4208. // empty values are omitted from API requests. However, any non-pointer,
  4209. // non-interface field appearing in ForceSendFields will be sent to the
  4210. // server regardless of whether the field is empty or not. This may be
  4211. // used to include empty fields in Patch requests.
  4212. ForceSendFields []string `json:"-"`
  4213. // NullFields is a list of field names (e.g. "CreativeFields") to
  4214. // include in API requests with the JSON null value. By default, fields
  4215. // with empty values are omitted from API requests. However, any field
  4216. // with an empty value appearing in NullFields will be sent to the
  4217. // server as null. It is an error if a field in this list has a
  4218. // non-empty value. This may be used to include null fields in Patch
  4219. // requests.
  4220. NullFields []string `json:"-"`
  4221. }
  4222. func (s *CreativeFieldsListResponse) MarshalJSON() ([]byte, error) {
  4223. type NoMethod CreativeFieldsListResponse
  4224. raw := NoMethod(*s)
  4225. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4226. }
  4227. // CreativeGroup: Contains properties of a creative group.
  4228. type CreativeGroup struct {
  4229. // AccountId: Account ID of this creative group. This is a read-only
  4230. // field that can be left blank.
  4231. AccountId int64 `json:"accountId,omitempty,string"`
  4232. // AdvertiserId: Advertiser ID of this creative group. This is a
  4233. // required field on insertion.
  4234. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  4235. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  4236. // advertiser. This is a read-only, auto-generated field.
  4237. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  4238. // GroupNumber: Subgroup of the creative group. Assign your creative
  4239. // groups to a subgroup in order to filter or manage them more easily.
  4240. // This field is required on insertion and is read-only after insertion.
  4241. // Acceptable values are 1 to 2, inclusive.
  4242. GroupNumber int64 `json:"groupNumber,omitempty"`
  4243. // Id: ID of this creative group. This is a read-only, auto-generated
  4244. // field.
  4245. Id int64 `json:"id,omitempty,string"`
  4246. // Kind: Identifies what kind of resource this is. Value: the fixed
  4247. // string "dfareporting#creativeGroup".
  4248. Kind string `json:"kind,omitempty"`
  4249. // Name: Name of this creative group. This is a required field and must
  4250. // be less than 256 characters long and unique among creative groups of
  4251. // the same advertiser.
  4252. Name string `json:"name,omitempty"`
  4253. // SubaccountId: Subaccount ID of this creative group. This is a
  4254. // read-only field that can be left blank.
  4255. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  4256. // ServerResponse contains the HTTP response code and headers from the
  4257. // server.
  4258. googleapi.ServerResponse `json:"-"`
  4259. // ForceSendFields is a list of field names (e.g. "AccountId") to
  4260. // unconditionally include in API requests. By default, fields with
  4261. // empty values are omitted from API requests. However, any non-pointer,
  4262. // non-interface field appearing in ForceSendFields will be sent to the
  4263. // server regardless of whether the field is empty or not. This may be
  4264. // used to include empty fields in Patch requests.
  4265. ForceSendFields []string `json:"-"`
  4266. // NullFields is a list of field names (e.g. "AccountId") to include in
  4267. // API requests with the JSON null value. By default, fields with empty
  4268. // values are omitted from API requests. However, any field with an
  4269. // empty value appearing in NullFields will be sent to the server as
  4270. // null. It is an error if a field in this list has a non-empty value.
  4271. // This may be used to include null fields in Patch requests.
  4272. NullFields []string `json:"-"`
  4273. }
  4274. func (s *CreativeGroup) MarshalJSON() ([]byte, error) {
  4275. type NoMethod CreativeGroup
  4276. raw := NoMethod(*s)
  4277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4278. }
  4279. // CreativeGroupAssignment: Creative Group Assignment.
  4280. type CreativeGroupAssignment struct {
  4281. // CreativeGroupId: ID of the creative group to be assigned.
  4282. CreativeGroupId int64 `json:"creativeGroupId,omitempty,string"`
  4283. // CreativeGroupNumber: Creative group number of the creative group
  4284. // assignment.
  4285. //
  4286. // Possible values:
  4287. // "CREATIVE_GROUP_ONE"
  4288. // "CREATIVE_GROUP_TWO"
  4289. CreativeGroupNumber string `json:"creativeGroupNumber,omitempty"`
  4290. // ForceSendFields is a list of field names (e.g. "CreativeGroupId") to
  4291. // unconditionally include in API requests. By default, fields with
  4292. // empty values are omitted from API requests. However, any non-pointer,
  4293. // non-interface field appearing in ForceSendFields will be sent to the
  4294. // server regardless of whether the field is empty or not. This may be
  4295. // used to include empty fields in Patch requests.
  4296. ForceSendFields []string `json:"-"`
  4297. // NullFields is a list of field names (e.g. "CreativeGroupId") to
  4298. // include in API requests with the JSON null value. By default, fields
  4299. // with empty values are omitted from API requests. However, any field
  4300. // with an empty value appearing in NullFields will be sent to the
  4301. // server as null. It is an error if a field in this list has a
  4302. // non-empty value. This may be used to include null fields in Patch
  4303. // requests.
  4304. NullFields []string `json:"-"`
  4305. }
  4306. func (s *CreativeGroupAssignment) MarshalJSON() ([]byte, error) {
  4307. type NoMethod CreativeGroupAssignment
  4308. raw := NoMethod(*s)
  4309. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4310. }
  4311. // CreativeGroupsListResponse: Creative Group List Response
  4312. type CreativeGroupsListResponse struct {
  4313. // CreativeGroups: Creative group collection.
  4314. CreativeGroups []*CreativeGroup `json:"creativeGroups,omitempty"`
  4315. // Kind: Identifies what kind of resource this is. Value: the fixed
  4316. // string "dfareporting#creativeGroupsListResponse".
  4317. Kind string `json:"kind,omitempty"`
  4318. // NextPageToken: Pagination token to be used for the next list
  4319. // operation.
  4320. NextPageToken string `json:"nextPageToken,omitempty"`
  4321. // ServerResponse contains the HTTP response code and headers from the
  4322. // server.
  4323. googleapi.ServerResponse `json:"-"`
  4324. // ForceSendFields is a list of field names (e.g. "CreativeGroups") to
  4325. // unconditionally include in API requests. By default, fields with
  4326. // empty values are omitted from API requests. However, any non-pointer,
  4327. // non-interface field appearing in ForceSendFields will be sent to the
  4328. // server regardless of whether the field is empty or not. This may be
  4329. // used to include empty fields in Patch requests.
  4330. ForceSendFields []string `json:"-"`
  4331. // NullFields is a list of field names (e.g. "CreativeGroups") to
  4332. // include in API requests with the JSON null value. By default, fields
  4333. // with empty values are omitted from API requests. However, any field
  4334. // with an empty value appearing in NullFields will be sent to the
  4335. // server as null. It is an error if a field in this list has a
  4336. // non-empty value. This may be used to include null fields in Patch
  4337. // requests.
  4338. NullFields []string `json:"-"`
  4339. }
  4340. func (s *CreativeGroupsListResponse) MarshalJSON() ([]byte, error) {
  4341. type NoMethod CreativeGroupsListResponse
  4342. raw := NoMethod(*s)
  4343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4344. }
  4345. // CreativeOptimizationConfiguration: Creative optimization settings.
  4346. type CreativeOptimizationConfiguration struct {
  4347. // Id: ID of this creative optimization config. This field is
  4348. // auto-generated when the campaign is inserted or updated. It can be
  4349. // null for existing campaigns.
  4350. Id int64 `json:"id,omitempty,string"`
  4351. // Name: Name of this creative optimization config. This is a required
  4352. // field and must be less than 129 characters long.
  4353. Name string `json:"name,omitempty"`
  4354. // OptimizationActivitys: List of optimization activities associated
  4355. // with this configuration.
  4356. OptimizationActivitys []*OptimizationActivity `json:"optimizationActivitys,omitempty"`
  4357. // OptimizationModel: Optimization model for this configuration.
  4358. //
  4359. // Possible values:
  4360. // "CLICK"
  4361. // "POST_CLICK"
  4362. // "POST_CLICK_AND_IMPRESSION"
  4363. // "POST_IMPRESSION"
  4364. // "VIDEO_COMPLETION"
  4365. OptimizationModel string `json:"optimizationModel,omitempty"`
  4366. // ForceSendFields is a list of field names (e.g. "Id") to
  4367. // unconditionally include in API requests. By default, fields with
  4368. // empty values are omitted from API requests. However, any non-pointer,
  4369. // non-interface field appearing in ForceSendFields will be sent to the
  4370. // server regardless of whether the field is empty or not. This may be
  4371. // used to include empty fields in Patch requests.
  4372. ForceSendFields []string `json:"-"`
  4373. // NullFields is a list of field names (e.g. "Id") to include in API
  4374. // requests with the JSON null value. By default, fields with empty
  4375. // values are omitted from API requests. However, any field with an
  4376. // empty value appearing in NullFields will be sent to the server as
  4377. // null. It is an error if a field in this list has a non-empty value.
  4378. // This may be used to include null fields in Patch requests.
  4379. NullFields []string `json:"-"`
  4380. }
  4381. func (s *CreativeOptimizationConfiguration) MarshalJSON() ([]byte, error) {
  4382. type NoMethod CreativeOptimizationConfiguration
  4383. raw := NoMethod(*s)
  4384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4385. }
  4386. // CreativeRotation: Creative Rotation.
  4387. type CreativeRotation struct {
  4388. // CreativeAssignments: Creative assignments in this creative rotation.
  4389. CreativeAssignments []*CreativeAssignment `json:"creativeAssignments,omitempty"`
  4390. // CreativeOptimizationConfigurationId: Creative optimization
  4391. // configuration that is used by this ad. It should refer to one of the
  4392. // existing optimization configurations in the ad's campaign. If it is
  4393. // unset or set to 0, then the campaign's default optimization
  4394. // configuration will be used for this ad.
  4395. CreativeOptimizationConfigurationId int64 `json:"creativeOptimizationConfigurationId,omitempty,string"`
  4396. // Type: Type of creative rotation. Can be used to specify whether to
  4397. // use sequential or random rotation.
  4398. //
  4399. // Possible values:
  4400. // "CREATIVE_ROTATION_TYPE_RANDOM"
  4401. // "CREATIVE_ROTATION_TYPE_SEQUENTIAL"
  4402. Type string `json:"type,omitempty"`
  4403. // WeightCalculationStrategy: Strategy for calculating weights. Used
  4404. // with CREATIVE_ROTATION_TYPE_RANDOM.
  4405. //
  4406. // Possible values:
  4407. // "WEIGHT_STRATEGY_CUSTOM"
  4408. // "WEIGHT_STRATEGY_EQUAL"
  4409. // "WEIGHT_STRATEGY_HIGHEST_CTR"
  4410. // "WEIGHT_STRATEGY_OPTIMIZED"
  4411. WeightCalculationStrategy string `json:"weightCalculationStrategy,omitempty"`
  4412. // ForceSendFields is a list of field names (e.g. "CreativeAssignments")
  4413. // to unconditionally include in API requests. By default, fields with
  4414. // empty values are omitted from API requests. However, any non-pointer,
  4415. // non-interface field appearing in ForceSendFields will be sent to the
  4416. // server regardless of whether the field is empty or not. This may be
  4417. // used to include empty fields in Patch requests.
  4418. ForceSendFields []string `json:"-"`
  4419. // NullFields is a list of field names (e.g. "CreativeAssignments") to
  4420. // include in API requests with the JSON null value. By default, fields
  4421. // with empty values are omitted from API requests. However, any field
  4422. // with an empty value appearing in NullFields will be sent to the
  4423. // server as null. It is an error if a field in this list has a
  4424. // non-empty value. This may be used to include null fields in Patch
  4425. // requests.
  4426. NullFields []string `json:"-"`
  4427. }
  4428. func (s *CreativeRotation) MarshalJSON() ([]byte, error) {
  4429. type NoMethod CreativeRotation
  4430. raw := NoMethod(*s)
  4431. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4432. }
  4433. // CreativeSettings: Creative Settings
  4434. type CreativeSettings struct {
  4435. // IFrameFooter: Header text for iFrames for this site. Must be less
  4436. // than or equal to 2000 characters long.
  4437. IFrameFooter string `json:"iFrameFooter,omitempty"`
  4438. // IFrameHeader: Header text for iFrames for this site. Must be less
  4439. // than or equal to 2000 characters long.
  4440. IFrameHeader string `json:"iFrameHeader,omitempty"`
  4441. // ForceSendFields is a list of field names (e.g. "IFrameFooter") to
  4442. // unconditionally include in API requests. By default, fields with
  4443. // empty values are omitted from API requests. However, any non-pointer,
  4444. // non-interface field appearing in ForceSendFields will be sent to the
  4445. // server regardless of whether the field is empty or not. This may be
  4446. // used to include empty fields in Patch requests.
  4447. ForceSendFields []string `json:"-"`
  4448. // NullFields is a list of field names (e.g. "IFrameFooter") to include
  4449. // in API requests with the JSON null value. By default, fields with
  4450. // empty values are omitted from API requests. However, any field with
  4451. // an empty value appearing in NullFields will be sent to the server as
  4452. // null. It is an error if a field in this list has a non-empty value.
  4453. // This may be used to include null fields in Patch requests.
  4454. NullFields []string `json:"-"`
  4455. }
  4456. func (s *CreativeSettings) MarshalJSON() ([]byte, error) {
  4457. type NoMethod CreativeSettings
  4458. raw := NoMethod(*s)
  4459. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4460. }
  4461. // CreativesListResponse: Creative List Response
  4462. type CreativesListResponse struct {
  4463. // Creatives: Creative collection.
  4464. Creatives []*Creative `json:"creatives,omitempty"`
  4465. // Kind: Identifies what kind of resource this is. Value: the fixed
  4466. // string "dfareporting#creativesListResponse".
  4467. Kind string `json:"kind,omitempty"`
  4468. // NextPageToken: Pagination token to be used for the next list
  4469. // operation.
  4470. NextPageToken string `json:"nextPageToken,omitempty"`
  4471. // ServerResponse contains the HTTP response code and headers from the
  4472. // server.
  4473. googleapi.ServerResponse `json:"-"`
  4474. // ForceSendFields is a list of field names (e.g. "Creatives") to
  4475. // unconditionally include in API requests. By default, fields with
  4476. // empty values are omitted from API requests. However, any non-pointer,
  4477. // non-interface field appearing in ForceSendFields will be sent to the
  4478. // server regardless of whether the field is empty or not. This may be
  4479. // used to include empty fields in Patch requests.
  4480. ForceSendFields []string `json:"-"`
  4481. // NullFields is a list of field names (e.g. "Creatives") to include in
  4482. // API requests with the JSON null value. By default, fields with empty
  4483. // values are omitted from API requests. However, any field with an
  4484. // empty value appearing in NullFields will be sent to the server as
  4485. // null. It is an error if a field in this list has a non-empty value.
  4486. // This may be used to include null fields in Patch requests.
  4487. NullFields []string `json:"-"`
  4488. }
  4489. func (s *CreativesListResponse) MarshalJSON() ([]byte, error) {
  4490. type NoMethod CreativesListResponse
  4491. raw := NoMethod(*s)
  4492. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4493. }
  4494. // CrossDimensionReachReportCompatibleFields: Represents fields that are
  4495. // compatible to be selected for a report of type
  4496. // "CROSS_DIMENSION_REACH".
  4497. type CrossDimensionReachReportCompatibleFields struct {
  4498. // Breakdown: Dimensions which are compatible to be selected in the
  4499. // "breakdown" section of the report.
  4500. Breakdown []*Dimension `json:"breakdown,omitempty"`
  4501. // DimensionFilters: Dimensions which are compatible to be selected in
  4502. // the "dimensionFilters" section of the report.
  4503. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  4504. // Kind: The kind of resource this is, in this case
  4505. // dfareporting#crossDimensionReachReportCompatibleFields.
  4506. Kind string `json:"kind,omitempty"`
  4507. // Metrics: Metrics which are compatible to be selected in the
  4508. // "metricNames" section of the report.
  4509. Metrics []*Metric `json:"metrics,omitempty"`
  4510. // OverlapMetrics: Metrics which are compatible to be selected in the
  4511. // "overlapMetricNames" section of the report.
  4512. OverlapMetrics []*Metric `json:"overlapMetrics,omitempty"`
  4513. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  4514. // unconditionally include in API requests. By default, fields with
  4515. // empty values are omitted from API requests. However, any non-pointer,
  4516. // non-interface field appearing in ForceSendFields will be sent to the
  4517. // server regardless of whether the field is empty or not. This may be
  4518. // used to include empty fields in Patch requests.
  4519. ForceSendFields []string `json:"-"`
  4520. // NullFields is a list of field names (e.g. "Breakdown") to include in
  4521. // API requests with the JSON null value. By default, fields with empty
  4522. // values are omitted from API requests. However, any field with an
  4523. // empty value appearing in NullFields will be sent to the server as
  4524. // null. It is an error if a field in this list has a non-empty value.
  4525. // This may be used to include null fields in Patch requests.
  4526. NullFields []string `json:"-"`
  4527. }
  4528. func (s *CrossDimensionReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  4529. type NoMethod CrossDimensionReachReportCompatibleFields
  4530. raw := NoMethod(*s)
  4531. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4532. }
  4533. // CustomFloodlightVariable: A custom floodlight variable.
  4534. type CustomFloodlightVariable struct {
  4535. // Kind: Identifies what kind of resource this is. Value: the fixed
  4536. // string "dfareporting#customFloodlightVariable".
  4537. Kind string `json:"kind,omitempty"`
  4538. // Type: The type of custom floodlight variable to supply a value for.
  4539. // These map to the "u[1-20]=" in the tags.
  4540. //
  4541. // Possible values:
  4542. // "U1"
  4543. // "U10"
  4544. // "U100"
  4545. // "U11"
  4546. // "U12"
  4547. // "U13"
  4548. // "U14"
  4549. // "U15"
  4550. // "U16"
  4551. // "U17"
  4552. // "U18"
  4553. // "U19"
  4554. // "U2"
  4555. // "U20"
  4556. // "U21"
  4557. // "U22"
  4558. // "U23"
  4559. // "U24"
  4560. // "U25"
  4561. // "U26"
  4562. // "U27"
  4563. // "U28"
  4564. // "U29"
  4565. // "U3"
  4566. // "U30"
  4567. // "U31"
  4568. // "U32"
  4569. // "U33"
  4570. // "U34"
  4571. // "U35"
  4572. // "U36"
  4573. // "U37"
  4574. // "U38"
  4575. // "U39"
  4576. // "U4"
  4577. // "U40"
  4578. // "U41"
  4579. // "U42"
  4580. // "U43"
  4581. // "U44"
  4582. // "U45"
  4583. // "U46"
  4584. // "U47"
  4585. // "U48"
  4586. // "U49"
  4587. // "U5"
  4588. // "U50"
  4589. // "U51"
  4590. // "U52"
  4591. // "U53"
  4592. // "U54"
  4593. // "U55"
  4594. // "U56"
  4595. // "U57"
  4596. // "U58"
  4597. // "U59"
  4598. // "U6"
  4599. // "U60"
  4600. // "U61"
  4601. // "U62"
  4602. // "U63"
  4603. // "U64"
  4604. // "U65"
  4605. // "U66"
  4606. // "U67"
  4607. // "U68"
  4608. // "U69"
  4609. // "U7"
  4610. // "U70"
  4611. // "U71"
  4612. // "U72"
  4613. // "U73"
  4614. // "U74"
  4615. // "U75"
  4616. // "U76"
  4617. // "U77"
  4618. // "U78"
  4619. // "U79"
  4620. // "U8"
  4621. // "U80"
  4622. // "U81"
  4623. // "U82"
  4624. // "U83"
  4625. // "U84"
  4626. // "U85"
  4627. // "U86"
  4628. // "U87"
  4629. // "U88"
  4630. // "U89"
  4631. // "U9"
  4632. // "U90"
  4633. // "U91"
  4634. // "U92"
  4635. // "U93"
  4636. // "U94"
  4637. // "U95"
  4638. // "U96"
  4639. // "U97"
  4640. // "U98"
  4641. // "U99"
  4642. Type string `json:"type,omitempty"`
  4643. // Value: The value of the custom floodlight variable. The length of
  4644. // string must not exceed 50 characters.
  4645. Value string `json:"value,omitempty"`
  4646. // ForceSendFields is a list of field names (e.g. "Kind") to
  4647. // unconditionally include in API requests. By default, fields with
  4648. // empty values are omitted from API requests. However, any non-pointer,
  4649. // non-interface field appearing in ForceSendFields will be sent to the
  4650. // server regardless of whether the field is empty or not. This may be
  4651. // used to include empty fields in Patch requests.
  4652. ForceSendFields []string `json:"-"`
  4653. // NullFields is a list of field names (e.g. "Kind") to include in API
  4654. // requests with the JSON null value. By default, fields with empty
  4655. // values are omitted from API requests. However, any field with an
  4656. // empty value appearing in NullFields will be sent to the server as
  4657. // null. It is an error if a field in this list has a non-empty value.
  4658. // This may be used to include null fields in Patch requests.
  4659. NullFields []string `json:"-"`
  4660. }
  4661. func (s *CustomFloodlightVariable) MarshalJSON() ([]byte, error) {
  4662. type NoMethod CustomFloodlightVariable
  4663. raw := NoMethod(*s)
  4664. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4665. }
  4666. // CustomRichMediaEvents: Represents a Custom Rich Media Events group.
  4667. type CustomRichMediaEvents struct {
  4668. // FilteredEventIds: List of custom rich media event IDs. Dimension
  4669. // values must be all of type dfa:richMediaEventTypeIdAndName.
  4670. FilteredEventIds []*DimensionValue `json:"filteredEventIds,omitempty"`
  4671. // Kind: The kind of resource this is, in this case
  4672. // dfareporting#customRichMediaEvents.
  4673. Kind string `json:"kind,omitempty"`
  4674. // ForceSendFields is a list of field names (e.g. "FilteredEventIds") to
  4675. // unconditionally include in API requests. By default, fields with
  4676. // empty values are omitted from API requests. However, any non-pointer,
  4677. // non-interface field appearing in ForceSendFields will be sent to the
  4678. // server regardless of whether the field is empty or not. This may be
  4679. // used to include empty fields in Patch requests.
  4680. ForceSendFields []string `json:"-"`
  4681. // NullFields is a list of field names (e.g. "FilteredEventIds") to
  4682. // include in API requests with the JSON null value. By default, fields
  4683. // with empty values are omitted from API requests. However, any field
  4684. // with an empty value appearing in NullFields will be sent to the
  4685. // server as null. It is an error if a field in this list has a
  4686. // non-empty value. This may be used to include null fields in Patch
  4687. // requests.
  4688. NullFields []string `json:"-"`
  4689. }
  4690. func (s *CustomRichMediaEvents) MarshalJSON() ([]byte, error) {
  4691. type NoMethod CustomRichMediaEvents
  4692. raw := NoMethod(*s)
  4693. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4694. }
  4695. // DateRange: Represents a date range.
  4696. type DateRange struct {
  4697. // EndDate: The end date of the date range, inclusive. A string of the
  4698. // format: "yyyy-MM-dd".
  4699. EndDate string `json:"endDate,omitempty"`
  4700. // Kind: The kind of resource this is, in this case
  4701. // dfareporting#dateRange.
  4702. Kind string `json:"kind,omitempty"`
  4703. // RelativeDateRange: The date range relative to the date of when the
  4704. // report is run.
  4705. //
  4706. // Possible values:
  4707. // "LAST_24_MONTHS"
  4708. // "LAST_30_DAYS"
  4709. // "LAST_365_DAYS"
  4710. // "LAST_7_DAYS"
  4711. // "LAST_90_DAYS"
  4712. // "MONTH_TO_DATE"
  4713. // "PREVIOUS_MONTH"
  4714. // "PREVIOUS_QUARTER"
  4715. // "PREVIOUS_WEEK"
  4716. // "PREVIOUS_YEAR"
  4717. // "QUARTER_TO_DATE"
  4718. // "TODAY"
  4719. // "WEEK_TO_DATE"
  4720. // "YEAR_TO_DATE"
  4721. // "YESTERDAY"
  4722. RelativeDateRange string `json:"relativeDateRange,omitempty"`
  4723. // StartDate: The start date of the date range, inclusive. A string of
  4724. // the format: "yyyy-MM-dd".
  4725. StartDate string `json:"startDate,omitempty"`
  4726. // ForceSendFields is a list of field names (e.g. "EndDate") to
  4727. // unconditionally include in API requests. By default, fields with
  4728. // empty values are omitted from API requests. However, any non-pointer,
  4729. // non-interface field appearing in ForceSendFields will be sent to the
  4730. // server regardless of whether the field is empty or not. This may be
  4731. // used to include empty fields in Patch requests.
  4732. ForceSendFields []string `json:"-"`
  4733. // NullFields is a list of field names (e.g. "EndDate") to include in
  4734. // API requests with the JSON null value. By default, fields with empty
  4735. // values are omitted from API requests. However, any field with an
  4736. // empty value appearing in NullFields will be sent to the server as
  4737. // null. It is an error if a field in this list has a non-empty value.
  4738. // This may be used to include null fields in Patch requests.
  4739. NullFields []string `json:"-"`
  4740. }
  4741. func (s *DateRange) MarshalJSON() ([]byte, error) {
  4742. type NoMethod DateRange
  4743. raw := NoMethod(*s)
  4744. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4745. }
  4746. // DayPartTargeting: Day Part Targeting.
  4747. type DayPartTargeting struct {
  4748. // DaysOfWeek: Days of the week when the ad will serve.
  4749. //
  4750. // Acceptable values are:
  4751. // - "SUNDAY"
  4752. // - "MONDAY"
  4753. // - "TUESDAY"
  4754. // - "WEDNESDAY"
  4755. // - "THURSDAY"
  4756. // - "FRIDAY"
  4757. // - "SATURDAY"
  4758. //
  4759. // Possible values:
  4760. // "FRIDAY"
  4761. // "MONDAY"
  4762. // "SATURDAY"
  4763. // "SUNDAY"
  4764. // "THURSDAY"
  4765. // "TUESDAY"
  4766. // "WEDNESDAY"
  4767. DaysOfWeek []string `json:"daysOfWeek,omitempty"`
  4768. // HoursOfDay: Hours of the day when the ad will serve, where 0 is
  4769. // midnight to 1 AM and 23 is 11 PM to midnight. Can be specified with
  4770. // days of week, in which case the ad would serve during these hours on
  4771. // the specified days. For example if Monday, Wednesday, Friday are the
  4772. // days of week specified and 9-10am, 3-5pm (hours 9, 15, and 16) is
  4773. // specified, the ad would serve Monday, Wednesdays, and Fridays at
  4774. // 9-10am and 3-5pm. Acceptable values are 0 to 23, inclusive.
  4775. HoursOfDay []int64 `json:"hoursOfDay,omitempty"`
  4776. // UserLocalTime: Whether or not to use the user's local time. If false,
  4777. // the America/New York time zone applies.
  4778. UserLocalTime bool `json:"userLocalTime,omitempty"`
  4779. // ForceSendFields is a list of field names (e.g. "DaysOfWeek") to
  4780. // unconditionally include in API requests. By default, fields with
  4781. // empty values are omitted from API requests. However, any non-pointer,
  4782. // non-interface field appearing in ForceSendFields will be sent to the
  4783. // server regardless of whether the field is empty or not. This may be
  4784. // used to include empty fields in Patch requests.
  4785. ForceSendFields []string `json:"-"`
  4786. // NullFields is a list of field names (e.g. "DaysOfWeek") to include in
  4787. // API requests with the JSON null value. By default, fields with empty
  4788. // values are omitted from API requests. However, any field with an
  4789. // empty value appearing in NullFields will be sent to the server as
  4790. // null. It is an error if a field in this list has a non-empty value.
  4791. // This may be used to include null fields in Patch requests.
  4792. NullFields []string `json:"-"`
  4793. }
  4794. func (s *DayPartTargeting) MarshalJSON() ([]byte, error) {
  4795. type NoMethod DayPartTargeting
  4796. raw := NoMethod(*s)
  4797. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4798. }
  4799. // DefaultClickThroughEventTagProperties: Properties of inheriting and
  4800. // overriding the default click-through event tag. A campaign may
  4801. // override the event tag defined at the advertiser level, and an ad may
  4802. // also override the campaign's setting further.
  4803. type DefaultClickThroughEventTagProperties struct {
  4804. // DefaultClickThroughEventTagId: ID of the click-through event tag to
  4805. // apply to all ads in this entity's scope.
  4806. DefaultClickThroughEventTagId int64 `json:"defaultClickThroughEventTagId,omitempty,string"`
  4807. // OverrideInheritedEventTag: Whether this entity should override the
  4808. // inherited default click-through event tag with its own defined value.
  4809. OverrideInheritedEventTag bool `json:"overrideInheritedEventTag,omitempty"`
  4810. // ForceSendFields is a list of field names (e.g.
  4811. // "DefaultClickThroughEventTagId") to unconditionally include in API
  4812. // requests. By default, fields with empty values are omitted from API
  4813. // requests. However, any non-pointer, non-interface field appearing in
  4814. // ForceSendFields will be sent to the server regardless of whether the
  4815. // field is empty or not. This may be used to include empty fields in
  4816. // Patch requests.
  4817. ForceSendFields []string `json:"-"`
  4818. // NullFields is a list of field names (e.g.
  4819. // "DefaultClickThroughEventTagId") to include in API requests with the
  4820. // JSON null value. By default, fields with empty values are omitted
  4821. // from API requests. However, any field with an empty value appearing
  4822. // in NullFields will be sent to the server as null. It is an error if a
  4823. // field in this list has a non-empty value. This may be used to include
  4824. // null fields in Patch requests.
  4825. NullFields []string `json:"-"`
  4826. }
  4827. func (s *DefaultClickThroughEventTagProperties) MarshalJSON() ([]byte, error) {
  4828. type NoMethod DefaultClickThroughEventTagProperties
  4829. raw := NoMethod(*s)
  4830. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4831. }
  4832. // DeliverySchedule: Delivery Schedule.
  4833. type DeliverySchedule struct {
  4834. // FrequencyCap: Limit on the number of times an individual user can be
  4835. // served the ad within a specified period of time.
  4836. FrequencyCap *FrequencyCap `json:"frequencyCap,omitempty"`
  4837. // HardCutoff: Whether or not hard cutoff is enabled. If true, the ad
  4838. // will not serve after the end date and time. Otherwise the ad will
  4839. // continue to be served until it has reached its delivery goals.
  4840. HardCutoff bool `json:"hardCutoff,omitempty"`
  4841. // ImpressionRatio: Impression ratio for this ad. This ratio determines
  4842. // how often each ad is served relative to the others. For example, if
  4843. // ad A has an impression ratio of 1 and ad B has an impression ratio of
  4844. // 3, then DCM will serve ad B three times as often as ad A. Acceptable
  4845. // values are 1 to 10, inclusive.
  4846. ImpressionRatio int64 `json:"impressionRatio,omitempty,string"`
  4847. // Priority: Serving priority of an ad, with respect to other ads. The
  4848. // lower the priority number, the greater the priority with which it is
  4849. // served.
  4850. //
  4851. // Possible values:
  4852. // "AD_PRIORITY_01"
  4853. // "AD_PRIORITY_02"
  4854. // "AD_PRIORITY_03"
  4855. // "AD_PRIORITY_04"
  4856. // "AD_PRIORITY_05"
  4857. // "AD_PRIORITY_06"
  4858. // "AD_PRIORITY_07"
  4859. // "AD_PRIORITY_08"
  4860. // "AD_PRIORITY_09"
  4861. // "AD_PRIORITY_10"
  4862. // "AD_PRIORITY_11"
  4863. // "AD_PRIORITY_12"
  4864. // "AD_PRIORITY_13"
  4865. // "AD_PRIORITY_14"
  4866. // "AD_PRIORITY_15"
  4867. // "AD_PRIORITY_16"
  4868. Priority string `json:"priority,omitempty"`
  4869. // ForceSendFields is a list of field names (e.g. "FrequencyCap") to
  4870. // unconditionally include in API requests. By default, fields with
  4871. // empty values are omitted from API requests. However, any non-pointer,
  4872. // non-interface field appearing in ForceSendFields will be sent to the
  4873. // server regardless of whether the field is empty or not. This may be
  4874. // used to include empty fields in Patch requests.
  4875. ForceSendFields []string `json:"-"`
  4876. // NullFields is a list of field names (e.g. "FrequencyCap") to include
  4877. // in API requests with the JSON null value. By default, fields with
  4878. // empty values are omitted from API requests. However, any field with
  4879. // an empty value appearing in NullFields will be sent to the server as
  4880. // null. It is an error if a field in this list has a non-empty value.
  4881. // This may be used to include null fields in Patch requests.
  4882. NullFields []string `json:"-"`
  4883. }
  4884. func (s *DeliverySchedule) MarshalJSON() ([]byte, error) {
  4885. type NoMethod DeliverySchedule
  4886. raw := NoMethod(*s)
  4887. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4888. }
  4889. // DfpSettings: DFP Settings
  4890. type DfpSettings struct {
  4891. // DfpNetworkCode: DFP network code for this directory site.
  4892. DfpNetworkCode string `json:"dfp_network_code,omitempty"`
  4893. // DfpNetworkName: DFP network name for this directory site.
  4894. DfpNetworkName string `json:"dfp_network_name,omitempty"`
  4895. // ProgrammaticPlacementAccepted: Whether this directory site accepts
  4896. // programmatic placements.
  4897. ProgrammaticPlacementAccepted bool `json:"programmaticPlacementAccepted,omitempty"`
  4898. // PubPaidPlacementAccepted: Whether this directory site accepts
  4899. // publisher-paid tags.
  4900. PubPaidPlacementAccepted bool `json:"pubPaidPlacementAccepted,omitempty"`
  4901. // PublisherPortalOnly: Whether this directory site is available only
  4902. // via DoubleClick Publisher Portal.
  4903. PublisherPortalOnly bool `json:"publisherPortalOnly,omitempty"`
  4904. // ForceSendFields is a list of field names (e.g. "DfpNetworkCode") to
  4905. // unconditionally include in API requests. By default, fields with
  4906. // empty values are omitted from API requests. However, any non-pointer,
  4907. // non-interface field appearing in ForceSendFields will be sent to the
  4908. // server regardless of whether the field is empty or not. This may be
  4909. // used to include empty fields in Patch requests.
  4910. ForceSendFields []string `json:"-"`
  4911. // NullFields is a list of field names (e.g. "DfpNetworkCode") to
  4912. // include in API requests with the JSON null value. By default, fields
  4913. // with empty values are omitted from API requests. However, any field
  4914. // with an empty value appearing in NullFields will be sent to the
  4915. // server as null. It is an error if a field in this list has a
  4916. // non-empty value. This may be used to include null fields in Patch
  4917. // requests.
  4918. NullFields []string `json:"-"`
  4919. }
  4920. func (s *DfpSettings) MarshalJSON() ([]byte, error) {
  4921. type NoMethod DfpSettings
  4922. raw := NoMethod(*s)
  4923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4924. }
  4925. // Dimension: Represents a dimension.
  4926. type Dimension struct {
  4927. // Kind: The kind of resource this is, in this case
  4928. // dfareporting#dimension.
  4929. Kind string `json:"kind,omitempty"`
  4930. // Name: The dimension name, e.g. dfa:advertiser
  4931. Name string `json:"name,omitempty"`
  4932. // ForceSendFields is a list of field names (e.g. "Kind") to
  4933. // unconditionally include in API requests. By default, fields with
  4934. // empty values are omitted from API requests. However, any non-pointer,
  4935. // non-interface field appearing in ForceSendFields will be sent to the
  4936. // server regardless of whether the field is empty or not. This may be
  4937. // used to include empty fields in Patch requests.
  4938. ForceSendFields []string `json:"-"`
  4939. // NullFields is a list of field names (e.g. "Kind") to include in API
  4940. // requests with the JSON null value. By default, fields with empty
  4941. // values are omitted from API requests. However, any field with an
  4942. // empty value appearing in NullFields will be sent to the server as
  4943. // null. It is an error if a field in this list has a non-empty value.
  4944. // This may be used to include null fields in Patch requests.
  4945. NullFields []string `json:"-"`
  4946. }
  4947. func (s *Dimension) MarshalJSON() ([]byte, error) {
  4948. type NoMethod Dimension
  4949. raw := NoMethod(*s)
  4950. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4951. }
  4952. // DimensionFilter: Represents a dimension filter.
  4953. type DimensionFilter struct {
  4954. // DimensionName: The name of the dimension to filter.
  4955. DimensionName string `json:"dimensionName,omitempty"`
  4956. // Kind: The kind of resource this is, in this case
  4957. // dfareporting#dimensionFilter.
  4958. Kind string `json:"kind,omitempty"`
  4959. // Value: The value of the dimension to filter.
  4960. Value string `json:"value,omitempty"`
  4961. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  4962. // unconditionally include in API requests. By default, fields with
  4963. // empty values are omitted from API requests. However, any non-pointer,
  4964. // non-interface field appearing in ForceSendFields will be sent to the
  4965. // server regardless of whether the field is empty or not. This may be
  4966. // used to include empty fields in Patch requests.
  4967. ForceSendFields []string `json:"-"`
  4968. // NullFields is a list of field names (e.g. "DimensionName") to include
  4969. // in API requests with the JSON null value. By default, fields with
  4970. // empty values are omitted from API requests. However, any field with
  4971. // an empty value appearing in NullFields will be sent to the server as
  4972. // null. It is an error if a field in this list has a non-empty value.
  4973. // This may be used to include null fields in Patch requests.
  4974. NullFields []string `json:"-"`
  4975. }
  4976. func (s *DimensionFilter) MarshalJSON() ([]byte, error) {
  4977. type NoMethod DimensionFilter
  4978. raw := NoMethod(*s)
  4979. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  4980. }
  4981. // DimensionValue: Represents a DimensionValue resource.
  4982. type DimensionValue struct {
  4983. // DimensionName: The name of the dimension.
  4984. DimensionName string `json:"dimensionName,omitempty"`
  4985. // Etag: The eTag of this response for caching purposes.
  4986. Etag string `json:"etag,omitempty"`
  4987. // Id: The ID associated with the value if available.
  4988. Id string `json:"id,omitempty"`
  4989. // Kind: The kind of resource this is, in this case
  4990. // dfareporting#dimensionValue.
  4991. Kind string `json:"kind,omitempty"`
  4992. // MatchType: Determines how the 'value' field is matched when
  4993. // filtering. If not specified, defaults to EXACT. If set to
  4994. // WILDCARD_EXPRESSION, '*' is allowed as a placeholder for variable
  4995. // length character sequences, and it can be escaped with a backslash.
  4996. // Note, only paid search dimensions ('dfa:paidSearch*') allow a
  4997. // matchType other than EXACT.
  4998. //
  4999. // Possible values:
  5000. // "BEGINS_WITH"
  5001. // "CONTAINS"
  5002. // "EXACT"
  5003. // "WILDCARD_EXPRESSION"
  5004. MatchType string `json:"matchType,omitempty"`
  5005. // Value: The value of the dimension.
  5006. Value string `json:"value,omitempty"`
  5007. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5008. // unconditionally include in API requests. By default, fields with
  5009. // empty values are omitted from API requests. However, any non-pointer,
  5010. // non-interface field appearing in ForceSendFields will be sent to the
  5011. // server regardless of whether the field is empty or not. This may be
  5012. // used to include empty fields in Patch requests.
  5013. ForceSendFields []string `json:"-"`
  5014. // NullFields is a list of field names (e.g. "DimensionName") to include
  5015. // in API requests with the JSON null value. By default, fields with
  5016. // empty values are omitted from API requests. However, any field with
  5017. // an empty value appearing in NullFields will be sent to the server as
  5018. // null. It is an error if a field in this list has a non-empty value.
  5019. // This may be used to include null fields in Patch requests.
  5020. NullFields []string `json:"-"`
  5021. }
  5022. func (s *DimensionValue) MarshalJSON() ([]byte, error) {
  5023. type NoMethod DimensionValue
  5024. raw := NoMethod(*s)
  5025. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5026. }
  5027. // DimensionValueList: Represents the list of DimensionValue resources.
  5028. type DimensionValueList struct {
  5029. // Etag: The eTag of this response for caching purposes.
  5030. Etag string `json:"etag,omitempty"`
  5031. // Items: The dimension values returned in this response.
  5032. Items []*DimensionValue `json:"items,omitempty"`
  5033. // Kind: The kind of list this is, in this case
  5034. // dfareporting#dimensionValueList.
  5035. Kind string `json:"kind,omitempty"`
  5036. // NextPageToken: Continuation token used to page through dimension
  5037. // values. To retrieve the next page of results, set the next request's
  5038. // "pageToken" to the value of this field. The page token is only valid
  5039. // for a limited amount of time and should not be persisted.
  5040. NextPageToken string `json:"nextPageToken,omitempty"`
  5041. // ServerResponse contains the HTTP response code and headers from the
  5042. // server.
  5043. googleapi.ServerResponse `json:"-"`
  5044. // ForceSendFields is a list of field names (e.g. "Etag") to
  5045. // unconditionally include in API requests. By default, fields with
  5046. // empty values are omitted from API requests. However, any non-pointer,
  5047. // non-interface field appearing in ForceSendFields will be sent to the
  5048. // server regardless of whether the field is empty or not. This may be
  5049. // used to include empty fields in Patch requests.
  5050. ForceSendFields []string `json:"-"`
  5051. // NullFields is a list of field names (e.g. "Etag") to include in API
  5052. // requests with the JSON null value. By default, fields with empty
  5053. // values are omitted from API requests. However, any field with an
  5054. // empty value appearing in NullFields will be sent to the server as
  5055. // null. It is an error if a field in this list has a non-empty value.
  5056. // This may be used to include null fields in Patch requests.
  5057. NullFields []string `json:"-"`
  5058. }
  5059. func (s *DimensionValueList) MarshalJSON() ([]byte, error) {
  5060. type NoMethod DimensionValueList
  5061. raw := NoMethod(*s)
  5062. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5063. }
  5064. // DimensionValueRequest: Represents a DimensionValuesRequest.
  5065. type DimensionValueRequest struct {
  5066. // DimensionName: The name of the dimension for which values should be
  5067. // requested.
  5068. DimensionName string `json:"dimensionName,omitempty"`
  5069. // EndDate: The end date of the date range for which to retrieve
  5070. // dimension values. A string of the format "yyyy-MM-dd".
  5071. EndDate string `json:"endDate,omitempty"`
  5072. // Filters: The list of filters by which to filter values. The filters
  5073. // are ANDed.
  5074. Filters []*DimensionFilter `json:"filters,omitempty"`
  5075. // Kind: The kind of request this is, in this case
  5076. // dfareporting#dimensionValueRequest.
  5077. Kind string `json:"kind,omitempty"`
  5078. // StartDate: The start date of the date range for which to retrieve
  5079. // dimension values. A string of the format "yyyy-MM-dd".
  5080. StartDate string `json:"startDate,omitempty"`
  5081. // ForceSendFields is a list of field names (e.g. "DimensionName") to
  5082. // unconditionally include in API requests. By default, fields with
  5083. // empty values are omitted from API requests. However, any non-pointer,
  5084. // non-interface field appearing in ForceSendFields will be sent to the
  5085. // server regardless of whether the field is empty or not. This may be
  5086. // used to include empty fields in Patch requests.
  5087. ForceSendFields []string `json:"-"`
  5088. // NullFields is a list of field names (e.g. "DimensionName") to include
  5089. // in API requests with the JSON null value. By default, fields with
  5090. // empty values are omitted from API requests. However, any field with
  5091. // an empty value appearing in NullFields will be sent to the server as
  5092. // null. It is an error if a field in this list has a non-empty value.
  5093. // This may be used to include null fields in Patch requests.
  5094. NullFields []string `json:"-"`
  5095. }
  5096. func (s *DimensionValueRequest) MarshalJSON() ([]byte, error) {
  5097. type NoMethod DimensionValueRequest
  5098. raw := NoMethod(*s)
  5099. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5100. }
  5101. // DirectorySite: DirectorySites contains properties of a website from
  5102. // the Site Directory. Sites need to be added to an account via the
  5103. // Sites resource before they can be assigned to a placement.
  5104. type DirectorySite struct {
  5105. // Active: Whether this directory site is active.
  5106. Active bool `json:"active,omitempty"`
  5107. // ContactAssignments: Directory site contacts.
  5108. ContactAssignments []*DirectorySiteContactAssignment `json:"contactAssignments,omitempty"`
  5109. // CountryId: Country ID of this directory site. This is a read-only
  5110. // field.
  5111. CountryId int64 `json:"countryId,omitempty,string"`
  5112. // CurrencyId: Currency ID of this directory site. This is a read-only
  5113. // field.
  5114. // Possible values are:
  5115. // - "1" for USD
  5116. // - "2" for GBP
  5117. // - "3" for ESP
  5118. // - "4" for SEK
  5119. // - "5" for CAD
  5120. // - "6" for JPY
  5121. // - "7" for DEM
  5122. // - "8" for AUD
  5123. // - "9" for FRF
  5124. // - "10" for ITL
  5125. // - "11" for DKK
  5126. // - "12" for NOK
  5127. // - "13" for FIM
  5128. // - "14" for ZAR
  5129. // - "15" for IEP
  5130. // - "16" for NLG
  5131. // - "17" for EUR
  5132. // - "18" for KRW
  5133. // - "19" for TWD
  5134. // - "20" for SGD
  5135. // - "21" for CNY
  5136. // - "22" for HKD
  5137. // - "23" for NZD
  5138. // - "24" for MYR
  5139. // - "25" for BRL
  5140. // - "26" for PTE
  5141. // - "27" for MXP
  5142. // - "28" for CLP
  5143. // - "29" for TRY
  5144. // - "30" for ARS
  5145. // - "31" for PEN
  5146. // - "32" for ILS
  5147. // - "33" for CHF
  5148. // - "34" for VEF
  5149. // - "35" for COP
  5150. // - "36" for GTQ
  5151. // - "37" for PLN
  5152. // - "39" for INR
  5153. // - "40" for THB
  5154. // - "41" for IDR
  5155. // - "42" for CZK
  5156. // - "43" for RON
  5157. // - "44" for HUF
  5158. // - "45" for RUB
  5159. // - "46" for AED
  5160. // - "47" for BGN
  5161. // - "48" for HRK
  5162. // - "49" for MXN
  5163. // - "50" for NGN
  5164. CurrencyId int64 `json:"currencyId,omitempty,string"`
  5165. // Description: Description of this directory site. This is a read-only
  5166. // field.
  5167. Description string `json:"description,omitempty"`
  5168. // Id: ID of this directory site. This is a read-only, auto-generated
  5169. // field.
  5170. Id int64 `json:"id,omitempty,string"`
  5171. // IdDimensionValue: Dimension value for the ID of this directory site.
  5172. // This is a read-only, auto-generated field.
  5173. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  5174. // InpageTagFormats: Tag types for regular placements.
  5175. //
  5176. // Acceptable values are:
  5177. // - "STANDARD"
  5178. // - "IFRAME_JAVASCRIPT_INPAGE"
  5179. // - "INTERNAL_REDIRECT_INPAGE"
  5180. // - "JAVASCRIPT_INPAGE"
  5181. //
  5182. // Possible values:
  5183. // "IFRAME_JAVASCRIPT_INPAGE"
  5184. // "INTERNAL_REDIRECT_INPAGE"
  5185. // "JAVASCRIPT_INPAGE"
  5186. // "STANDARD"
  5187. InpageTagFormats []string `json:"inpageTagFormats,omitempty"`
  5188. // InterstitialTagFormats: Tag types for interstitial
  5189. // placements.
  5190. //
  5191. // Acceptable values are:
  5192. // - "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5193. // - "INTERNAL_REDIRECT_INTERSTITIAL"
  5194. // - "JAVASCRIPT_INTERSTITIAL"
  5195. //
  5196. // Possible values:
  5197. // "IFRAME_JAVASCRIPT_INTERSTITIAL"
  5198. // "INTERNAL_REDIRECT_INTERSTITIAL"
  5199. // "JAVASCRIPT_INTERSTITIAL"
  5200. InterstitialTagFormats []string `json:"interstitialTagFormats,omitempty"`
  5201. // Kind: Identifies what kind of resource this is. Value: the fixed
  5202. // string "dfareporting#directorySite".
  5203. Kind string `json:"kind,omitempty"`
  5204. // Name: Name of this directory site.
  5205. Name string `json:"name,omitempty"`
  5206. // ParentId: Parent directory site ID.
  5207. ParentId int64 `json:"parentId,omitempty,string"`
  5208. // Settings: Directory site settings.
  5209. Settings *DirectorySiteSettings `json:"settings,omitempty"`
  5210. // Url: URL of this directory site.
  5211. Url string `json:"url,omitempty"`
  5212. // ServerResponse contains the HTTP response code and headers from the
  5213. // server.
  5214. googleapi.ServerResponse `json:"-"`
  5215. // ForceSendFields is a list of field names (e.g. "Active") to
  5216. // unconditionally include in API requests. By default, fields with
  5217. // empty values are omitted from API requests. However, any non-pointer,
  5218. // non-interface field appearing in ForceSendFields will be sent to the
  5219. // server regardless of whether the field is empty or not. This may be
  5220. // used to include empty fields in Patch requests.
  5221. ForceSendFields []string `json:"-"`
  5222. // NullFields is a list of field names (e.g. "Active") to include in API
  5223. // requests with the JSON null value. By default, fields with empty
  5224. // values are omitted from API requests. However, any field with an
  5225. // empty value appearing in NullFields will be sent to the server as
  5226. // null. It is an error if a field in this list has a non-empty value.
  5227. // This may be used to include null fields in Patch requests.
  5228. NullFields []string `json:"-"`
  5229. }
  5230. func (s *DirectorySite) MarshalJSON() ([]byte, error) {
  5231. type NoMethod DirectorySite
  5232. raw := NoMethod(*s)
  5233. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5234. }
  5235. // DirectorySiteContact: Contains properties of a Site Directory
  5236. // contact.
  5237. type DirectorySiteContact struct {
  5238. // Address: Address of this directory site contact.
  5239. Address string `json:"address,omitempty"`
  5240. // Email: Email address of this directory site contact.
  5241. Email string `json:"email,omitempty"`
  5242. // FirstName: First name of this directory site contact.
  5243. FirstName string `json:"firstName,omitempty"`
  5244. // Id: ID of this directory site contact. This is a read-only,
  5245. // auto-generated field.
  5246. Id int64 `json:"id,omitempty,string"`
  5247. // Kind: Identifies what kind of resource this is. Value: the fixed
  5248. // string "dfareporting#directorySiteContact".
  5249. Kind string `json:"kind,omitempty"`
  5250. // LastName: Last name of this directory site contact.
  5251. LastName string `json:"lastName,omitempty"`
  5252. // Phone: Phone number of this directory site contact.
  5253. Phone string `json:"phone,omitempty"`
  5254. // Role: Directory site contact role.
  5255. //
  5256. // Possible values:
  5257. // "ADMIN"
  5258. // "EDIT"
  5259. // "VIEW"
  5260. Role string `json:"role,omitempty"`
  5261. // Title: Title or designation of this directory site contact.
  5262. Title string `json:"title,omitempty"`
  5263. // Type: Directory site contact type.
  5264. //
  5265. // Possible values:
  5266. // "BILLING"
  5267. // "OTHER"
  5268. // "SALES"
  5269. // "TECHNICAL"
  5270. Type string `json:"type,omitempty"`
  5271. // ServerResponse contains the HTTP response code and headers from the
  5272. // server.
  5273. googleapi.ServerResponse `json:"-"`
  5274. // ForceSendFields is a list of field names (e.g. "Address") to
  5275. // unconditionally include in API requests. By default, fields with
  5276. // empty values are omitted from API requests. However, any non-pointer,
  5277. // non-interface field appearing in ForceSendFields will be sent to the
  5278. // server regardless of whether the field is empty or not. This may be
  5279. // used to include empty fields in Patch requests.
  5280. ForceSendFields []string `json:"-"`
  5281. // NullFields is a list of field names (e.g. "Address") to include in
  5282. // API requests with the JSON null value. By default, fields with empty
  5283. // values are omitted from API requests. However, any field with an
  5284. // empty value appearing in NullFields will be sent to the server as
  5285. // null. It is an error if a field in this list has a non-empty value.
  5286. // This may be used to include null fields in Patch requests.
  5287. NullFields []string `json:"-"`
  5288. }
  5289. func (s *DirectorySiteContact) MarshalJSON() ([]byte, error) {
  5290. type NoMethod DirectorySiteContact
  5291. raw := NoMethod(*s)
  5292. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5293. }
  5294. // DirectorySiteContactAssignment: Directory Site Contact Assignment
  5295. type DirectorySiteContactAssignment struct {
  5296. // ContactId: ID of this directory site contact. This is a read-only,
  5297. // auto-generated field.
  5298. ContactId int64 `json:"contactId,omitempty,string"`
  5299. // Visibility: Visibility of this directory site contact assignment.
  5300. // When set to PUBLIC this contact assignment is visible to all account
  5301. // and agency users; when set to PRIVATE it is visible only to the site.
  5302. //
  5303. // Possible values:
  5304. // "PRIVATE"
  5305. // "PUBLIC"
  5306. Visibility string `json:"visibility,omitempty"`
  5307. // ForceSendFields is a list of field names (e.g. "ContactId") to
  5308. // unconditionally include in API requests. By default, fields with
  5309. // empty values are omitted from API requests. However, any non-pointer,
  5310. // non-interface field appearing in ForceSendFields will be sent to the
  5311. // server regardless of whether the field is empty or not. This may be
  5312. // used to include empty fields in Patch requests.
  5313. ForceSendFields []string `json:"-"`
  5314. // NullFields is a list of field names (e.g. "ContactId") to include in
  5315. // API requests with the JSON null value. By default, fields with empty
  5316. // values are omitted from API requests. However, any field with an
  5317. // empty value appearing in NullFields will be sent to the server as
  5318. // null. It is an error if a field in this list has a non-empty value.
  5319. // This may be used to include null fields in Patch requests.
  5320. NullFields []string `json:"-"`
  5321. }
  5322. func (s *DirectorySiteContactAssignment) MarshalJSON() ([]byte, error) {
  5323. type NoMethod DirectorySiteContactAssignment
  5324. raw := NoMethod(*s)
  5325. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5326. }
  5327. // DirectorySiteContactsListResponse: Directory Site Contact List
  5328. // Response
  5329. type DirectorySiteContactsListResponse struct {
  5330. // DirectorySiteContacts: Directory site contact collection
  5331. DirectorySiteContacts []*DirectorySiteContact `json:"directorySiteContacts,omitempty"`
  5332. // Kind: Identifies what kind of resource this is. Value: the fixed
  5333. // string "dfareporting#directorySiteContactsListResponse".
  5334. Kind string `json:"kind,omitempty"`
  5335. // NextPageToken: Pagination token to be used for the next list
  5336. // operation.
  5337. NextPageToken string `json:"nextPageToken,omitempty"`
  5338. // ServerResponse contains the HTTP response code and headers from the
  5339. // server.
  5340. googleapi.ServerResponse `json:"-"`
  5341. // ForceSendFields is a list of field names (e.g.
  5342. // "DirectorySiteContacts") to unconditionally include in API requests.
  5343. // By default, fields with empty values are omitted from API requests.
  5344. // However, any non-pointer, non-interface field appearing in
  5345. // ForceSendFields will be sent to the server regardless of whether the
  5346. // field is empty or not. This may be used to include empty fields in
  5347. // Patch requests.
  5348. ForceSendFields []string `json:"-"`
  5349. // NullFields is a list of field names (e.g. "DirectorySiteContacts") to
  5350. // include in API requests with the JSON null value. By default, fields
  5351. // with empty values are omitted from API requests. However, any field
  5352. // with an empty value appearing in NullFields will be sent to the
  5353. // server as null. It is an error if a field in this list has a
  5354. // non-empty value. This may be used to include null fields in Patch
  5355. // requests.
  5356. NullFields []string `json:"-"`
  5357. }
  5358. func (s *DirectorySiteContactsListResponse) MarshalJSON() ([]byte, error) {
  5359. type NoMethod DirectorySiteContactsListResponse
  5360. raw := NoMethod(*s)
  5361. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5362. }
  5363. // DirectorySiteSettings: Directory Site Settings
  5364. type DirectorySiteSettings struct {
  5365. // ActiveViewOptOut: Whether this directory site has disabled active
  5366. // view creatives.
  5367. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  5368. // DfpSettings: Directory site DFP settings.
  5369. DfpSettings *DfpSettings `json:"dfp_settings,omitempty"`
  5370. // InstreamVideoPlacementAccepted: Whether this site accepts in-stream
  5371. // video ads.
  5372. InstreamVideoPlacementAccepted bool `json:"instream_video_placement_accepted,omitempty"`
  5373. // InterstitialPlacementAccepted: Whether this site accepts interstitial
  5374. // ads.
  5375. InterstitialPlacementAccepted bool `json:"interstitialPlacementAccepted,omitempty"`
  5376. // NielsenOcrOptOut: Whether this directory site has disabled Nielsen
  5377. // OCR reach ratings.
  5378. NielsenOcrOptOut bool `json:"nielsenOcrOptOut,omitempty"`
  5379. // VerificationTagOptOut: Whether this directory site has disabled
  5380. // generation of Verification ins tags.
  5381. VerificationTagOptOut bool `json:"verificationTagOptOut,omitempty"`
  5382. // VideoActiveViewOptOut: Whether this directory site has disabled
  5383. // active view for in-stream video creatives. This is a read-only field.
  5384. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  5385. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  5386. // unconditionally include in API requests. By default, fields with
  5387. // empty values are omitted from API requests. However, any non-pointer,
  5388. // non-interface field appearing in ForceSendFields will be sent to the
  5389. // server regardless of whether the field is empty or not. This may be
  5390. // used to include empty fields in Patch requests.
  5391. ForceSendFields []string `json:"-"`
  5392. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  5393. // include in API requests with the JSON null value. By default, fields
  5394. // with empty values are omitted from API requests. However, any field
  5395. // with an empty value appearing in NullFields will be sent to the
  5396. // server as null. It is an error if a field in this list has a
  5397. // non-empty value. This may be used to include null fields in Patch
  5398. // requests.
  5399. NullFields []string `json:"-"`
  5400. }
  5401. func (s *DirectorySiteSettings) MarshalJSON() ([]byte, error) {
  5402. type NoMethod DirectorySiteSettings
  5403. raw := NoMethod(*s)
  5404. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5405. }
  5406. // DirectorySitesListResponse: Directory Site List Response
  5407. type DirectorySitesListResponse struct {
  5408. // DirectorySites: Directory site collection.
  5409. DirectorySites []*DirectorySite `json:"directorySites,omitempty"`
  5410. // Kind: Identifies what kind of resource this is. Value: the fixed
  5411. // string "dfareporting#directorySitesListResponse".
  5412. Kind string `json:"kind,omitempty"`
  5413. // NextPageToken: Pagination token to be used for the next list
  5414. // operation.
  5415. NextPageToken string `json:"nextPageToken,omitempty"`
  5416. // ServerResponse contains the HTTP response code and headers from the
  5417. // server.
  5418. googleapi.ServerResponse `json:"-"`
  5419. // ForceSendFields is a list of field names (e.g. "DirectorySites") to
  5420. // unconditionally include in API requests. By default, fields with
  5421. // empty values are omitted from API requests. However, any non-pointer,
  5422. // non-interface field appearing in ForceSendFields will be sent to the
  5423. // server regardless of whether the field is empty or not. This may be
  5424. // used to include empty fields in Patch requests.
  5425. ForceSendFields []string `json:"-"`
  5426. // NullFields is a list of field names (e.g. "DirectorySites") to
  5427. // include in API requests with the JSON null value. By default, fields
  5428. // with empty values are omitted from API requests. However, any field
  5429. // with an empty value appearing in NullFields will be sent to the
  5430. // server as null. It is an error if a field in this list has a
  5431. // non-empty value. This may be used to include null fields in Patch
  5432. // requests.
  5433. NullFields []string `json:"-"`
  5434. }
  5435. func (s *DirectorySitesListResponse) MarshalJSON() ([]byte, error) {
  5436. type NoMethod DirectorySitesListResponse
  5437. raw := NoMethod(*s)
  5438. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5439. }
  5440. // DynamicTargetingKey: Contains properties of a dynamic targeting key.
  5441. // Dynamic targeting keys are unique, user-friendly labels, created at
  5442. // the advertiser level in DCM, that can be assigned to ads, creatives,
  5443. // and placements and used for targeting with DoubleClick Studio dynamic
  5444. // creatives. Use these labels instead of numeric DCM IDs (such as
  5445. // placement IDs) to save time and avoid errors in your dynamic feeds.
  5446. type DynamicTargetingKey struct {
  5447. // Kind: Identifies what kind of resource this is. Value: the fixed
  5448. // string "dfareporting#dynamicTargetingKey".
  5449. Kind string `json:"kind,omitempty"`
  5450. // Name: Name of this dynamic targeting key. This is a required field.
  5451. // Must be less than 256 characters long and cannot contain commas. All
  5452. // characters are converted to lowercase.
  5453. Name string `json:"name,omitempty"`
  5454. // ObjectId: ID of the object of this dynamic targeting key. This is a
  5455. // required field.
  5456. ObjectId int64 `json:"objectId,omitempty,string"`
  5457. // ObjectType: Type of the object of this dynamic targeting key. This is
  5458. // a required field.
  5459. //
  5460. // Possible values:
  5461. // "OBJECT_AD"
  5462. // "OBJECT_ADVERTISER"
  5463. // "OBJECT_CREATIVE"
  5464. // "OBJECT_PLACEMENT"
  5465. ObjectType string `json:"objectType,omitempty"`
  5466. // ServerResponse contains the HTTP response code and headers from the
  5467. // server.
  5468. googleapi.ServerResponse `json:"-"`
  5469. // ForceSendFields is a list of field names (e.g. "Kind") to
  5470. // unconditionally include in API requests. By default, fields with
  5471. // empty values are omitted from API requests. However, any non-pointer,
  5472. // non-interface field appearing in ForceSendFields will be sent to the
  5473. // server regardless of whether the field is empty or not. This may be
  5474. // used to include empty fields in Patch requests.
  5475. ForceSendFields []string `json:"-"`
  5476. // NullFields is a list of field names (e.g. "Kind") to include in API
  5477. // requests with the JSON null value. By default, fields with empty
  5478. // values are omitted from API requests. However, any field with an
  5479. // empty value appearing in NullFields will be sent to the server as
  5480. // null. It is an error if a field in this list has a non-empty value.
  5481. // This may be used to include null fields in Patch requests.
  5482. NullFields []string `json:"-"`
  5483. }
  5484. func (s *DynamicTargetingKey) MarshalJSON() ([]byte, error) {
  5485. type NoMethod DynamicTargetingKey
  5486. raw := NoMethod(*s)
  5487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5488. }
  5489. // DynamicTargetingKeysListResponse: Dynamic Targeting Key List Response
  5490. type DynamicTargetingKeysListResponse struct {
  5491. // DynamicTargetingKeys: Dynamic targeting key collection.
  5492. DynamicTargetingKeys []*DynamicTargetingKey `json:"dynamicTargetingKeys,omitempty"`
  5493. // Kind: Identifies what kind of resource this is. Value: the fixed
  5494. // string "dfareporting#dynamicTargetingKeysListResponse".
  5495. Kind string `json:"kind,omitempty"`
  5496. // ServerResponse contains the HTTP response code and headers from the
  5497. // server.
  5498. googleapi.ServerResponse `json:"-"`
  5499. // ForceSendFields is a list of field names (e.g.
  5500. // "DynamicTargetingKeys") to unconditionally include in API requests.
  5501. // By default, fields with empty values are omitted from API requests.
  5502. // However, any non-pointer, non-interface field appearing in
  5503. // ForceSendFields will be sent to the server regardless of whether the
  5504. // field is empty or not. This may be used to include empty fields in
  5505. // Patch requests.
  5506. ForceSendFields []string `json:"-"`
  5507. // NullFields is a list of field names (e.g. "DynamicTargetingKeys") to
  5508. // include in API requests with the JSON null value. By default, fields
  5509. // with empty values are omitted from API requests. However, any field
  5510. // with an empty value appearing in NullFields will be sent to the
  5511. // server as null. It is an error if a field in this list has a
  5512. // non-empty value. This may be used to include null fields in Patch
  5513. // requests.
  5514. NullFields []string `json:"-"`
  5515. }
  5516. func (s *DynamicTargetingKeysListResponse) MarshalJSON() ([]byte, error) {
  5517. type NoMethod DynamicTargetingKeysListResponse
  5518. raw := NoMethod(*s)
  5519. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5520. }
  5521. // EncryptionInfo: A description of how user IDs are encrypted.
  5522. type EncryptionInfo struct {
  5523. // EncryptionEntityId: The encryption entity ID. This should match the
  5524. // encryption configuration for ad serving or Data Transfer.
  5525. EncryptionEntityId int64 `json:"encryptionEntityId,omitempty,string"`
  5526. // EncryptionEntityType: The encryption entity type. This should match
  5527. // the encryption configuration for ad serving or Data Transfer.
  5528. //
  5529. // Possible values:
  5530. // "ADWORDS_CUSTOMER"
  5531. // "DBM_ADVERTISER"
  5532. // "DBM_PARTNER"
  5533. // "DCM_ACCOUNT"
  5534. // "DCM_ADVERTISER"
  5535. // "ENCRYPTION_ENTITY_TYPE_UNKNOWN"
  5536. EncryptionEntityType string `json:"encryptionEntityType,omitempty"`
  5537. // EncryptionSource: Describes whether the encrypted cookie was received
  5538. // from ad serving (the %m macro) or from Data Transfer.
  5539. //
  5540. // Possible values:
  5541. // "AD_SERVING"
  5542. // "DATA_TRANSFER"
  5543. // "ENCRYPTION_SCOPE_UNKNOWN"
  5544. EncryptionSource string `json:"encryptionSource,omitempty"`
  5545. // Kind: Identifies what kind of resource this is. Value: the fixed
  5546. // string "dfareporting#encryptionInfo".
  5547. Kind string `json:"kind,omitempty"`
  5548. // ForceSendFields is a list of field names (e.g. "EncryptionEntityId")
  5549. // to unconditionally include in API requests. By default, fields with
  5550. // empty values are omitted from API requests. However, any non-pointer,
  5551. // non-interface field appearing in ForceSendFields will be sent to the
  5552. // server regardless of whether the field is empty or not. This may be
  5553. // used to include empty fields in Patch requests.
  5554. ForceSendFields []string `json:"-"`
  5555. // NullFields is a list of field names (e.g. "EncryptionEntityId") to
  5556. // include in API requests with the JSON null value. By default, fields
  5557. // with empty values are omitted from API requests. However, any field
  5558. // with an empty value appearing in NullFields will be sent to the
  5559. // server as null. It is an error if a field in this list has a
  5560. // non-empty value. This may be used to include null fields in Patch
  5561. // requests.
  5562. NullFields []string `json:"-"`
  5563. }
  5564. func (s *EncryptionInfo) MarshalJSON() ([]byte, error) {
  5565. type NoMethod EncryptionInfo
  5566. raw := NoMethod(*s)
  5567. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5568. }
  5569. // EventTag: Contains properties of an event tag.
  5570. type EventTag struct {
  5571. // AccountId: Account ID of this event tag. This is a read-only field
  5572. // that can be left blank.
  5573. AccountId int64 `json:"accountId,omitempty,string"`
  5574. // AdvertiserId: Advertiser ID of this event tag. This field or the
  5575. // campaignId field is required on insertion.
  5576. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  5577. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  5578. // advertiser. This is a read-only, auto-generated field.
  5579. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  5580. // CampaignId: Campaign ID of this event tag. This field or the
  5581. // advertiserId field is required on insertion.
  5582. CampaignId int64 `json:"campaignId,omitempty,string"`
  5583. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  5584. // This is a read-only, auto-generated field.
  5585. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  5586. // EnabledByDefault: Whether this event tag should be automatically
  5587. // enabled for all of the advertiser's campaigns and ads.
  5588. EnabledByDefault bool `json:"enabledByDefault,omitempty"`
  5589. // ExcludeFromAdxRequests: Whether to remove this event tag from ads
  5590. // that are trafficked through DoubleClick Bid Manager to Ad Exchange.
  5591. // This may be useful if the event tag uses a pixel that is unapproved
  5592. // for Ad Exchange bids on one or more networks, such as the Google
  5593. // Display Network.
  5594. ExcludeFromAdxRequests bool `json:"excludeFromAdxRequests,omitempty"`
  5595. // Id: ID of this event tag. This is a read-only, auto-generated field.
  5596. Id int64 `json:"id,omitempty,string"`
  5597. // Kind: Identifies what kind of resource this is. Value: the fixed
  5598. // string "dfareporting#eventTag".
  5599. Kind string `json:"kind,omitempty"`
  5600. // Name: Name of this event tag. This is a required field and must be
  5601. // less than 256 characters long.
  5602. Name string `json:"name,omitempty"`
  5603. // SiteFilterType: Site filter type for this event tag. If no type is
  5604. // specified then the event tag will be applied to all sites.
  5605. //
  5606. // Possible values:
  5607. // "BLACKLIST"
  5608. // "WHITELIST"
  5609. SiteFilterType string `json:"siteFilterType,omitempty"`
  5610. // SiteIds: Filter list of site IDs associated with this event tag. The
  5611. // siteFilterType determines whether this is a whitelist or blacklist
  5612. // filter.
  5613. SiteIds googleapi.Int64s `json:"siteIds,omitempty"`
  5614. // SslCompliant: Whether this tag is SSL-compliant or not. This is a
  5615. // read-only field.
  5616. SslCompliant bool `json:"sslCompliant,omitempty"`
  5617. // Status: Status of this event tag. Must be ENABLED for this event tag
  5618. // to fire. This is a required field.
  5619. //
  5620. // Possible values:
  5621. // "DISABLED"
  5622. // "ENABLED"
  5623. Status string `json:"status,omitempty"`
  5624. // SubaccountId: Subaccount ID of this event tag. This is a read-only
  5625. // field that can be left blank.
  5626. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  5627. // Type: Event tag type. Can be used to specify whether to use a
  5628. // third-party pixel, a third-party JavaScript URL, or a third-party
  5629. // click-through URL for either impression or click tracking. This is a
  5630. // required field.
  5631. //
  5632. // Possible values:
  5633. // "CLICK_THROUGH_EVENT_TAG"
  5634. // "IMPRESSION_IMAGE_EVENT_TAG"
  5635. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  5636. Type string `json:"type,omitempty"`
  5637. // Url: Payload URL for this event tag. The URL on a click-through event
  5638. // tag should have a landing page URL appended to the end of it. This
  5639. // field is required on insertion.
  5640. Url string `json:"url,omitempty"`
  5641. // UrlEscapeLevels: Number of times the landing page URL should be
  5642. // URL-escaped before being appended to the click-through event tag URL.
  5643. // Only applies to click-through event tags as specified by the event
  5644. // tag type.
  5645. UrlEscapeLevels int64 `json:"urlEscapeLevels,omitempty"`
  5646. // ServerResponse contains the HTTP response code and headers from the
  5647. // server.
  5648. googleapi.ServerResponse `json:"-"`
  5649. // ForceSendFields is a list of field names (e.g. "AccountId") to
  5650. // unconditionally include in API requests. By default, fields with
  5651. // empty values are omitted from API requests. However, any non-pointer,
  5652. // non-interface field appearing in ForceSendFields will be sent to the
  5653. // server regardless of whether the field is empty or not. This may be
  5654. // used to include empty fields in Patch requests.
  5655. ForceSendFields []string `json:"-"`
  5656. // NullFields is a list of field names (e.g. "AccountId") to include in
  5657. // API requests with the JSON null value. By default, fields with empty
  5658. // values are omitted from API requests. However, any field with an
  5659. // empty value appearing in NullFields will be sent to the server as
  5660. // null. It is an error if a field in this list has a non-empty value.
  5661. // This may be used to include null fields in Patch requests.
  5662. NullFields []string `json:"-"`
  5663. }
  5664. func (s *EventTag) MarshalJSON() ([]byte, error) {
  5665. type NoMethod EventTag
  5666. raw := NoMethod(*s)
  5667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5668. }
  5669. // EventTagOverride: Event tag override information.
  5670. type EventTagOverride struct {
  5671. // Enabled: Whether this override is enabled.
  5672. Enabled bool `json:"enabled,omitempty"`
  5673. // Id: ID of this event tag override. This is a read-only,
  5674. // auto-generated field.
  5675. Id int64 `json:"id,omitempty,string"`
  5676. // ForceSendFields is a list of field names (e.g. "Enabled") to
  5677. // unconditionally include in API requests. By default, fields with
  5678. // empty values are omitted from API requests. However, any non-pointer,
  5679. // non-interface field appearing in ForceSendFields will be sent to the
  5680. // server regardless of whether the field is empty or not. This may be
  5681. // used to include empty fields in Patch requests.
  5682. ForceSendFields []string `json:"-"`
  5683. // NullFields is a list of field names (e.g. "Enabled") to include in
  5684. // API requests with the JSON null value. By default, fields with empty
  5685. // values are omitted from API requests. However, any field with an
  5686. // empty value appearing in NullFields will be sent to the server as
  5687. // null. It is an error if a field in this list has a non-empty value.
  5688. // This may be used to include null fields in Patch requests.
  5689. NullFields []string `json:"-"`
  5690. }
  5691. func (s *EventTagOverride) MarshalJSON() ([]byte, error) {
  5692. type NoMethod EventTagOverride
  5693. raw := NoMethod(*s)
  5694. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5695. }
  5696. // EventTagsListResponse: Event Tag List Response
  5697. type EventTagsListResponse struct {
  5698. // EventTags: Event tag collection.
  5699. EventTags []*EventTag `json:"eventTags,omitempty"`
  5700. // Kind: Identifies what kind of resource this is. Value: the fixed
  5701. // string "dfareporting#eventTagsListResponse".
  5702. Kind string `json:"kind,omitempty"`
  5703. // ServerResponse contains the HTTP response code and headers from the
  5704. // server.
  5705. googleapi.ServerResponse `json:"-"`
  5706. // ForceSendFields is a list of field names (e.g. "EventTags") to
  5707. // unconditionally include in API requests. By default, fields with
  5708. // empty values are omitted from API requests. However, any non-pointer,
  5709. // non-interface field appearing in ForceSendFields will be sent to the
  5710. // server regardless of whether the field is empty or not. This may be
  5711. // used to include empty fields in Patch requests.
  5712. ForceSendFields []string `json:"-"`
  5713. // NullFields is a list of field names (e.g. "EventTags") to include in
  5714. // API requests with the JSON null value. By default, fields with empty
  5715. // values are omitted from API requests. However, any field with an
  5716. // empty value appearing in NullFields will be sent to the server as
  5717. // null. It is an error if a field in this list has a non-empty value.
  5718. // This may be used to include null fields in Patch requests.
  5719. NullFields []string `json:"-"`
  5720. }
  5721. func (s *EventTagsListResponse) MarshalJSON() ([]byte, error) {
  5722. type NoMethod EventTagsListResponse
  5723. raw := NoMethod(*s)
  5724. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5725. }
  5726. // File: Represents a File resource. A file contains the metadata for a
  5727. // report run. It shows the status of the run and holds the URLs to the
  5728. // generated report data if the run is finished and the status is
  5729. // "REPORT_AVAILABLE".
  5730. type File struct {
  5731. // DateRange: The date range for which the file has report data. The
  5732. // date range will always be the absolute date range for which the
  5733. // report is run.
  5734. DateRange *DateRange `json:"dateRange,omitempty"`
  5735. // Etag: The eTag of this response for caching purposes.
  5736. Etag string `json:"etag,omitempty"`
  5737. // FileName: The filename of the file.
  5738. FileName string `json:"fileName,omitempty"`
  5739. // Format: The output format of the report. Only available once the file
  5740. // is available.
  5741. //
  5742. // Possible values:
  5743. // "CSV"
  5744. // "EXCEL"
  5745. Format string `json:"format,omitempty"`
  5746. // Id: The unique ID of this report file.
  5747. Id int64 `json:"id,omitempty,string"`
  5748. // Kind: The kind of resource this is, in this case dfareporting#file.
  5749. Kind string `json:"kind,omitempty"`
  5750. // LastModifiedTime: The timestamp in milliseconds since epoch when this
  5751. // file was last modified.
  5752. LastModifiedTime int64 `json:"lastModifiedTime,omitempty,string"`
  5753. // ReportId: The ID of the report this file was generated from.
  5754. ReportId int64 `json:"reportId,omitempty,string"`
  5755. // Status: The status of the report file.
  5756. //
  5757. // Possible values:
  5758. // "CANCELLED"
  5759. // "FAILED"
  5760. // "PROCESSING"
  5761. // "REPORT_AVAILABLE"
  5762. Status string `json:"status,omitempty"`
  5763. // Urls: The URLs where the completed report file can be downloaded.
  5764. Urls *FileUrls `json:"urls,omitempty"`
  5765. // ServerResponse contains the HTTP response code and headers from the
  5766. // server.
  5767. googleapi.ServerResponse `json:"-"`
  5768. // ForceSendFields is a list of field names (e.g. "DateRange") to
  5769. // unconditionally include in API requests. By default, fields with
  5770. // empty values are omitted from API requests. However, any non-pointer,
  5771. // non-interface field appearing in ForceSendFields will be sent to the
  5772. // server regardless of whether the field is empty or not. This may be
  5773. // used to include empty fields in Patch requests.
  5774. ForceSendFields []string `json:"-"`
  5775. // NullFields is a list of field names (e.g. "DateRange") to include in
  5776. // API requests with the JSON null value. By default, fields with empty
  5777. // values are omitted from API requests. However, any field with an
  5778. // empty value appearing in NullFields will be sent to the server as
  5779. // null. It is an error if a field in this list has a non-empty value.
  5780. // This may be used to include null fields in Patch requests.
  5781. NullFields []string `json:"-"`
  5782. }
  5783. func (s *File) MarshalJSON() ([]byte, error) {
  5784. type NoMethod File
  5785. raw := NoMethod(*s)
  5786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5787. }
  5788. // FileUrls: The URLs where the completed report file can be downloaded.
  5789. type FileUrls struct {
  5790. // ApiUrl: The URL for downloading the report data through the API.
  5791. ApiUrl string `json:"apiUrl,omitempty"`
  5792. // BrowserUrl: The URL for downloading the report data through a
  5793. // browser.
  5794. BrowserUrl string `json:"browserUrl,omitempty"`
  5795. // ForceSendFields is a list of field names (e.g. "ApiUrl") to
  5796. // unconditionally include in API requests. By default, fields with
  5797. // empty values are omitted from API requests. However, any non-pointer,
  5798. // non-interface field appearing in ForceSendFields will be sent to the
  5799. // server regardless of whether the field is empty or not. This may be
  5800. // used to include empty fields in Patch requests.
  5801. ForceSendFields []string `json:"-"`
  5802. // NullFields is a list of field names (e.g. "ApiUrl") to include in API
  5803. // requests with the JSON null value. By default, fields with empty
  5804. // values are omitted from API requests. However, any field with an
  5805. // empty value appearing in NullFields will be sent to the server as
  5806. // null. It is an error if a field in this list has a non-empty value.
  5807. // This may be used to include null fields in Patch requests.
  5808. NullFields []string `json:"-"`
  5809. }
  5810. func (s *FileUrls) MarshalJSON() ([]byte, error) {
  5811. type NoMethod FileUrls
  5812. raw := NoMethod(*s)
  5813. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5814. }
  5815. // FileList: Represents the list of File resources.
  5816. type FileList struct {
  5817. // Etag: The eTag of this response for caching purposes.
  5818. Etag string `json:"etag,omitempty"`
  5819. // Items: The files returned in this response.
  5820. Items []*File `json:"items,omitempty"`
  5821. // Kind: The kind of list this is, in this case dfareporting#fileList.
  5822. Kind string `json:"kind,omitempty"`
  5823. // NextPageToken: Continuation token used to page through files. To
  5824. // retrieve the next page of results, set the next request's "pageToken"
  5825. // to the value of this field. The page token is only valid for a
  5826. // limited amount of time and should not be persisted.
  5827. NextPageToken string `json:"nextPageToken,omitempty"`
  5828. // ServerResponse contains the HTTP response code and headers from the
  5829. // server.
  5830. googleapi.ServerResponse `json:"-"`
  5831. // ForceSendFields is a list of field names (e.g. "Etag") to
  5832. // unconditionally include in API requests. By default, fields with
  5833. // empty values are omitted from API requests. However, any non-pointer,
  5834. // non-interface field appearing in ForceSendFields will be sent to the
  5835. // server regardless of whether the field is empty or not. This may be
  5836. // used to include empty fields in Patch requests.
  5837. ForceSendFields []string `json:"-"`
  5838. // NullFields is a list of field names (e.g. "Etag") to include in API
  5839. // requests with the JSON null value. By default, fields with empty
  5840. // values are omitted from API requests. However, any field with an
  5841. // empty value appearing in NullFields will be sent to the server as
  5842. // null. It is an error if a field in this list has a non-empty value.
  5843. // This may be used to include null fields in Patch requests.
  5844. NullFields []string `json:"-"`
  5845. }
  5846. func (s *FileList) MarshalJSON() ([]byte, error) {
  5847. type NoMethod FileList
  5848. raw := NoMethod(*s)
  5849. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5850. }
  5851. // Flight: Flight
  5852. type Flight struct {
  5853. // EndDate: Inventory item flight end date.
  5854. EndDate string `json:"endDate,omitempty"`
  5855. // RateOrCost: Rate or cost of this flight.
  5856. RateOrCost int64 `json:"rateOrCost,omitempty,string"`
  5857. // StartDate: Inventory item flight start date.
  5858. StartDate string `json:"startDate,omitempty"`
  5859. // Units: Units of this flight.
  5860. Units int64 `json:"units,omitempty,string"`
  5861. // ForceSendFields is a list of field names (e.g. "EndDate") to
  5862. // unconditionally include in API requests. By default, fields with
  5863. // empty values are omitted from API requests. However, any non-pointer,
  5864. // non-interface field appearing in ForceSendFields will be sent to the
  5865. // server regardless of whether the field is empty or not. This may be
  5866. // used to include empty fields in Patch requests.
  5867. ForceSendFields []string `json:"-"`
  5868. // NullFields is a list of field names (e.g. "EndDate") to include in
  5869. // API requests with the JSON null value. By default, fields with empty
  5870. // values are omitted from API requests. However, any field with an
  5871. // empty value appearing in NullFields will be sent to the server as
  5872. // null. It is an error if a field in this list has a non-empty value.
  5873. // This may be used to include null fields in Patch requests.
  5874. NullFields []string `json:"-"`
  5875. }
  5876. func (s *Flight) MarshalJSON() ([]byte, error) {
  5877. type NoMethod Flight
  5878. raw := NoMethod(*s)
  5879. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5880. }
  5881. // FloodlightActivitiesGenerateTagResponse: Floodlight Activity
  5882. // GenerateTag Response
  5883. type FloodlightActivitiesGenerateTagResponse struct {
  5884. // FloodlightActivityTag: Generated tag for this Floodlight activity.
  5885. // For global site tags, this is the event snippet.
  5886. FloodlightActivityTag string `json:"floodlightActivityTag,omitempty"`
  5887. // Kind: Identifies what kind of resource this is. Value: the fixed
  5888. // string "dfareporting#floodlightActivitiesGenerateTagResponse".
  5889. Kind string `json:"kind,omitempty"`
  5890. // ServerResponse contains the HTTP response code and headers from the
  5891. // server.
  5892. googleapi.ServerResponse `json:"-"`
  5893. // ForceSendFields is a list of field names (e.g.
  5894. // "FloodlightActivityTag") to unconditionally include in API requests.
  5895. // By default, fields with empty values are omitted from API requests.
  5896. // However, any non-pointer, non-interface field appearing in
  5897. // ForceSendFields will be sent to the server regardless of whether the
  5898. // field is empty or not. This may be used to include empty fields in
  5899. // Patch requests.
  5900. ForceSendFields []string `json:"-"`
  5901. // NullFields is a list of field names (e.g. "FloodlightActivityTag") to
  5902. // include in API requests with the JSON null value. By default, fields
  5903. // with empty values are omitted from API requests. However, any field
  5904. // with an empty value appearing in NullFields will be sent to the
  5905. // server as null. It is an error if a field in this list has a
  5906. // non-empty value. This may be used to include null fields in Patch
  5907. // requests.
  5908. NullFields []string `json:"-"`
  5909. }
  5910. func (s *FloodlightActivitiesGenerateTagResponse) MarshalJSON() ([]byte, error) {
  5911. type NoMethod FloodlightActivitiesGenerateTagResponse
  5912. raw := NoMethod(*s)
  5913. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5914. }
  5915. // FloodlightActivitiesListResponse: Floodlight Activity List Response
  5916. type FloodlightActivitiesListResponse struct {
  5917. // FloodlightActivities: Floodlight activity collection.
  5918. FloodlightActivities []*FloodlightActivity `json:"floodlightActivities,omitempty"`
  5919. // Kind: Identifies what kind of resource this is. Value: the fixed
  5920. // string "dfareporting#floodlightActivitiesListResponse".
  5921. Kind string `json:"kind,omitempty"`
  5922. // NextPageToken: Pagination token to be used for the next list
  5923. // operation.
  5924. NextPageToken string `json:"nextPageToken,omitempty"`
  5925. // ServerResponse contains the HTTP response code and headers from the
  5926. // server.
  5927. googleapi.ServerResponse `json:"-"`
  5928. // ForceSendFields is a list of field names (e.g.
  5929. // "FloodlightActivities") to unconditionally include in API requests.
  5930. // By default, fields with empty values are omitted from API requests.
  5931. // However, any non-pointer, non-interface field appearing in
  5932. // ForceSendFields will be sent to the server regardless of whether the
  5933. // field is empty or not. This may be used to include empty fields in
  5934. // Patch requests.
  5935. ForceSendFields []string `json:"-"`
  5936. // NullFields is a list of field names (e.g. "FloodlightActivities") to
  5937. // include in API requests with the JSON null value. By default, fields
  5938. // with empty values are omitted from API requests. However, any field
  5939. // with an empty value appearing in NullFields will be sent to the
  5940. // server as null. It is an error if a field in this list has a
  5941. // non-empty value. This may be used to include null fields in Patch
  5942. // requests.
  5943. NullFields []string `json:"-"`
  5944. }
  5945. func (s *FloodlightActivitiesListResponse) MarshalJSON() ([]byte, error) {
  5946. type NoMethod FloodlightActivitiesListResponse
  5947. raw := NoMethod(*s)
  5948. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  5949. }
  5950. // FloodlightActivity: Contains properties of a Floodlight activity.
  5951. type FloodlightActivity struct {
  5952. // AccountId: Account ID of this floodlight activity. This is a
  5953. // read-only field that can be left blank.
  5954. AccountId int64 `json:"accountId,omitempty,string"`
  5955. // AdvertiserId: Advertiser ID of this floodlight activity. If this
  5956. // field is left blank, the value will be copied over either from the
  5957. // activity group's advertiser or the existing activity's advertiser.
  5958. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  5959. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  5960. // advertiser. This is a read-only, auto-generated field.
  5961. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  5962. // CacheBustingType: Code type used for cache busting in the generated
  5963. // tag. Applicable only when floodlightActivityGroupType is COUNTER and
  5964. // countingMethod is STANDARD_COUNTING or UNIQUE_COUNTING.
  5965. //
  5966. // Possible values:
  5967. // "ACTIVE_SERVER_PAGE"
  5968. // "COLD_FUSION"
  5969. // "JAVASCRIPT"
  5970. // "JSP"
  5971. // "PHP"
  5972. CacheBustingType string `json:"cacheBustingType,omitempty"`
  5973. // CountingMethod: Counting method for conversions for this floodlight
  5974. // activity. This is a required field.
  5975. //
  5976. // Possible values:
  5977. // "ITEMS_SOLD_COUNTING"
  5978. // "SESSION_COUNTING"
  5979. // "STANDARD_COUNTING"
  5980. // "TRANSACTIONS_COUNTING"
  5981. // "UNIQUE_COUNTING"
  5982. CountingMethod string `json:"countingMethod,omitempty"`
  5983. // DefaultTags: Dynamic floodlight tags.
  5984. DefaultTags []*FloodlightActivityDynamicTag `json:"defaultTags,omitempty"`
  5985. // ExpectedUrl: URL where this tag will be deployed. If specified, must
  5986. // be less than 256 characters long.
  5987. ExpectedUrl string `json:"expectedUrl,omitempty"`
  5988. // FloodlightActivityGroupId: Floodlight activity group ID of this
  5989. // floodlight activity. This is a required field.
  5990. FloodlightActivityGroupId int64 `json:"floodlightActivityGroupId,omitempty,string"`
  5991. // FloodlightActivityGroupName: Name of the associated floodlight
  5992. // activity group. This is a read-only field.
  5993. FloodlightActivityGroupName string `json:"floodlightActivityGroupName,omitempty"`
  5994. // FloodlightActivityGroupTagString: Tag string of the associated
  5995. // floodlight activity group. This is a read-only field.
  5996. FloodlightActivityGroupTagString string `json:"floodlightActivityGroupTagString,omitempty"`
  5997. // FloodlightActivityGroupType: Type of the associated floodlight
  5998. // activity group. This is a read-only field.
  5999. //
  6000. // Possible values:
  6001. // "COUNTER"
  6002. // "SALE"
  6003. FloodlightActivityGroupType string `json:"floodlightActivityGroupType,omitempty"`
  6004. // FloodlightConfigurationId: Floodlight configuration ID of this
  6005. // floodlight activity. If this field is left blank, the value will be
  6006. // copied over either from the activity group's floodlight configuration
  6007. // or from the existing activity's floodlight configuration.
  6008. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6009. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6010. // of the floodlight configuration. This is a read-only, auto-generated
  6011. // field.
  6012. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6013. // Hidden: Whether this activity is archived.
  6014. Hidden bool `json:"hidden,omitempty"`
  6015. // Id: ID of this floodlight activity. This is a read-only,
  6016. // auto-generated field.
  6017. Id int64 `json:"id,omitempty,string"`
  6018. // IdDimensionValue: Dimension value for the ID of this floodlight
  6019. // activity. This is a read-only, auto-generated field.
  6020. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6021. // ImageTagEnabled: Whether the image tag is enabled for this activity.
  6022. ImageTagEnabled bool `json:"imageTagEnabled,omitempty"`
  6023. // Kind: Identifies what kind of resource this is. Value: the fixed
  6024. // string "dfareporting#floodlightActivity".
  6025. Kind string `json:"kind,omitempty"`
  6026. // Name: Name of this floodlight activity. This is a required field.
  6027. // Must be less than 129 characters long and cannot contain quotes.
  6028. Name string `json:"name,omitempty"`
  6029. // Notes: General notes or implementation instructions for the tag.
  6030. Notes string `json:"notes,omitempty"`
  6031. // PublisherTags: Publisher dynamic floodlight tags.
  6032. PublisherTags []*FloodlightActivityPublisherDynamicTag `json:"publisherTags,omitempty"`
  6033. // Secure: Whether this tag should use SSL.
  6034. Secure bool `json:"secure,omitempty"`
  6035. // SslCompliant: Whether the floodlight activity is SSL-compliant. This
  6036. // is a read-only field, its value detected by the system from the
  6037. // floodlight tags.
  6038. SslCompliant bool `json:"sslCompliant,omitempty"`
  6039. // SslRequired: Whether this floodlight activity must be SSL-compliant.
  6040. SslRequired bool `json:"sslRequired,omitempty"`
  6041. // SubaccountId: Subaccount ID of this floodlight activity. This is a
  6042. // read-only field that can be left blank.
  6043. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6044. // TagFormat: Tag format type for the floodlight activity. If left
  6045. // blank, the tag format will default to HTML.
  6046. //
  6047. // Possible values:
  6048. // "HTML"
  6049. // "XHTML"
  6050. TagFormat string `json:"tagFormat,omitempty"`
  6051. // TagString: Value of the cat= parameter in the floodlight tag, which
  6052. // the ad servers use to identify the activity. This is optional: if
  6053. // empty, a new tag string will be generated for you. This string must
  6054. // be 1 to 8 characters long, with valid characters being
  6055. // [a-z][A-Z][0-9][-][ _ ]. This tag string must also be unique among
  6056. // activities of the same activity group. This field is read-only after
  6057. // insertion.
  6058. TagString string `json:"tagString,omitempty"`
  6059. // UserDefinedVariableTypes: List of the user-defined variables used by
  6060. // this conversion tag. These map to the "u[1-100]=" in the tags. Each
  6061. // of these can have a user defined type.
  6062. // Acceptable values are U1 to U100, inclusive.
  6063. //
  6064. // Possible values:
  6065. // "U1"
  6066. // "U10"
  6067. // "U100"
  6068. // "U11"
  6069. // "U12"
  6070. // "U13"
  6071. // "U14"
  6072. // "U15"
  6073. // "U16"
  6074. // "U17"
  6075. // "U18"
  6076. // "U19"
  6077. // "U2"
  6078. // "U20"
  6079. // "U21"
  6080. // "U22"
  6081. // "U23"
  6082. // "U24"
  6083. // "U25"
  6084. // "U26"
  6085. // "U27"
  6086. // "U28"
  6087. // "U29"
  6088. // "U3"
  6089. // "U30"
  6090. // "U31"
  6091. // "U32"
  6092. // "U33"
  6093. // "U34"
  6094. // "U35"
  6095. // "U36"
  6096. // "U37"
  6097. // "U38"
  6098. // "U39"
  6099. // "U4"
  6100. // "U40"
  6101. // "U41"
  6102. // "U42"
  6103. // "U43"
  6104. // "U44"
  6105. // "U45"
  6106. // "U46"
  6107. // "U47"
  6108. // "U48"
  6109. // "U49"
  6110. // "U5"
  6111. // "U50"
  6112. // "U51"
  6113. // "U52"
  6114. // "U53"
  6115. // "U54"
  6116. // "U55"
  6117. // "U56"
  6118. // "U57"
  6119. // "U58"
  6120. // "U59"
  6121. // "U6"
  6122. // "U60"
  6123. // "U61"
  6124. // "U62"
  6125. // "U63"
  6126. // "U64"
  6127. // "U65"
  6128. // "U66"
  6129. // "U67"
  6130. // "U68"
  6131. // "U69"
  6132. // "U7"
  6133. // "U70"
  6134. // "U71"
  6135. // "U72"
  6136. // "U73"
  6137. // "U74"
  6138. // "U75"
  6139. // "U76"
  6140. // "U77"
  6141. // "U78"
  6142. // "U79"
  6143. // "U8"
  6144. // "U80"
  6145. // "U81"
  6146. // "U82"
  6147. // "U83"
  6148. // "U84"
  6149. // "U85"
  6150. // "U86"
  6151. // "U87"
  6152. // "U88"
  6153. // "U89"
  6154. // "U9"
  6155. // "U90"
  6156. // "U91"
  6157. // "U92"
  6158. // "U93"
  6159. // "U94"
  6160. // "U95"
  6161. // "U96"
  6162. // "U97"
  6163. // "U98"
  6164. // "U99"
  6165. UserDefinedVariableTypes []string `json:"userDefinedVariableTypes,omitempty"`
  6166. // ServerResponse contains the HTTP response code and headers from the
  6167. // server.
  6168. googleapi.ServerResponse `json:"-"`
  6169. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6170. // unconditionally include in API requests. By default, fields with
  6171. // empty values are omitted from API requests. However, any non-pointer,
  6172. // non-interface field appearing in ForceSendFields will be sent to the
  6173. // server regardless of whether the field is empty or not. This may be
  6174. // used to include empty fields in Patch requests.
  6175. ForceSendFields []string `json:"-"`
  6176. // NullFields is a list of field names (e.g. "AccountId") to include in
  6177. // API requests with the JSON null value. By default, fields with empty
  6178. // values are omitted from API requests. However, any field with an
  6179. // empty value appearing in NullFields will be sent to the server as
  6180. // null. It is an error if a field in this list has a non-empty value.
  6181. // This may be used to include null fields in Patch requests.
  6182. NullFields []string `json:"-"`
  6183. }
  6184. func (s *FloodlightActivity) MarshalJSON() ([]byte, error) {
  6185. type NoMethod FloodlightActivity
  6186. raw := NoMethod(*s)
  6187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6188. }
  6189. // FloodlightActivityDynamicTag: Dynamic Tag
  6190. type FloodlightActivityDynamicTag struct {
  6191. // Id: ID of this dynamic tag. This is a read-only, auto-generated
  6192. // field.
  6193. Id int64 `json:"id,omitempty,string"`
  6194. // Name: Name of this tag.
  6195. Name string `json:"name,omitempty"`
  6196. // Tag: Tag code.
  6197. Tag string `json:"tag,omitempty"`
  6198. // ForceSendFields is a list of field names (e.g. "Id") to
  6199. // unconditionally include in API requests. By default, fields with
  6200. // empty values are omitted from API requests. However, any non-pointer,
  6201. // non-interface field appearing in ForceSendFields will be sent to the
  6202. // server regardless of whether the field is empty or not. This may be
  6203. // used to include empty fields in Patch requests.
  6204. ForceSendFields []string `json:"-"`
  6205. // NullFields is a list of field names (e.g. "Id") to include in API
  6206. // requests with the JSON null value. By default, fields with empty
  6207. // values are omitted from API requests. However, any field with an
  6208. // empty value appearing in NullFields will be sent to the server as
  6209. // null. It is an error if a field in this list has a non-empty value.
  6210. // This may be used to include null fields in Patch requests.
  6211. NullFields []string `json:"-"`
  6212. }
  6213. func (s *FloodlightActivityDynamicTag) MarshalJSON() ([]byte, error) {
  6214. type NoMethod FloodlightActivityDynamicTag
  6215. raw := NoMethod(*s)
  6216. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6217. }
  6218. // FloodlightActivityGroup: Contains properties of a Floodlight activity
  6219. // group.
  6220. type FloodlightActivityGroup struct {
  6221. // AccountId: Account ID of this floodlight activity group. This is a
  6222. // read-only field that can be left blank.
  6223. AccountId int64 `json:"accountId,omitempty,string"`
  6224. // AdvertiserId: Advertiser ID of this floodlight activity group. If
  6225. // this field is left blank, the value will be copied over either from
  6226. // the floodlight configuration's advertiser or from the existing
  6227. // activity group's advertiser.
  6228. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6229. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6230. // advertiser. This is a read-only, auto-generated field.
  6231. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6232. // FloodlightConfigurationId: Floodlight configuration ID of this
  6233. // floodlight activity group. This is a required field.
  6234. FloodlightConfigurationId int64 `json:"floodlightConfigurationId,omitempty,string"`
  6235. // FloodlightConfigurationIdDimensionValue: Dimension value for the ID
  6236. // of the floodlight configuration. This is a read-only, auto-generated
  6237. // field.
  6238. FloodlightConfigurationIdDimensionValue *DimensionValue `json:"floodlightConfigurationIdDimensionValue,omitempty"`
  6239. // Id: ID of this floodlight activity group. This is a read-only,
  6240. // auto-generated field.
  6241. Id int64 `json:"id,omitempty,string"`
  6242. // IdDimensionValue: Dimension value for the ID of this floodlight
  6243. // activity group. This is a read-only, auto-generated field.
  6244. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6245. // Kind: Identifies what kind of resource this is. Value: the fixed
  6246. // string "dfareporting#floodlightActivityGroup".
  6247. Kind string `json:"kind,omitempty"`
  6248. // Name: Name of this floodlight activity group. This is a required
  6249. // field. Must be less than 65 characters long and cannot contain
  6250. // quotes.
  6251. Name string `json:"name,omitempty"`
  6252. // SubaccountId: Subaccount ID of this floodlight activity group. This
  6253. // is a read-only field that can be left blank.
  6254. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6255. // TagString: Value of the type= parameter in the floodlight tag, which
  6256. // the ad servers use to identify the activity group that the activity
  6257. // belongs to. This is optional: if empty, a new tag string will be
  6258. // generated for you. This string must be 1 to 8 characters long, with
  6259. // valid characters being [a-z][A-Z][0-9][-][ _ ]. This tag string must
  6260. // also be unique among activity groups of the same floodlight
  6261. // configuration. This field is read-only after insertion.
  6262. TagString string `json:"tagString,omitempty"`
  6263. // Type: Type of the floodlight activity group. This is a required field
  6264. // that is read-only after insertion.
  6265. //
  6266. // Possible values:
  6267. // "COUNTER"
  6268. // "SALE"
  6269. Type string `json:"type,omitempty"`
  6270. // ServerResponse contains the HTTP response code and headers from the
  6271. // server.
  6272. googleapi.ServerResponse `json:"-"`
  6273. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6274. // unconditionally include in API requests. By default, fields with
  6275. // empty values are omitted from API requests. However, any non-pointer,
  6276. // non-interface field appearing in ForceSendFields will be sent to the
  6277. // server regardless of whether the field is empty or not. This may be
  6278. // used to include empty fields in Patch requests.
  6279. ForceSendFields []string `json:"-"`
  6280. // NullFields is a list of field names (e.g. "AccountId") to include in
  6281. // API requests with the JSON null value. By default, fields with empty
  6282. // values are omitted from API requests. However, any field with an
  6283. // empty value appearing in NullFields will be sent to the server as
  6284. // null. It is an error if a field in this list has a non-empty value.
  6285. // This may be used to include null fields in Patch requests.
  6286. NullFields []string `json:"-"`
  6287. }
  6288. func (s *FloodlightActivityGroup) MarshalJSON() ([]byte, error) {
  6289. type NoMethod FloodlightActivityGroup
  6290. raw := NoMethod(*s)
  6291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6292. }
  6293. // FloodlightActivityGroupsListResponse: Floodlight Activity Group List
  6294. // Response
  6295. type FloodlightActivityGroupsListResponse struct {
  6296. // FloodlightActivityGroups: Floodlight activity group collection.
  6297. FloodlightActivityGroups []*FloodlightActivityGroup `json:"floodlightActivityGroups,omitempty"`
  6298. // Kind: Identifies what kind of resource this is. Value: the fixed
  6299. // string "dfareporting#floodlightActivityGroupsListResponse".
  6300. Kind string `json:"kind,omitempty"`
  6301. // NextPageToken: Pagination token to be used for the next list
  6302. // operation.
  6303. NextPageToken string `json:"nextPageToken,omitempty"`
  6304. // ServerResponse contains the HTTP response code and headers from the
  6305. // server.
  6306. googleapi.ServerResponse `json:"-"`
  6307. // ForceSendFields is a list of field names (e.g.
  6308. // "FloodlightActivityGroups") to unconditionally include in API
  6309. // requests. By default, fields with empty values are omitted from API
  6310. // requests. However, any non-pointer, non-interface field appearing in
  6311. // ForceSendFields will be sent to the server regardless of whether the
  6312. // field is empty or not. This may be used to include empty fields in
  6313. // Patch requests.
  6314. ForceSendFields []string `json:"-"`
  6315. // NullFields is a list of field names (e.g. "FloodlightActivityGroups")
  6316. // to include in API requests with the JSON null value. By default,
  6317. // fields with empty values are omitted from API requests. However, any
  6318. // field with an empty value appearing in NullFields will be sent to the
  6319. // server as null. It is an error if a field in this list has a
  6320. // non-empty value. This may be used to include null fields in Patch
  6321. // requests.
  6322. NullFields []string `json:"-"`
  6323. }
  6324. func (s *FloodlightActivityGroupsListResponse) MarshalJSON() ([]byte, error) {
  6325. type NoMethod FloodlightActivityGroupsListResponse
  6326. raw := NoMethod(*s)
  6327. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6328. }
  6329. // FloodlightActivityPublisherDynamicTag: Publisher Dynamic Tag
  6330. type FloodlightActivityPublisherDynamicTag struct {
  6331. // ClickThrough: Whether this tag is applicable only for click-throughs.
  6332. ClickThrough bool `json:"clickThrough,omitempty"`
  6333. // DirectorySiteId: Directory site ID of this dynamic tag. This is a
  6334. // write-only field that can be used as an alternative to the siteId
  6335. // field. When this resource is retrieved, only the siteId field will be
  6336. // populated.
  6337. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  6338. // DynamicTag: Dynamic floodlight tag.
  6339. DynamicTag *FloodlightActivityDynamicTag `json:"dynamicTag,omitempty"`
  6340. // SiteId: Site ID of this dynamic tag.
  6341. SiteId int64 `json:"siteId,omitempty,string"`
  6342. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  6343. // a read-only, auto-generated field.
  6344. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  6345. // ViewThrough: Whether this tag is applicable only for view-throughs.
  6346. ViewThrough bool `json:"viewThrough,omitempty"`
  6347. // ForceSendFields is a list of field names (e.g. "ClickThrough") to
  6348. // unconditionally include in API requests. By default, fields with
  6349. // empty values are omitted from API requests. However, any non-pointer,
  6350. // non-interface field appearing in ForceSendFields will be sent to the
  6351. // server regardless of whether the field is empty or not. This may be
  6352. // used to include empty fields in Patch requests.
  6353. ForceSendFields []string `json:"-"`
  6354. // NullFields is a list of field names (e.g. "ClickThrough") to include
  6355. // in API requests with the JSON null value. By default, fields with
  6356. // empty values are omitted from API requests. However, any field with
  6357. // an empty value appearing in NullFields will be sent to the server as
  6358. // null. It is an error if a field in this list has a non-empty value.
  6359. // This may be used to include null fields in Patch requests.
  6360. NullFields []string `json:"-"`
  6361. }
  6362. func (s *FloodlightActivityPublisherDynamicTag) MarshalJSON() ([]byte, error) {
  6363. type NoMethod FloodlightActivityPublisherDynamicTag
  6364. raw := NoMethod(*s)
  6365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6366. }
  6367. // FloodlightConfiguration: Contains properties of a Floodlight
  6368. // configuration.
  6369. type FloodlightConfiguration struct {
  6370. // AccountId: Account ID of this floodlight configuration. This is a
  6371. // read-only field that can be left blank.
  6372. AccountId int64 `json:"accountId,omitempty,string"`
  6373. // AdvertiserId: Advertiser ID of the parent advertiser of this
  6374. // floodlight configuration.
  6375. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6376. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  6377. // advertiser. This is a read-only, auto-generated field.
  6378. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  6379. // AnalyticsDataSharingEnabled: Whether advertiser data is shared with
  6380. // Google Analytics.
  6381. AnalyticsDataSharingEnabled bool `json:"analyticsDataSharingEnabled,omitempty"`
  6382. // ExposureToConversionEnabled: Whether the exposure-to-conversion
  6383. // report is enabled. This report shows detailed pathway information on
  6384. // up to 10 of the most recent ad exposures seen by a user before
  6385. // converting.
  6386. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  6387. // FirstDayOfWeek: Day that will be counted as the first day of the week
  6388. // in reports. This is a required field.
  6389. //
  6390. // Possible values:
  6391. // "MONDAY"
  6392. // "SUNDAY"
  6393. FirstDayOfWeek string `json:"firstDayOfWeek,omitempty"`
  6394. // Id: ID of this floodlight configuration. This is a read-only,
  6395. // auto-generated field.
  6396. Id int64 `json:"id,omitempty,string"`
  6397. // IdDimensionValue: Dimension value for the ID of this floodlight
  6398. // configuration. This is a read-only, auto-generated field.
  6399. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  6400. // InAppAttributionTrackingEnabled: Whether in-app attribution tracking
  6401. // is enabled.
  6402. InAppAttributionTrackingEnabled bool `json:"inAppAttributionTrackingEnabled,omitempty"`
  6403. // Kind: Identifies what kind of resource this is. Value: the fixed
  6404. // string "dfareporting#floodlightConfiguration".
  6405. Kind string `json:"kind,omitempty"`
  6406. // LookbackConfiguration: Lookback window settings for this floodlight
  6407. // configuration.
  6408. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  6409. // NaturalSearchConversionAttributionOption: Types of attribution
  6410. // options for natural search conversions.
  6411. //
  6412. // Possible values:
  6413. // "EXCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6414. // "INCLUDE_NATURAL_SEARCH_CONVERSION_ATTRIBUTION"
  6415. // "INCLUDE_NATURAL_SEARCH_TIERED_CONVERSION_ATTRIBUTION"
  6416. NaturalSearchConversionAttributionOption string `json:"naturalSearchConversionAttributionOption,omitempty"`
  6417. // OmnitureSettings: Settings for DCM Omniture integration.
  6418. OmnitureSettings *OmnitureSettings `json:"omnitureSettings,omitempty"`
  6419. // StandardVariableTypes: List of standard variables enabled for this
  6420. // configuration.
  6421. //
  6422. // Acceptable values are:
  6423. // - "ORD"
  6424. // - "NUM"
  6425. //
  6426. // Possible values:
  6427. // "NUM"
  6428. // "ORD"
  6429. // "TRAN"
  6430. // "U"
  6431. StandardVariableTypes []string `json:"standardVariableTypes,omitempty"`
  6432. // SubaccountId: Subaccount ID of this floodlight configuration. This is
  6433. // a read-only field that can be left blank.
  6434. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6435. // TagSettings: Configuration settings for dynamic and image floodlight
  6436. // tags.
  6437. TagSettings *TagSettings `json:"tagSettings,omitempty"`
  6438. // ThirdPartyAuthenticationTokens: List of third-party authentication
  6439. // tokens enabled for this configuration.
  6440. ThirdPartyAuthenticationTokens []*ThirdPartyAuthenticationToken `json:"thirdPartyAuthenticationTokens,omitempty"`
  6441. // UserDefinedVariableConfigurations: List of user defined variables
  6442. // enabled for this configuration.
  6443. UserDefinedVariableConfigurations []*UserDefinedVariableConfiguration `json:"userDefinedVariableConfigurations,omitempty"`
  6444. // ServerResponse contains the HTTP response code and headers from the
  6445. // server.
  6446. googleapi.ServerResponse `json:"-"`
  6447. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6448. // unconditionally include in API requests. By default, fields with
  6449. // empty values are omitted from API requests. However, any non-pointer,
  6450. // non-interface field appearing in ForceSendFields will be sent to the
  6451. // server regardless of whether the field is empty or not. This may be
  6452. // used to include empty fields in Patch requests.
  6453. ForceSendFields []string `json:"-"`
  6454. // NullFields is a list of field names (e.g. "AccountId") to include in
  6455. // API requests with the JSON null value. By default, fields with empty
  6456. // values are omitted from API requests. However, any field with an
  6457. // empty value appearing in NullFields will be sent to the server as
  6458. // null. It is an error if a field in this list has a non-empty value.
  6459. // This may be used to include null fields in Patch requests.
  6460. NullFields []string `json:"-"`
  6461. }
  6462. func (s *FloodlightConfiguration) MarshalJSON() ([]byte, error) {
  6463. type NoMethod FloodlightConfiguration
  6464. raw := NoMethod(*s)
  6465. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6466. }
  6467. // FloodlightConfigurationsListResponse: Floodlight Configuration List
  6468. // Response
  6469. type FloodlightConfigurationsListResponse struct {
  6470. // FloodlightConfigurations: Floodlight configuration collection.
  6471. FloodlightConfigurations []*FloodlightConfiguration `json:"floodlightConfigurations,omitempty"`
  6472. // Kind: Identifies what kind of resource this is. Value: the fixed
  6473. // string "dfareporting#floodlightConfigurationsListResponse".
  6474. Kind string `json:"kind,omitempty"`
  6475. // ServerResponse contains the HTTP response code and headers from the
  6476. // server.
  6477. googleapi.ServerResponse `json:"-"`
  6478. // ForceSendFields is a list of field names (e.g.
  6479. // "FloodlightConfigurations") to unconditionally include in API
  6480. // requests. By default, fields with empty values are omitted from API
  6481. // requests. However, any non-pointer, non-interface field appearing in
  6482. // ForceSendFields will be sent to the server regardless of whether the
  6483. // field is empty or not. This may be used to include empty fields in
  6484. // Patch requests.
  6485. ForceSendFields []string `json:"-"`
  6486. // NullFields is a list of field names (e.g. "FloodlightConfigurations")
  6487. // to include in API requests with the JSON null value. By default,
  6488. // fields with empty values are omitted from API requests. However, any
  6489. // field with an empty value appearing in NullFields will be sent to the
  6490. // server as null. It is an error if a field in this list has a
  6491. // non-empty value. This may be used to include null fields in Patch
  6492. // requests.
  6493. NullFields []string `json:"-"`
  6494. }
  6495. func (s *FloodlightConfigurationsListResponse) MarshalJSON() ([]byte, error) {
  6496. type NoMethod FloodlightConfigurationsListResponse
  6497. raw := NoMethod(*s)
  6498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6499. }
  6500. // FloodlightReportCompatibleFields: Represents fields that are
  6501. // compatible to be selected for a report of type "FlOODLIGHT".
  6502. type FloodlightReportCompatibleFields struct {
  6503. // DimensionFilters: Dimensions which are compatible to be selected in
  6504. // the "dimensionFilters" section of the report.
  6505. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  6506. // Dimensions: Dimensions which are compatible to be selected in the
  6507. // "dimensions" section of the report.
  6508. Dimensions []*Dimension `json:"dimensions,omitempty"`
  6509. // Kind: The kind of resource this is, in this case
  6510. // dfareporting#floodlightReportCompatibleFields.
  6511. Kind string `json:"kind,omitempty"`
  6512. // Metrics: Metrics which are compatible to be selected in the
  6513. // "metricNames" section of the report.
  6514. Metrics []*Metric `json:"metrics,omitempty"`
  6515. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  6516. // unconditionally include in API requests. By default, fields with
  6517. // empty values are omitted from API requests. However, any non-pointer,
  6518. // non-interface field appearing in ForceSendFields will be sent to the
  6519. // server regardless of whether the field is empty or not. This may be
  6520. // used to include empty fields in Patch requests.
  6521. ForceSendFields []string `json:"-"`
  6522. // NullFields is a list of field names (e.g. "DimensionFilters") to
  6523. // include in API requests with the JSON null value. By default, fields
  6524. // with empty values are omitted from API requests. However, any field
  6525. // with an empty value appearing in NullFields will be sent to the
  6526. // server as null. It is an error if a field in this list has a
  6527. // non-empty value. This may be used to include null fields in Patch
  6528. // requests.
  6529. NullFields []string `json:"-"`
  6530. }
  6531. func (s *FloodlightReportCompatibleFields) MarshalJSON() ([]byte, error) {
  6532. type NoMethod FloodlightReportCompatibleFields
  6533. raw := NoMethod(*s)
  6534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6535. }
  6536. // FrequencyCap: Frequency Cap.
  6537. type FrequencyCap struct {
  6538. // Duration: Duration of time, in seconds, for this frequency cap. The
  6539. // maximum duration is 90 days. Acceptable values are 1 to 7776000,
  6540. // inclusive.
  6541. Duration int64 `json:"duration,omitempty,string"`
  6542. // Impressions: Number of times an individual user can be served the ad
  6543. // within the specified duration. Acceptable values are 1 to 15,
  6544. // inclusive.
  6545. Impressions int64 `json:"impressions,omitempty,string"`
  6546. // ForceSendFields is a list of field names (e.g. "Duration") to
  6547. // unconditionally include in API requests. By default, fields with
  6548. // empty values are omitted from API requests. However, any non-pointer,
  6549. // non-interface field appearing in ForceSendFields will be sent to the
  6550. // server regardless of whether the field is empty or not. This may be
  6551. // used to include empty fields in Patch requests.
  6552. ForceSendFields []string `json:"-"`
  6553. // NullFields is a list of field names (e.g. "Duration") to include in
  6554. // API requests with the JSON null value. By default, fields with empty
  6555. // values are omitted from API requests. However, any field with an
  6556. // empty value appearing in NullFields will be sent to the server as
  6557. // null. It is an error if a field in this list has a non-empty value.
  6558. // This may be used to include null fields in Patch requests.
  6559. NullFields []string `json:"-"`
  6560. }
  6561. func (s *FrequencyCap) MarshalJSON() ([]byte, error) {
  6562. type NoMethod FrequencyCap
  6563. raw := NoMethod(*s)
  6564. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6565. }
  6566. // FsCommand: FsCommand.
  6567. type FsCommand struct {
  6568. // Left: Distance from the left of the browser.Applicable when
  6569. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6570. Left int64 `json:"left,omitempty"`
  6571. // PositionOption: Position in the browser where the window will open.
  6572. //
  6573. // Possible values:
  6574. // "CENTERED"
  6575. // "DISTANCE_FROM_TOP_LEFT_CORNER"
  6576. PositionOption string `json:"positionOption,omitempty"`
  6577. // Top: Distance from the top of the browser. Applicable when
  6578. // positionOption is DISTANCE_FROM_TOP_LEFT_CORNER.
  6579. Top int64 `json:"top,omitempty"`
  6580. // WindowHeight: Height of the window.
  6581. WindowHeight int64 `json:"windowHeight,omitempty"`
  6582. // WindowWidth: Width of the window.
  6583. WindowWidth int64 `json:"windowWidth,omitempty"`
  6584. // ForceSendFields is a list of field names (e.g. "Left") to
  6585. // unconditionally include in API requests. By default, fields with
  6586. // empty values are omitted from API requests. However, any non-pointer,
  6587. // non-interface field appearing in ForceSendFields will be sent to the
  6588. // server regardless of whether the field is empty or not. This may be
  6589. // used to include empty fields in Patch requests.
  6590. ForceSendFields []string `json:"-"`
  6591. // NullFields is a list of field names (e.g. "Left") to include in API
  6592. // requests with the JSON null value. By default, fields with empty
  6593. // values are omitted from API requests. However, any field with an
  6594. // empty value appearing in NullFields will be sent to the server as
  6595. // null. It is an error if a field in this list has a non-empty value.
  6596. // This may be used to include null fields in Patch requests.
  6597. NullFields []string `json:"-"`
  6598. }
  6599. func (s *FsCommand) MarshalJSON() ([]byte, error) {
  6600. type NoMethod FsCommand
  6601. raw := NoMethod(*s)
  6602. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6603. }
  6604. // GeoTargeting: Geographical Targeting.
  6605. type GeoTargeting struct {
  6606. // Cities: Cities to be targeted. For each city only dartId is required.
  6607. // The other fields are populated automatically when the ad is inserted
  6608. // or updated. If targeting a city, do not target or exclude the country
  6609. // of the city, and do not target the metro or region of the city.
  6610. Cities []*City `json:"cities,omitempty"`
  6611. // Countries: Countries to be targeted or excluded from targeting,
  6612. // depending on the setting of the excludeCountries field. For each
  6613. // country only dartId is required. The other fields are populated
  6614. // automatically when the ad is inserted or updated. If targeting or
  6615. // excluding a country, do not target regions, cities, metros, or postal
  6616. // codes in the same country.
  6617. Countries []*Country `json:"countries,omitempty"`
  6618. // ExcludeCountries: Whether or not to exclude the countries in the
  6619. // countries field from targeting. If false, the countries field refers
  6620. // to countries which will be targeted by the ad.
  6621. ExcludeCountries bool `json:"excludeCountries,omitempty"`
  6622. // Metros: Metros to be targeted. For each metro only dmaId is required.
  6623. // The other fields are populated automatically when the ad is inserted
  6624. // or updated. If targeting a metro, do not target or exclude the
  6625. // country of the metro.
  6626. Metros []*Metro `json:"metros,omitempty"`
  6627. // PostalCodes: Postal codes to be targeted. For each postal code only
  6628. // id is required. The other fields are populated automatically when the
  6629. // ad is inserted or updated. If targeting a postal code, do not target
  6630. // or exclude the country of the postal code.
  6631. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  6632. // Regions: Regions to be targeted. For each region only dartId is
  6633. // required. The other fields are populated automatically when the ad is
  6634. // inserted or updated. If targeting a region, do not target or exclude
  6635. // the country of the region.
  6636. Regions []*Region `json:"regions,omitempty"`
  6637. // ForceSendFields is a list of field names (e.g. "Cities") to
  6638. // unconditionally include in API requests. By default, fields with
  6639. // empty values are omitted from API requests. However, any non-pointer,
  6640. // non-interface field appearing in ForceSendFields will be sent to the
  6641. // server regardless of whether the field is empty or not. This may be
  6642. // used to include empty fields in Patch requests.
  6643. ForceSendFields []string `json:"-"`
  6644. // NullFields is a list of field names (e.g. "Cities") to include in API
  6645. // requests with the JSON null value. By default, fields with empty
  6646. // values are omitted from API requests. However, any field with an
  6647. // empty value appearing in NullFields will be sent to the server as
  6648. // null. It is an error if a field in this list has a non-empty value.
  6649. // This may be used to include null fields in Patch requests.
  6650. NullFields []string `json:"-"`
  6651. }
  6652. func (s *GeoTargeting) MarshalJSON() ([]byte, error) {
  6653. type NoMethod GeoTargeting
  6654. raw := NoMethod(*s)
  6655. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6656. }
  6657. // InventoryItem: Represents a buy from the DoubleClick Planning
  6658. // inventory store.
  6659. type InventoryItem struct {
  6660. // AccountId: Account ID of this inventory item.
  6661. AccountId int64 `json:"accountId,omitempty,string"`
  6662. // AdSlots: Ad slots of this inventory item. If this inventory item
  6663. // represents a standalone placement, there will be exactly one ad slot.
  6664. // If this inventory item represents a placement group, there will be
  6665. // more than one ad slot, each representing one child placement in that
  6666. // placement group.
  6667. AdSlots []*AdSlot `json:"adSlots,omitempty"`
  6668. // AdvertiserId: Advertiser ID of this inventory item.
  6669. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  6670. // ContentCategoryId: Content category ID of this inventory item.
  6671. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  6672. // EstimatedClickThroughRate: Estimated click-through rate of this
  6673. // inventory item.
  6674. EstimatedClickThroughRate int64 `json:"estimatedClickThroughRate,omitempty,string"`
  6675. // EstimatedConversionRate: Estimated conversion rate of this inventory
  6676. // item.
  6677. EstimatedConversionRate int64 `json:"estimatedConversionRate,omitempty,string"`
  6678. // Id: ID of this inventory item.
  6679. Id int64 `json:"id,omitempty,string"`
  6680. // InPlan: Whether this inventory item is in plan.
  6681. InPlan bool `json:"inPlan,omitempty"`
  6682. // Kind: Identifies what kind of resource this is. Value: the fixed
  6683. // string "dfareporting#inventoryItem".
  6684. Kind string `json:"kind,omitempty"`
  6685. // LastModifiedInfo: Information about the most recent modification of
  6686. // this inventory item.
  6687. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  6688. // Name: Name of this inventory item. For standalone inventory items,
  6689. // this is the same name as that of its only ad slot. For group
  6690. // inventory items, this can differ from the name of any of its ad
  6691. // slots.
  6692. Name string `json:"name,omitempty"`
  6693. // NegotiationChannelId: Negotiation channel ID of this inventory item.
  6694. NegotiationChannelId int64 `json:"negotiationChannelId,omitempty,string"`
  6695. // OrderId: Order ID of this inventory item.
  6696. OrderId int64 `json:"orderId,omitempty,string"`
  6697. // PlacementStrategyId: Placement strategy ID of this inventory item.
  6698. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  6699. // Pricing: Pricing of this inventory item.
  6700. Pricing *Pricing `json:"pricing,omitempty"`
  6701. // ProjectId: Project ID of this inventory item.
  6702. ProjectId int64 `json:"projectId,omitempty,string"`
  6703. // RfpId: RFP ID of this inventory item.
  6704. RfpId int64 `json:"rfpId,omitempty,string"`
  6705. // SiteId: ID of the site this inventory item is associated with.
  6706. SiteId int64 `json:"siteId,omitempty,string"`
  6707. // SubaccountId: Subaccount ID of this inventory item.
  6708. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  6709. // Type: Type of inventory item.
  6710. //
  6711. // Possible values:
  6712. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  6713. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  6714. Type string `json:"type,omitempty"`
  6715. // ServerResponse contains the HTTP response code and headers from the
  6716. // server.
  6717. googleapi.ServerResponse `json:"-"`
  6718. // ForceSendFields is a list of field names (e.g. "AccountId") to
  6719. // unconditionally include in API requests. By default, fields with
  6720. // empty values are omitted from API requests. However, any non-pointer,
  6721. // non-interface field appearing in ForceSendFields will be sent to the
  6722. // server regardless of whether the field is empty or not. This may be
  6723. // used to include empty fields in Patch requests.
  6724. ForceSendFields []string `json:"-"`
  6725. // NullFields is a list of field names (e.g. "AccountId") to include in
  6726. // API requests with the JSON null value. By default, fields with empty
  6727. // values are omitted from API requests. However, any field with an
  6728. // empty value appearing in NullFields will be sent to the server as
  6729. // null. It is an error if a field in this list has a non-empty value.
  6730. // This may be used to include null fields in Patch requests.
  6731. NullFields []string `json:"-"`
  6732. }
  6733. func (s *InventoryItem) MarshalJSON() ([]byte, error) {
  6734. type NoMethod InventoryItem
  6735. raw := NoMethod(*s)
  6736. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6737. }
  6738. // InventoryItemsListResponse: Inventory item List Response
  6739. type InventoryItemsListResponse struct {
  6740. // InventoryItems: Inventory item collection
  6741. InventoryItems []*InventoryItem `json:"inventoryItems,omitempty"`
  6742. // Kind: Identifies what kind of resource this is. Value: the fixed
  6743. // string "dfareporting#inventoryItemsListResponse".
  6744. Kind string `json:"kind,omitempty"`
  6745. // NextPageToken: Pagination token to be used for the next list
  6746. // operation.
  6747. NextPageToken string `json:"nextPageToken,omitempty"`
  6748. // ServerResponse contains the HTTP response code and headers from the
  6749. // server.
  6750. googleapi.ServerResponse `json:"-"`
  6751. // ForceSendFields is a list of field names (e.g. "InventoryItems") to
  6752. // unconditionally include in API requests. By default, fields with
  6753. // empty values are omitted from API requests. However, any non-pointer,
  6754. // non-interface field appearing in ForceSendFields will be sent to the
  6755. // server regardless of whether the field is empty or not. This may be
  6756. // used to include empty fields in Patch requests.
  6757. ForceSendFields []string `json:"-"`
  6758. // NullFields is a list of field names (e.g. "InventoryItems") to
  6759. // include in API requests with the JSON null value. By default, fields
  6760. // with empty values are omitted from API requests. However, any field
  6761. // with an empty value appearing in NullFields will be sent to the
  6762. // server as null. It is an error if a field in this list has a
  6763. // non-empty value. This may be used to include null fields in Patch
  6764. // requests.
  6765. NullFields []string `json:"-"`
  6766. }
  6767. func (s *InventoryItemsListResponse) MarshalJSON() ([]byte, error) {
  6768. type NoMethod InventoryItemsListResponse
  6769. raw := NoMethod(*s)
  6770. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6771. }
  6772. // KeyValueTargetingExpression: Key Value Targeting Expression.
  6773. type KeyValueTargetingExpression struct {
  6774. // Expression: Keyword expression being targeted by the ad.
  6775. Expression string `json:"expression,omitempty"`
  6776. // ForceSendFields is a list of field names (e.g. "Expression") to
  6777. // unconditionally include in API requests. By default, fields with
  6778. // empty values are omitted from API requests. However, any non-pointer,
  6779. // non-interface field appearing in ForceSendFields will be sent to the
  6780. // server regardless of whether the field is empty or not. This may be
  6781. // used to include empty fields in Patch requests.
  6782. ForceSendFields []string `json:"-"`
  6783. // NullFields is a list of field names (e.g. "Expression") to include in
  6784. // API requests with the JSON null value. By default, fields with empty
  6785. // values are omitted from API requests. However, any field with an
  6786. // empty value appearing in NullFields will be sent to the server as
  6787. // null. It is an error if a field in this list has a non-empty value.
  6788. // This may be used to include null fields in Patch requests.
  6789. NullFields []string `json:"-"`
  6790. }
  6791. func (s *KeyValueTargetingExpression) MarshalJSON() ([]byte, error) {
  6792. type NoMethod KeyValueTargetingExpression
  6793. raw := NoMethod(*s)
  6794. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6795. }
  6796. // LandingPage: Contains information about where a user's browser is
  6797. // taken after the user clicks an ad.
  6798. type LandingPage struct {
  6799. // Default: Whether or not this landing page will be assigned to any ads
  6800. // or creatives that do not have a landing page assigned explicitly.
  6801. // Only one default landing page is allowed per campaign.
  6802. Default bool `json:"default,omitempty"`
  6803. // Id: ID of this landing page. This is a read-only, auto-generated
  6804. // field.
  6805. Id int64 `json:"id,omitempty,string"`
  6806. // Kind: Identifies what kind of resource this is. Value: the fixed
  6807. // string "dfareporting#landingPage".
  6808. Kind string `json:"kind,omitempty"`
  6809. // Name: Name of this landing page. This is a required field. It must be
  6810. // less than 256 characters long, and must be unique among landing pages
  6811. // of the same campaign.
  6812. Name string `json:"name,omitempty"`
  6813. // Url: URL of this landing page. This is a required field.
  6814. Url string `json:"url,omitempty"`
  6815. // ServerResponse contains the HTTP response code and headers from the
  6816. // server.
  6817. googleapi.ServerResponse `json:"-"`
  6818. // ForceSendFields is a list of field names (e.g. "Default") to
  6819. // unconditionally include in API requests. By default, fields with
  6820. // empty values are omitted from API requests. However, any non-pointer,
  6821. // non-interface field appearing in ForceSendFields will be sent to the
  6822. // server regardless of whether the field is empty or not. This may be
  6823. // used to include empty fields in Patch requests.
  6824. ForceSendFields []string `json:"-"`
  6825. // NullFields is a list of field names (e.g. "Default") to include in
  6826. // API requests with the JSON null value. By default, fields with empty
  6827. // values are omitted from API requests. However, any field with an
  6828. // empty value appearing in NullFields will be sent to the server as
  6829. // null. It is an error if a field in this list has a non-empty value.
  6830. // This may be used to include null fields in Patch requests.
  6831. NullFields []string `json:"-"`
  6832. }
  6833. func (s *LandingPage) MarshalJSON() ([]byte, error) {
  6834. type NoMethod LandingPage
  6835. raw := NoMethod(*s)
  6836. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6837. }
  6838. // LandingPagesListResponse: Landing Page List Response
  6839. type LandingPagesListResponse struct {
  6840. // Kind: Identifies what kind of resource this is. Value: the fixed
  6841. // string "dfareporting#landingPagesListResponse".
  6842. Kind string `json:"kind,omitempty"`
  6843. // LandingPages: Landing page collection
  6844. LandingPages []*LandingPage `json:"landingPages,omitempty"`
  6845. // ServerResponse contains the HTTP response code and headers from the
  6846. // server.
  6847. googleapi.ServerResponse `json:"-"`
  6848. // ForceSendFields is a list of field names (e.g. "Kind") to
  6849. // unconditionally include in API requests. By default, fields with
  6850. // empty values are omitted from API requests. However, any non-pointer,
  6851. // non-interface field appearing in ForceSendFields will be sent to the
  6852. // server regardless of whether the field is empty or not. This may be
  6853. // used to include empty fields in Patch requests.
  6854. ForceSendFields []string `json:"-"`
  6855. // NullFields is a list of field names (e.g. "Kind") to include in API
  6856. // requests with the JSON null value. By default, fields with empty
  6857. // values are omitted from API requests. However, any field with an
  6858. // empty value appearing in NullFields will be sent to the server as
  6859. // null. It is an error if a field in this list has a non-empty value.
  6860. // This may be used to include null fields in Patch requests.
  6861. NullFields []string `json:"-"`
  6862. }
  6863. func (s *LandingPagesListResponse) MarshalJSON() ([]byte, error) {
  6864. type NoMethod LandingPagesListResponse
  6865. raw := NoMethod(*s)
  6866. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6867. }
  6868. // Language: Contains information about a language that can be targeted
  6869. // by ads.
  6870. type Language struct {
  6871. // Id: Language ID of this language. This is the ID used for targeting
  6872. // and generating reports.
  6873. Id int64 `json:"id,omitempty,string"`
  6874. // Kind: Identifies what kind of resource this is. Value: the fixed
  6875. // string "dfareporting#language".
  6876. Kind string `json:"kind,omitempty"`
  6877. // LanguageCode: Format of language code is an ISO 639 two-letter
  6878. // language code optionally followed by an underscore followed by an ISO
  6879. // 3166 code. Examples are "en" for English or "zh_CN" for Simplified
  6880. // Chinese.
  6881. LanguageCode string `json:"languageCode,omitempty"`
  6882. // Name: Name of this language.
  6883. Name string `json:"name,omitempty"`
  6884. // ForceSendFields is a list of field names (e.g. "Id") to
  6885. // unconditionally include in API requests. By default, fields with
  6886. // empty values are omitted from API requests. However, any non-pointer,
  6887. // non-interface field appearing in ForceSendFields will be sent to the
  6888. // server regardless of whether the field is empty or not. This may be
  6889. // used to include empty fields in Patch requests.
  6890. ForceSendFields []string `json:"-"`
  6891. // NullFields is a list of field names (e.g. "Id") to include in API
  6892. // requests with the JSON null value. By default, fields with empty
  6893. // values are omitted from API requests. However, any field with an
  6894. // empty value appearing in NullFields will be sent to the server as
  6895. // null. It is an error if a field in this list has a non-empty value.
  6896. // This may be used to include null fields in Patch requests.
  6897. NullFields []string `json:"-"`
  6898. }
  6899. func (s *Language) MarshalJSON() ([]byte, error) {
  6900. type NoMethod Language
  6901. raw := NoMethod(*s)
  6902. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6903. }
  6904. // LanguageTargeting: Language Targeting.
  6905. type LanguageTargeting struct {
  6906. // Languages: Languages that this ad targets. For each language only
  6907. // languageId is required. The other fields are populated automatically
  6908. // when the ad is inserted or updated.
  6909. Languages []*Language `json:"languages,omitempty"`
  6910. // ForceSendFields is a list of field names (e.g. "Languages") to
  6911. // unconditionally include in API requests. By default, fields with
  6912. // empty values are omitted from API requests. However, any non-pointer,
  6913. // non-interface field appearing in ForceSendFields will be sent to the
  6914. // server regardless of whether the field is empty or not. This may be
  6915. // used to include empty fields in Patch requests.
  6916. ForceSendFields []string `json:"-"`
  6917. // NullFields is a list of field names (e.g. "Languages") to include in
  6918. // API requests with the JSON null value. By default, fields with empty
  6919. // values are omitted from API requests. However, any field with an
  6920. // empty value appearing in NullFields will be sent to the server as
  6921. // null. It is an error if a field in this list has a non-empty value.
  6922. // This may be used to include null fields in Patch requests.
  6923. NullFields []string `json:"-"`
  6924. }
  6925. func (s *LanguageTargeting) MarshalJSON() ([]byte, error) {
  6926. type NoMethod LanguageTargeting
  6927. raw := NoMethod(*s)
  6928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6929. }
  6930. // LanguagesListResponse: Language List Response
  6931. type LanguagesListResponse struct {
  6932. // Kind: Identifies what kind of resource this is. Value: the fixed
  6933. // string "dfareporting#languagesListResponse".
  6934. Kind string `json:"kind,omitempty"`
  6935. // Languages: Language collection.
  6936. Languages []*Language `json:"languages,omitempty"`
  6937. // ServerResponse contains the HTTP response code and headers from the
  6938. // server.
  6939. googleapi.ServerResponse `json:"-"`
  6940. // ForceSendFields is a list of field names (e.g. "Kind") to
  6941. // unconditionally include in API requests. By default, fields with
  6942. // empty values are omitted from API requests. However, any non-pointer,
  6943. // non-interface field appearing in ForceSendFields will be sent to the
  6944. // server regardless of whether the field is empty or not. This may be
  6945. // used to include empty fields in Patch requests.
  6946. ForceSendFields []string `json:"-"`
  6947. // NullFields is a list of field names (e.g. "Kind") to include in API
  6948. // requests with the JSON null value. By default, fields with empty
  6949. // values are omitted from API requests. However, any field with an
  6950. // empty value appearing in NullFields will be sent to the server as
  6951. // null. It is an error if a field in this list has a non-empty value.
  6952. // This may be used to include null fields in Patch requests.
  6953. NullFields []string `json:"-"`
  6954. }
  6955. func (s *LanguagesListResponse) MarshalJSON() ([]byte, error) {
  6956. type NoMethod LanguagesListResponse
  6957. raw := NoMethod(*s)
  6958. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6959. }
  6960. // LastModifiedInfo: Modification timestamp.
  6961. type LastModifiedInfo struct {
  6962. // Time: Timestamp of the last change in milliseconds since epoch.
  6963. Time int64 `json:"time,omitempty,string"`
  6964. // ForceSendFields is a list of field names (e.g. "Time") to
  6965. // unconditionally include in API requests. By default, fields with
  6966. // empty values are omitted from API requests. However, any non-pointer,
  6967. // non-interface field appearing in ForceSendFields will be sent to the
  6968. // server regardless of whether the field is empty or not. This may be
  6969. // used to include empty fields in Patch requests.
  6970. ForceSendFields []string `json:"-"`
  6971. // NullFields is a list of field names (e.g. "Time") to include in API
  6972. // requests with the JSON null value. By default, fields with empty
  6973. // values are omitted from API requests. However, any field with an
  6974. // empty value appearing in NullFields will be sent to the server as
  6975. // null. It is an error if a field in this list has a non-empty value.
  6976. // This may be used to include null fields in Patch requests.
  6977. NullFields []string `json:"-"`
  6978. }
  6979. func (s *LastModifiedInfo) MarshalJSON() ([]byte, error) {
  6980. type NoMethod LastModifiedInfo
  6981. raw := NoMethod(*s)
  6982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  6983. }
  6984. // ListPopulationClause: A group clause made up of list population terms
  6985. // representing constraints joined by ORs.
  6986. type ListPopulationClause struct {
  6987. // Terms: Terms of this list population clause. Each clause is made up
  6988. // of list population terms representing constraints and are joined by
  6989. // ORs.
  6990. Terms []*ListPopulationTerm `json:"terms,omitempty"`
  6991. // ForceSendFields is a list of field names (e.g. "Terms") to
  6992. // unconditionally include in API requests. By default, fields with
  6993. // empty values are omitted from API requests. However, any non-pointer,
  6994. // non-interface field appearing in ForceSendFields will be sent to the
  6995. // server regardless of whether the field is empty or not. This may be
  6996. // used to include empty fields in Patch requests.
  6997. ForceSendFields []string `json:"-"`
  6998. // NullFields is a list of field names (e.g. "Terms") to include in API
  6999. // requests with the JSON null value. By default, fields with empty
  7000. // values are omitted from API requests. However, any field with an
  7001. // empty value appearing in NullFields will be sent to the server as
  7002. // null. It is an error if a field in this list has a non-empty value.
  7003. // This may be used to include null fields in Patch requests.
  7004. NullFields []string `json:"-"`
  7005. }
  7006. func (s *ListPopulationClause) MarshalJSON() ([]byte, error) {
  7007. type NoMethod ListPopulationClause
  7008. raw := NoMethod(*s)
  7009. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7010. }
  7011. // ListPopulationRule: Remarketing List Population Rule.
  7012. type ListPopulationRule struct {
  7013. // FloodlightActivityId: Floodlight activity ID associated with this
  7014. // rule. This field can be left blank.
  7015. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7016. // FloodlightActivityName: Name of floodlight activity associated with
  7017. // this rule. This is a read-only, auto-generated field.
  7018. FloodlightActivityName string `json:"floodlightActivityName,omitempty"`
  7019. // ListPopulationClauses: Clauses that make up this list population
  7020. // rule. Clauses are joined by ANDs, and the clauses themselves are made
  7021. // up of list population terms which are joined by ORs.
  7022. ListPopulationClauses []*ListPopulationClause `json:"listPopulationClauses,omitempty"`
  7023. // ForceSendFields is a list of field names (e.g.
  7024. // "FloodlightActivityId") to unconditionally include in API requests.
  7025. // By default, fields with empty values are omitted from API requests.
  7026. // However, any non-pointer, non-interface field appearing in
  7027. // ForceSendFields will be sent to the server regardless of whether the
  7028. // field is empty or not. This may be used to include empty fields in
  7029. // Patch requests.
  7030. ForceSendFields []string `json:"-"`
  7031. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7032. // include in API requests with the JSON null value. By default, fields
  7033. // with empty values are omitted from API requests. However, any field
  7034. // with an empty value appearing in NullFields will be sent to the
  7035. // server as null. It is an error if a field in this list has a
  7036. // non-empty value. This may be used to include null fields in Patch
  7037. // requests.
  7038. NullFields []string `json:"-"`
  7039. }
  7040. func (s *ListPopulationRule) MarshalJSON() ([]byte, error) {
  7041. type NoMethod ListPopulationRule
  7042. raw := NoMethod(*s)
  7043. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7044. }
  7045. // ListPopulationTerm: Remarketing List Population Rule Term.
  7046. type ListPopulationTerm struct {
  7047. // Contains: Will be true if the term should check if the user is in the
  7048. // list and false if the term should check if the user is not in the
  7049. // list. This field is only relevant when type is set to
  7050. // LIST_MEMBERSHIP_TERM. False by default.
  7051. Contains bool `json:"contains,omitempty"`
  7052. // Negation: Whether to negate the comparison result of this term during
  7053. // rule evaluation. This field is only relevant when type is left unset
  7054. // or set to CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7055. Negation bool `json:"negation,omitempty"`
  7056. // Operator: Comparison operator of this term. This field is only
  7057. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7058. // REFERRER_TERM.
  7059. //
  7060. // Possible values:
  7061. // "NUM_EQUALS"
  7062. // "NUM_GREATER_THAN"
  7063. // "NUM_GREATER_THAN_EQUAL"
  7064. // "NUM_LESS_THAN"
  7065. // "NUM_LESS_THAN_EQUAL"
  7066. // "STRING_CONTAINS"
  7067. // "STRING_EQUALS"
  7068. Operator string `json:"operator,omitempty"`
  7069. // RemarketingListId: ID of the list in question. This field is only
  7070. // relevant when type is set to LIST_MEMBERSHIP_TERM.
  7071. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  7072. // Type: List population term type determines the applicable fields in
  7073. // this object. If left unset or set to CUSTOM_VARIABLE_TERM, then
  7074. // variableName, variableFriendlyName, operator, value, and negation are
  7075. // applicable. If set to LIST_MEMBERSHIP_TERM then remarketingListId and
  7076. // contains are applicable. If set to REFERRER_TERM then operator,
  7077. // value, and negation are applicable.
  7078. //
  7079. // Possible values:
  7080. // "CUSTOM_VARIABLE_TERM"
  7081. // "LIST_MEMBERSHIP_TERM"
  7082. // "REFERRER_TERM"
  7083. Type string `json:"type,omitempty"`
  7084. // Value: Literal to compare the variable to. This field is only
  7085. // relevant when type is left unset or set to CUSTOM_VARIABLE_TERM or
  7086. // REFERRER_TERM.
  7087. Value string `json:"value,omitempty"`
  7088. // VariableFriendlyName: Friendly name of this term's variable. This is
  7089. // a read-only, auto-generated field. This field is only relevant when
  7090. // type is left unset or set to CUSTOM_VARIABLE_TERM.
  7091. VariableFriendlyName string `json:"variableFriendlyName,omitempty"`
  7092. // VariableName: Name of the variable (U1, U2, etc.) being compared in
  7093. // this term. This field is only relevant when type is set to null,
  7094. // CUSTOM_VARIABLE_TERM or REFERRER_TERM.
  7095. VariableName string `json:"variableName,omitempty"`
  7096. // ForceSendFields is a list of field names (e.g. "Contains") to
  7097. // unconditionally include in API requests. By default, fields with
  7098. // empty values are omitted from API requests. However, any non-pointer,
  7099. // non-interface field appearing in ForceSendFields will be sent to the
  7100. // server regardless of whether the field is empty or not. This may be
  7101. // used to include empty fields in Patch requests.
  7102. ForceSendFields []string `json:"-"`
  7103. // NullFields is a list of field names (e.g. "Contains") to include in
  7104. // API requests with the JSON null value. By default, fields with empty
  7105. // values are omitted from API requests. However, any field with an
  7106. // empty value appearing in NullFields will be sent to the server as
  7107. // null. It is an error if a field in this list has a non-empty value.
  7108. // This may be used to include null fields in Patch requests.
  7109. NullFields []string `json:"-"`
  7110. }
  7111. func (s *ListPopulationTerm) MarshalJSON() ([]byte, error) {
  7112. type NoMethod ListPopulationTerm
  7113. raw := NoMethod(*s)
  7114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7115. }
  7116. // ListTargetingExpression: Remarketing List Targeting Expression.
  7117. type ListTargetingExpression struct {
  7118. // Expression: Expression describing which lists are being targeted by
  7119. // the ad.
  7120. Expression string `json:"expression,omitempty"`
  7121. // ForceSendFields is a list of field names (e.g. "Expression") to
  7122. // unconditionally include in API requests. By default, fields with
  7123. // empty values are omitted from API requests. However, any non-pointer,
  7124. // non-interface field appearing in ForceSendFields will be sent to the
  7125. // server regardless of whether the field is empty or not. This may be
  7126. // used to include empty fields in Patch requests.
  7127. ForceSendFields []string `json:"-"`
  7128. // NullFields is a list of field names (e.g. "Expression") to include in
  7129. // API requests with the JSON null value. By default, fields with empty
  7130. // values are omitted from API requests. However, any field with an
  7131. // empty value appearing in NullFields will be sent to the server as
  7132. // null. It is an error if a field in this list has a non-empty value.
  7133. // This may be used to include null fields in Patch requests.
  7134. NullFields []string `json:"-"`
  7135. }
  7136. func (s *ListTargetingExpression) MarshalJSON() ([]byte, error) {
  7137. type NoMethod ListTargetingExpression
  7138. raw := NoMethod(*s)
  7139. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7140. }
  7141. // LookbackConfiguration: Lookback configuration settings.
  7142. type LookbackConfiguration struct {
  7143. // ClickDuration: Lookback window, in days, from the last time a given
  7144. // user clicked on one of your ads. If you enter 0, clicks will not be
  7145. // considered as triggering events for floodlight tracking. If you leave
  7146. // this field blank, the default value for your account will be used.
  7147. // Acceptable values are 0 to 90, inclusive.
  7148. ClickDuration int64 `json:"clickDuration,omitempty"`
  7149. // PostImpressionActivitiesDuration: Lookback window, in days, from the
  7150. // last time a given user viewed one of your ads. If you enter 0,
  7151. // impressions will not be considered as triggering events for
  7152. // floodlight tracking. If you leave this field blank, the default value
  7153. // for your account will be used. Acceptable values are 0 to 90,
  7154. // inclusive.
  7155. PostImpressionActivitiesDuration int64 `json:"postImpressionActivitiesDuration,omitempty"`
  7156. // ForceSendFields is a list of field names (e.g. "ClickDuration") to
  7157. // unconditionally include in API requests. By default, fields with
  7158. // empty values are omitted from API requests. However, any non-pointer,
  7159. // non-interface field appearing in ForceSendFields will be sent to the
  7160. // server regardless of whether the field is empty or not. This may be
  7161. // used to include empty fields in Patch requests.
  7162. ForceSendFields []string `json:"-"`
  7163. // NullFields is a list of field names (e.g. "ClickDuration") to include
  7164. // in API requests with the JSON null value. By default, fields with
  7165. // empty values are omitted from API requests. However, any field with
  7166. // an empty value appearing in NullFields will be sent to the server as
  7167. // null. It is an error if a field in this list has a non-empty value.
  7168. // This may be used to include null fields in Patch requests.
  7169. NullFields []string `json:"-"`
  7170. }
  7171. func (s *LookbackConfiguration) MarshalJSON() ([]byte, error) {
  7172. type NoMethod LookbackConfiguration
  7173. raw := NoMethod(*s)
  7174. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7175. }
  7176. // Metric: Represents a metric.
  7177. type Metric struct {
  7178. // Kind: The kind of resource this is, in this case dfareporting#metric.
  7179. Kind string `json:"kind,omitempty"`
  7180. // Name: The metric name, e.g. dfa:impressions
  7181. Name string `json:"name,omitempty"`
  7182. // ForceSendFields is a list of field names (e.g. "Kind") to
  7183. // unconditionally include in API requests. By default, fields with
  7184. // empty values are omitted from API requests. However, any non-pointer,
  7185. // non-interface field appearing in ForceSendFields will be sent to the
  7186. // server regardless of whether the field is empty or not. This may be
  7187. // used to include empty fields in Patch requests.
  7188. ForceSendFields []string `json:"-"`
  7189. // NullFields is a list of field names (e.g. "Kind") to include in API
  7190. // requests with the JSON null value. By default, fields with empty
  7191. // values are omitted from API requests. However, any field with an
  7192. // empty value appearing in NullFields will be sent to the server as
  7193. // null. It is an error if a field in this list has a non-empty value.
  7194. // This may be used to include null fields in Patch requests.
  7195. NullFields []string `json:"-"`
  7196. }
  7197. func (s *Metric) MarshalJSON() ([]byte, error) {
  7198. type NoMethod Metric
  7199. raw := NoMethod(*s)
  7200. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7201. }
  7202. // Metro: Contains information about a metro region that can be targeted
  7203. // by ads.
  7204. type Metro struct {
  7205. // CountryCode: Country code of the country to which this metro region
  7206. // belongs.
  7207. CountryCode string `json:"countryCode,omitempty"`
  7208. // CountryDartId: DART ID of the country to which this metro region
  7209. // belongs.
  7210. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7211. // DartId: DART ID of this metro region.
  7212. DartId int64 `json:"dartId,omitempty,string"`
  7213. // DmaId: DMA ID of this metro region. This is the ID used for targeting
  7214. // and generating reports, and is equivalent to metro_code.
  7215. DmaId int64 `json:"dmaId,omitempty,string"`
  7216. // Kind: Identifies what kind of resource this is. Value: the fixed
  7217. // string "dfareporting#metro".
  7218. Kind string `json:"kind,omitempty"`
  7219. // MetroCode: Metro code of this metro region. This is equivalent to
  7220. // dma_id.
  7221. MetroCode string `json:"metroCode,omitempty"`
  7222. // Name: Name of this metro region.
  7223. Name string `json:"name,omitempty"`
  7224. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7225. // unconditionally include in API requests. By default, fields with
  7226. // empty values are omitted from API requests. However, any non-pointer,
  7227. // non-interface field appearing in ForceSendFields will be sent to the
  7228. // server regardless of whether the field is empty or not. This may be
  7229. // used to include empty fields in Patch requests.
  7230. ForceSendFields []string `json:"-"`
  7231. // NullFields is a list of field names (e.g. "CountryCode") to include
  7232. // in API requests with the JSON null value. By default, fields with
  7233. // empty values are omitted from API requests. However, any field with
  7234. // an empty value appearing in NullFields will be sent to the server as
  7235. // null. It is an error if a field in this list has a non-empty value.
  7236. // This may be used to include null fields in Patch requests.
  7237. NullFields []string `json:"-"`
  7238. }
  7239. func (s *Metro) MarshalJSON() ([]byte, error) {
  7240. type NoMethod Metro
  7241. raw := NoMethod(*s)
  7242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7243. }
  7244. // MetrosListResponse: Metro List Response
  7245. type MetrosListResponse struct {
  7246. // Kind: Identifies what kind of resource this is. Value: the fixed
  7247. // string "dfareporting#metrosListResponse".
  7248. Kind string `json:"kind,omitempty"`
  7249. // Metros: Metro collection.
  7250. Metros []*Metro `json:"metros,omitempty"`
  7251. // ServerResponse contains the HTTP response code and headers from the
  7252. // server.
  7253. googleapi.ServerResponse `json:"-"`
  7254. // ForceSendFields is a list of field names (e.g. "Kind") to
  7255. // unconditionally include in API requests. By default, fields with
  7256. // empty values are omitted from API requests. However, any non-pointer,
  7257. // non-interface field appearing in ForceSendFields will be sent to the
  7258. // server regardless of whether the field is empty or not. This may be
  7259. // used to include empty fields in Patch requests.
  7260. ForceSendFields []string `json:"-"`
  7261. // NullFields is a list of field names (e.g. "Kind") to include in API
  7262. // requests with the JSON null value. By default, fields with empty
  7263. // values are omitted from API requests. However, any field with an
  7264. // empty value appearing in NullFields will be sent to the server as
  7265. // null. It is an error if a field in this list has a non-empty value.
  7266. // This may be used to include null fields in Patch requests.
  7267. NullFields []string `json:"-"`
  7268. }
  7269. func (s *MetrosListResponse) MarshalJSON() ([]byte, error) {
  7270. type NoMethod MetrosListResponse
  7271. raw := NoMethod(*s)
  7272. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7273. }
  7274. // MobileCarrier: Contains information about a mobile carrier that can
  7275. // be targeted by ads.
  7276. type MobileCarrier struct {
  7277. // CountryCode: Country code of the country to which this mobile carrier
  7278. // belongs.
  7279. CountryCode string `json:"countryCode,omitempty"`
  7280. // CountryDartId: DART ID of the country to which this mobile carrier
  7281. // belongs.
  7282. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  7283. // Id: ID of this mobile carrier.
  7284. Id int64 `json:"id,omitempty,string"`
  7285. // Kind: Identifies what kind of resource this is. Value: the fixed
  7286. // string "dfareporting#mobileCarrier".
  7287. Kind string `json:"kind,omitempty"`
  7288. // Name: Name of this mobile carrier.
  7289. Name string `json:"name,omitempty"`
  7290. // ServerResponse contains the HTTP response code and headers from the
  7291. // server.
  7292. googleapi.ServerResponse `json:"-"`
  7293. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  7294. // unconditionally include in API requests. By default, fields with
  7295. // empty values are omitted from API requests. However, any non-pointer,
  7296. // non-interface field appearing in ForceSendFields will be sent to the
  7297. // server regardless of whether the field is empty or not. This may be
  7298. // used to include empty fields in Patch requests.
  7299. ForceSendFields []string `json:"-"`
  7300. // NullFields is a list of field names (e.g. "CountryCode") to include
  7301. // in API requests with the JSON null value. By default, fields with
  7302. // empty values are omitted from API requests. However, any field with
  7303. // an empty value appearing in NullFields will be sent to the server as
  7304. // null. It is an error if a field in this list has a non-empty value.
  7305. // This may be used to include null fields in Patch requests.
  7306. NullFields []string `json:"-"`
  7307. }
  7308. func (s *MobileCarrier) MarshalJSON() ([]byte, error) {
  7309. type NoMethod MobileCarrier
  7310. raw := NoMethod(*s)
  7311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7312. }
  7313. // MobileCarriersListResponse: Mobile Carrier List Response
  7314. type MobileCarriersListResponse struct {
  7315. // Kind: Identifies what kind of resource this is. Value: the fixed
  7316. // string "dfareporting#mobileCarriersListResponse".
  7317. Kind string `json:"kind,omitempty"`
  7318. // MobileCarriers: Mobile carrier collection.
  7319. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  7320. // ServerResponse contains the HTTP response code and headers from the
  7321. // server.
  7322. googleapi.ServerResponse `json:"-"`
  7323. // ForceSendFields is a list of field names (e.g. "Kind") to
  7324. // unconditionally include in API requests. By default, fields with
  7325. // empty values are omitted from API requests. However, any non-pointer,
  7326. // non-interface field appearing in ForceSendFields will be sent to the
  7327. // server regardless of whether the field is empty or not. This may be
  7328. // used to include empty fields in Patch requests.
  7329. ForceSendFields []string `json:"-"`
  7330. // NullFields is a list of field names (e.g. "Kind") to include in API
  7331. // requests with the JSON null value. By default, fields with empty
  7332. // values are omitted from API requests. However, any field with an
  7333. // empty value appearing in NullFields will be sent to the server as
  7334. // null. It is an error if a field in this list has a non-empty value.
  7335. // This may be used to include null fields in Patch requests.
  7336. NullFields []string `json:"-"`
  7337. }
  7338. func (s *MobileCarriersListResponse) MarshalJSON() ([]byte, error) {
  7339. type NoMethod MobileCarriersListResponse
  7340. raw := NoMethod(*s)
  7341. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7342. }
  7343. // ObjectFilter: Object Filter.
  7344. type ObjectFilter struct {
  7345. // Kind: Identifies what kind of resource this is. Value: the fixed
  7346. // string "dfareporting#objectFilter".
  7347. Kind string `json:"kind,omitempty"`
  7348. // ObjectIds: Applicable when status is ASSIGNED. The user has access to
  7349. // objects with these object IDs.
  7350. ObjectIds googleapi.Int64s `json:"objectIds,omitempty"`
  7351. // Status: Status of the filter. NONE means the user has access to none
  7352. // of the objects. ALL means the user has access to all objects.
  7353. // ASSIGNED means the user has access to the objects with IDs in the
  7354. // objectIds list.
  7355. //
  7356. // Possible values:
  7357. // "ALL"
  7358. // "ASSIGNED"
  7359. // "NONE"
  7360. Status string `json:"status,omitempty"`
  7361. // ForceSendFields is a list of field names (e.g. "Kind") to
  7362. // unconditionally include in API requests. By default, fields with
  7363. // empty values are omitted from API requests. However, any non-pointer,
  7364. // non-interface field appearing in ForceSendFields will be sent to the
  7365. // server regardless of whether the field is empty or not. This may be
  7366. // used to include empty fields in Patch requests.
  7367. ForceSendFields []string `json:"-"`
  7368. // NullFields is a list of field names (e.g. "Kind") to include in API
  7369. // requests with the JSON null value. By default, fields with empty
  7370. // values are omitted from API requests. However, any field with an
  7371. // empty value appearing in NullFields will be sent to the server as
  7372. // null. It is an error if a field in this list has a non-empty value.
  7373. // This may be used to include null fields in Patch requests.
  7374. NullFields []string `json:"-"`
  7375. }
  7376. func (s *ObjectFilter) MarshalJSON() ([]byte, error) {
  7377. type NoMethod ObjectFilter
  7378. raw := NoMethod(*s)
  7379. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7380. }
  7381. // OffsetPosition: Offset Position.
  7382. type OffsetPosition struct {
  7383. // Left: Offset distance from left side of an asset or a window.
  7384. Left int64 `json:"left,omitempty"`
  7385. // Top: Offset distance from top side of an asset or a window.
  7386. Top int64 `json:"top,omitempty"`
  7387. // ForceSendFields is a list of field names (e.g. "Left") to
  7388. // unconditionally include in API requests. By default, fields with
  7389. // empty values are omitted from API requests. However, any non-pointer,
  7390. // non-interface field appearing in ForceSendFields will be sent to the
  7391. // server regardless of whether the field is empty or not. This may be
  7392. // used to include empty fields in Patch requests.
  7393. ForceSendFields []string `json:"-"`
  7394. // NullFields is a list of field names (e.g. "Left") to include in API
  7395. // requests with the JSON null value. By default, fields with empty
  7396. // values are omitted from API requests. However, any field with an
  7397. // empty value appearing in NullFields will be sent to the server as
  7398. // null. It is an error if a field in this list has a non-empty value.
  7399. // This may be used to include null fields in Patch requests.
  7400. NullFields []string `json:"-"`
  7401. }
  7402. func (s *OffsetPosition) MarshalJSON() ([]byte, error) {
  7403. type NoMethod OffsetPosition
  7404. raw := NoMethod(*s)
  7405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7406. }
  7407. // OmnitureSettings: Omniture Integration Settings.
  7408. type OmnitureSettings struct {
  7409. // OmnitureCostDataEnabled: Whether placement cost data will be sent to
  7410. // Omniture. This property can be enabled only if
  7411. // omnitureIntegrationEnabled is true.
  7412. OmnitureCostDataEnabled bool `json:"omnitureCostDataEnabled,omitempty"`
  7413. // OmnitureIntegrationEnabled: Whether Omniture integration is enabled.
  7414. // This property can be enabled only when the "Advanced Ad Serving"
  7415. // account setting is enabled.
  7416. OmnitureIntegrationEnabled bool `json:"omnitureIntegrationEnabled,omitempty"`
  7417. // ForceSendFields is a list of field names (e.g.
  7418. // "OmnitureCostDataEnabled") to unconditionally include in API
  7419. // requests. By default, fields with empty values are omitted from API
  7420. // requests. However, any non-pointer, non-interface field appearing in
  7421. // ForceSendFields will be sent to the server regardless of whether the
  7422. // field is empty or not. This may be used to include empty fields in
  7423. // Patch requests.
  7424. ForceSendFields []string `json:"-"`
  7425. // NullFields is a list of field names (e.g. "OmnitureCostDataEnabled")
  7426. // to include in API requests with the JSON null value. By default,
  7427. // fields with empty values are omitted from API requests. However, any
  7428. // field with an empty value appearing in NullFields will be sent to the
  7429. // server as null. It is an error if a field in this list has a
  7430. // non-empty value. This may be used to include null fields in Patch
  7431. // requests.
  7432. NullFields []string `json:"-"`
  7433. }
  7434. func (s *OmnitureSettings) MarshalJSON() ([]byte, error) {
  7435. type NoMethod OmnitureSettings
  7436. raw := NoMethod(*s)
  7437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7438. }
  7439. // OperatingSystem: Contains information about an operating system that
  7440. // can be targeted by ads.
  7441. type OperatingSystem struct {
  7442. // DartId: DART ID of this operating system. This is the ID used for
  7443. // targeting.
  7444. DartId int64 `json:"dartId,omitempty,string"`
  7445. // Desktop: Whether this operating system is for desktop.
  7446. Desktop bool `json:"desktop,omitempty"`
  7447. // Kind: Identifies what kind of resource this is. Value: the fixed
  7448. // string "dfareporting#operatingSystem".
  7449. Kind string `json:"kind,omitempty"`
  7450. // Mobile: Whether this operating system is for mobile.
  7451. Mobile bool `json:"mobile,omitempty"`
  7452. // Name: Name of this operating system.
  7453. Name string `json:"name,omitempty"`
  7454. // ServerResponse contains the HTTP response code and headers from the
  7455. // server.
  7456. googleapi.ServerResponse `json:"-"`
  7457. // ForceSendFields is a list of field names (e.g. "DartId") to
  7458. // unconditionally include in API requests. By default, fields with
  7459. // empty values are omitted from API requests. However, any non-pointer,
  7460. // non-interface field appearing in ForceSendFields will be sent to the
  7461. // server regardless of whether the field is empty or not. This may be
  7462. // used to include empty fields in Patch requests.
  7463. ForceSendFields []string `json:"-"`
  7464. // NullFields is a list of field names (e.g. "DartId") to include in API
  7465. // requests with the JSON null value. By default, fields with empty
  7466. // values are omitted from API requests. However, any field with an
  7467. // empty value appearing in NullFields will be sent to the server as
  7468. // null. It is an error if a field in this list has a non-empty value.
  7469. // This may be used to include null fields in Patch requests.
  7470. NullFields []string `json:"-"`
  7471. }
  7472. func (s *OperatingSystem) MarshalJSON() ([]byte, error) {
  7473. type NoMethod OperatingSystem
  7474. raw := NoMethod(*s)
  7475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7476. }
  7477. // OperatingSystemVersion: Contains information about a particular
  7478. // version of an operating system that can be targeted by ads.
  7479. type OperatingSystemVersion struct {
  7480. // Id: ID of this operating system version.
  7481. Id int64 `json:"id,omitempty,string"`
  7482. // Kind: Identifies what kind of resource this is. Value: the fixed
  7483. // string "dfareporting#operatingSystemVersion".
  7484. Kind string `json:"kind,omitempty"`
  7485. // MajorVersion: Major version (leftmost number) of this operating
  7486. // system version.
  7487. MajorVersion string `json:"majorVersion,omitempty"`
  7488. // MinorVersion: Minor version (number after the first dot) of this
  7489. // operating system version.
  7490. MinorVersion string `json:"minorVersion,omitempty"`
  7491. // Name: Name of this operating system version.
  7492. Name string `json:"name,omitempty"`
  7493. // OperatingSystem: Operating system of this operating system version.
  7494. OperatingSystem *OperatingSystem `json:"operatingSystem,omitempty"`
  7495. // ServerResponse contains the HTTP response code and headers from the
  7496. // server.
  7497. googleapi.ServerResponse `json:"-"`
  7498. // ForceSendFields is a list of field names (e.g. "Id") to
  7499. // unconditionally include in API requests. By default, fields with
  7500. // empty values are omitted from API requests. However, any non-pointer,
  7501. // non-interface field appearing in ForceSendFields will be sent to the
  7502. // server regardless of whether the field is empty or not. This may be
  7503. // used to include empty fields in Patch requests.
  7504. ForceSendFields []string `json:"-"`
  7505. // NullFields is a list of field names (e.g. "Id") to include in API
  7506. // requests with the JSON null value. By default, fields with empty
  7507. // values are omitted from API requests. However, any field with an
  7508. // empty value appearing in NullFields will be sent to the server as
  7509. // null. It is an error if a field in this list has a non-empty value.
  7510. // This may be used to include null fields in Patch requests.
  7511. NullFields []string `json:"-"`
  7512. }
  7513. func (s *OperatingSystemVersion) MarshalJSON() ([]byte, error) {
  7514. type NoMethod OperatingSystemVersion
  7515. raw := NoMethod(*s)
  7516. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7517. }
  7518. // OperatingSystemVersionsListResponse: Operating System Version List
  7519. // Response
  7520. type OperatingSystemVersionsListResponse struct {
  7521. // Kind: Identifies what kind of resource this is. Value: the fixed
  7522. // string "dfareporting#operatingSystemVersionsListResponse".
  7523. Kind string `json:"kind,omitempty"`
  7524. // OperatingSystemVersions: Operating system version collection.
  7525. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  7526. // ServerResponse contains the HTTP response code and headers from the
  7527. // server.
  7528. googleapi.ServerResponse `json:"-"`
  7529. // ForceSendFields is a list of field names (e.g. "Kind") to
  7530. // unconditionally include in API requests. By default, fields with
  7531. // empty values are omitted from API requests. However, any non-pointer,
  7532. // non-interface field appearing in ForceSendFields will be sent to the
  7533. // server regardless of whether the field is empty or not. This may be
  7534. // used to include empty fields in Patch requests.
  7535. ForceSendFields []string `json:"-"`
  7536. // NullFields is a list of field names (e.g. "Kind") to include in API
  7537. // requests with the JSON null value. By default, fields with empty
  7538. // values are omitted from API requests. However, any field with an
  7539. // empty value appearing in NullFields will be sent to the server as
  7540. // null. It is an error if a field in this list has a non-empty value.
  7541. // This may be used to include null fields in Patch requests.
  7542. NullFields []string `json:"-"`
  7543. }
  7544. func (s *OperatingSystemVersionsListResponse) MarshalJSON() ([]byte, error) {
  7545. type NoMethod OperatingSystemVersionsListResponse
  7546. raw := NoMethod(*s)
  7547. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7548. }
  7549. // OperatingSystemsListResponse: Operating System List Response
  7550. type OperatingSystemsListResponse struct {
  7551. // Kind: Identifies what kind of resource this is. Value: the fixed
  7552. // string "dfareporting#operatingSystemsListResponse".
  7553. Kind string `json:"kind,omitempty"`
  7554. // OperatingSystems: Operating system collection.
  7555. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  7556. // ServerResponse contains the HTTP response code and headers from the
  7557. // server.
  7558. googleapi.ServerResponse `json:"-"`
  7559. // ForceSendFields is a list of field names (e.g. "Kind") to
  7560. // unconditionally include in API requests. By default, fields with
  7561. // empty values are omitted from API requests. However, any non-pointer,
  7562. // non-interface field appearing in ForceSendFields will be sent to the
  7563. // server regardless of whether the field is empty or not. This may be
  7564. // used to include empty fields in Patch requests.
  7565. ForceSendFields []string `json:"-"`
  7566. // NullFields is a list of field names (e.g. "Kind") to include in API
  7567. // requests with the JSON null value. By default, fields with empty
  7568. // values are omitted from API requests. However, any field with an
  7569. // empty value appearing in NullFields will be sent to the server as
  7570. // null. It is an error if a field in this list has a non-empty value.
  7571. // This may be used to include null fields in Patch requests.
  7572. NullFields []string `json:"-"`
  7573. }
  7574. func (s *OperatingSystemsListResponse) MarshalJSON() ([]byte, error) {
  7575. type NoMethod OperatingSystemsListResponse
  7576. raw := NoMethod(*s)
  7577. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7578. }
  7579. // OptimizationActivity: Creative optimization activity.
  7580. type OptimizationActivity struct {
  7581. // FloodlightActivityId: Floodlight activity ID of this optimization
  7582. // activity. This is a required field.
  7583. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  7584. // FloodlightActivityIdDimensionValue: Dimension value for the ID of the
  7585. // floodlight activity. This is a read-only, auto-generated field.
  7586. FloodlightActivityIdDimensionValue *DimensionValue `json:"floodlightActivityIdDimensionValue,omitempty"`
  7587. // Weight: Weight associated with this optimization. The weight assigned
  7588. // will be understood in proportion to the weights assigned to the other
  7589. // optimization activities. Value must be greater than or equal to 1.
  7590. Weight int64 `json:"weight,omitempty"`
  7591. // ForceSendFields is a list of field names (e.g.
  7592. // "FloodlightActivityId") to unconditionally include in API requests.
  7593. // By default, fields with empty values are omitted from API requests.
  7594. // However, any non-pointer, non-interface field appearing in
  7595. // ForceSendFields will be sent to the server regardless of whether the
  7596. // field is empty or not. This may be used to include empty fields in
  7597. // Patch requests.
  7598. ForceSendFields []string `json:"-"`
  7599. // NullFields is a list of field names (e.g. "FloodlightActivityId") to
  7600. // include in API requests with the JSON null value. By default, fields
  7601. // with empty values are omitted from API requests. However, any field
  7602. // with an empty value appearing in NullFields will be sent to the
  7603. // server as null. It is an error if a field in this list has a
  7604. // non-empty value. This may be used to include null fields in Patch
  7605. // requests.
  7606. NullFields []string `json:"-"`
  7607. }
  7608. func (s *OptimizationActivity) MarshalJSON() ([]byte, error) {
  7609. type NoMethod OptimizationActivity
  7610. raw := NoMethod(*s)
  7611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7612. }
  7613. // Order: Describes properties of a DoubleClick Planning order.
  7614. type Order struct {
  7615. // AccountId: Account ID of this order.
  7616. AccountId int64 `json:"accountId,omitempty,string"`
  7617. // AdvertiserId: Advertiser ID of this order.
  7618. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7619. // ApproverUserProfileIds: IDs for users that have to approve documents
  7620. // created for this order.
  7621. ApproverUserProfileIds googleapi.Int64s `json:"approverUserProfileIds,omitempty"`
  7622. // BuyerInvoiceId: Buyer invoice ID associated with this order.
  7623. BuyerInvoiceId string `json:"buyerInvoiceId,omitempty"`
  7624. // BuyerOrganizationName: Name of the buyer organization.
  7625. BuyerOrganizationName string `json:"buyerOrganizationName,omitempty"`
  7626. // Comments: Comments in this order.
  7627. Comments string `json:"comments,omitempty"`
  7628. // Contacts: Contacts for this order.
  7629. Contacts []*OrderContact `json:"contacts,omitempty"`
  7630. // Id: ID of this order. This is a read-only, auto-generated field.
  7631. Id int64 `json:"id,omitempty,string"`
  7632. // Kind: Identifies what kind of resource this is. Value: the fixed
  7633. // string "dfareporting#order".
  7634. Kind string `json:"kind,omitempty"`
  7635. // LastModifiedInfo: Information about the most recent modification of
  7636. // this order.
  7637. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  7638. // Name: Name of this order.
  7639. Name string `json:"name,omitempty"`
  7640. // Notes: Notes of this order.
  7641. Notes string `json:"notes,omitempty"`
  7642. // PlanningTermId: ID of the terms and conditions template used in this
  7643. // order.
  7644. PlanningTermId int64 `json:"planningTermId,omitempty,string"`
  7645. // ProjectId: Project ID of this order.
  7646. ProjectId int64 `json:"projectId,omitempty,string"`
  7647. // SellerOrderId: Seller order ID associated with this order.
  7648. SellerOrderId string `json:"sellerOrderId,omitempty"`
  7649. // SellerOrganizationName: Name of the seller organization.
  7650. SellerOrganizationName string `json:"sellerOrganizationName,omitempty"`
  7651. // SiteId: Site IDs this order is associated with.
  7652. SiteId googleapi.Int64s `json:"siteId,omitempty"`
  7653. // SiteNames: Free-form site names this order is associated with.
  7654. SiteNames []string `json:"siteNames,omitempty"`
  7655. // SubaccountId: Subaccount ID of this order.
  7656. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7657. // TermsAndConditions: Terms and conditions of this order.
  7658. TermsAndConditions string `json:"termsAndConditions,omitempty"`
  7659. // ServerResponse contains the HTTP response code and headers from the
  7660. // server.
  7661. googleapi.ServerResponse `json:"-"`
  7662. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7663. // unconditionally include in API requests. By default, fields with
  7664. // empty values are omitted from API requests. However, any non-pointer,
  7665. // non-interface field appearing in ForceSendFields will be sent to the
  7666. // server regardless of whether the field is empty or not. This may be
  7667. // used to include empty fields in Patch requests.
  7668. ForceSendFields []string `json:"-"`
  7669. // NullFields is a list of field names (e.g. "AccountId") to include in
  7670. // API requests with the JSON null value. By default, fields with empty
  7671. // values are omitted from API requests. However, any field with an
  7672. // empty value appearing in NullFields will be sent to the server as
  7673. // null. It is an error if a field in this list has a non-empty value.
  7674. // This may be used to include null fields in Patch requests.
  7675. NullFields []string `json:"-"`
  7676. }
  7677. func (s *Order) MarshalJSON() ([]byte, error) {
  7678. type NoMethod Order
  7679. raw := NoMethod(*s)
  7680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7681. }
  7682. // OrderContact: Contact of an order.
  7683. type OrderContact struct {
  7684. // ContactInfo: Free-form information about this contact. It could be
  7685. // any information related to this contact in addition to type, title,
  7686. // name, and signature user profile ID.
  7687. ContactInfo string `json:"contactInfo,omitempty"`
  7688. // ContactName: Name of this contact.
  7689. ContactName string `json:"contactName,omitempty"`
  7690. // ContactTitle: Title of this contact.
  7691. ContactTitle string `json:"contactTitle,omitempty"`
  7692. // ContactType: Type of this contact.
  7693. //
  7694. // Possible values:
  7695. // "PLANNING_ORDER_CONTACT_BUYER_BILLING_CONTACT"
  7696. // "PLANNING_ORDER_CONTACT_BUYER_CONTACT"
  7697. // "PLANNING_ORDER_CONTACT_SELLER_CONTACT"
  7698. ContactType string `json:"contactType,omitempty"`
  7699. // SignatureUserProfileId: ID of the user profile containing the
  7700. // signature that will be embedded into order documents.
  7701. SignatureUserProfileId int64 `json:"signatureUserProfileId,omitempty,string"`
  7702. // ForceSendFields is a list of field names (e.g. "ContactInfo") to
  7703. // unconditionally include in API requests. By default, fields with
  7704. // empty values are omitted from API requests. However, any non-pointer,
  7705. // non-interface field appearing in ForceSendFields will be sent to the
  7706. // server regardless of whether the field is empty or not. This may be
  7707. // used to include empty fields in Patch requests.
  7708. ForceSendFields []string `json:"-"`
  7709. // NullFields is a list of field names (e.g. "ContactInfo") to include
  7710. // in API requests with the JSON null value. By default, fields with
  7711. // empty values are omitted from API requests. However, any field with
  7712. // an empty value appearing in NullFields will be sent to the server as
  7713. // null. It is an error if a field in this list has a non-empty value.
  7714. // This may be used to include null fields in Patch requests.
  7715. NullFields []string `json:"-"`
  7716. }
  7717. func (s *OrderContact) MarshalJSON() ([]byte, error) {
  7718. type NoMethod OrderContact
  7719. raw := NoMethod(*s)
  7720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7721. }
  7722. // OrderDocument: Contains properties of a DoubleClick Planning order
  7723. // document.
  7724. type OrderDocument struct {
  7725. // AccountId: Account ID of this order document.
  7726. AccountId int64 `json:"accountId,omitempty,string"`
  7727. // AdvertiserId: Advertiser ID of this order document.
  7728. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7729. // AmendedOrderDocumentId: The amended order document ID of this order
  7730. // document. An order document can be created by optionally amending
  7731. // another order document so that the change history can be preserved.
  7732. AmendedOrderDocumentId int64 `json:"amendedOrderDocumentId,omitempty,string"`
  7733. // ApprovedByUserProfileIds: IDs of users who have approved this order
  7734. // document.
  7735. ApprovedByUserProfileIds googleapi.Int64s `json:"approvedByUserProfileIds,omitempty"`
  7736. // Cancelled: Whether this order document is cancelled.
  7737. Cancelled bool `json:"cancelled,omitempty"`
  7738. // CreatedInfo: Information about the creation of this order document.
  7739. CreatedInfo *LastModifiedInfo `json:"createdInfo,omitempty"`
  7740. // EffectiveDate: Effective date of this order document.
  7741. EffectiveDate string `json:"effectiveDate,omitempty"`
  7742. // Id: ID of this order document.
  7743. Id int64 `json:"id,omitempty,string"`
  7744. // Kind: Identifies what kind of resource this is. Value: the fixed
  7745. // string "dfareporting#orderDocument".
  7746. Kind string `json:"kind,omitempty"`
  7747. // LastSentRecipients: List of email addresses that received the last
  7748. // sent document.
  7749. LastSentRecipients []string `json:"lastSentRecipients,omitempty"`
  7750. // LastSentTime: Timestamp of the last email sent with this order
  7751. // document.
  7752. LastSentTime string `json:"lastSentTime,omitempty"`
  7753. // OrderId: ID of the order from which this order document is created.
  7754. OrderId int64 `json:"orderId,omitempty,string"`
  7755. // ProjectId: Project ID of this order document.
  7756. ProjectId int64 `json:"projectId,omitempty,string"`
  7757. // Signed: Whether this order document has been signed.
  7758. Signed bool `json:"signed,omitempty"`
  7759. // SubaccountId: Subaccount ID of this order document.
  7760. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  7761. // Title: Title of this order document.
  7762. Title string `json:"title,omitempty"`
  7763. // Type: Type of this order document
  7764. //
  7765. // Possible values:
  7766. // "PLANNING_ORDER_TYPE_CHANGE_ORDER"
  7767. // "PLANNING_ORDER_TYPE_INSERTION_ORDER"
  7768. Type string `json:"type,omitempty"`
  7769. // ServerResponse contains the HTTP response code and headers from the
  7770. // server.
  7771. googleapi.ServerResponse `json:"-"`
  7772. // ForceSendFields is a list of field names (e.g. "AccountId") to
  7773. // unconditionally include in API requests. By default, fields with
  7774. // empty values are omitted from API requests. However, any non-pointer,
  7775. // non-interface field appearing in ForceSendFields will be sent to the
  7776. // server regardless of whether the field is empty or not. This may be
  7777. // used to include empty fields in Patch requests.
  7778. ForceSendFields []string `json:"-"`
  7779. // NullFields is a list of field names (e.g. "AccountId") to include in
  7780. // API requests with the JSON null value. By default, fields with empty
  7781. // values are omitted from API requests. However, any field with an
  7782. // empty value appearing in NullFields will be sent to the server as
  7783. // null. It is an error if a field in this list has a non-empty value.
  7784. // This may be used to include null fields in Patch requests.
  7785. NullFields []string `json:"-"`
  7786. }
  7787. func (s *OrderDocument) MarshalJSON() ([]byte, error) {
  7788. type NoMethod OrderDocument
  7789. raw := NoMethod(*s)
  7790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7791. }
  7792. // OrderDocumentsListResponse: Order document List Response
  7793. type OrderDocumentsListResponse struct {
  7794. // Kind: Identifies what kind of resource this is. Value: the fixed
  7795. // string "dfareporting#orderDocumentsListResponse".
  7796. Kind string `json:"kind,omitempty"`
  7797. // NextPageToken: Pagination token to be used for the next list
  7798. // operation.
  7799. NextPageToken string `json:"nextPageToken,omitempty"`
  7800. // OrderDocuments: Order document collection
  7801. OrderDocuments []*OrderDocument `json:"orderDocuments,omitempty"`
  7802. // ServerResponse contains the HTTP response code and headers from the
  7803. // server.
  7804. googleapi.ServerResponse `json:"-"`
  7805. // ForceSendFields is a list of field names (e.g. "Kind") to
  7806. // unconditionally include in API requests. By default, fields with
  7807. // empty values are omitted from API requests. However, any non-pointer,
  7808. // non-interface field appearing in ForceSendFields will be sent to the
  7809. // server regardless of whether the field is empty or not. This may be
  7810. // used to include empty fields in Patch requests.
  7811. ForceSendFields []string `json:"-"`
  7812. // NullFields is a list of field names (e.g. "Kind") to include in API
  7813. // requests with the JSON null value. By default, fields with empty
  7814. // values are omitted from API requests. However, any field with an
  7815. // empty value appearing in NullFields will be sent to the server as
  7816. // null. It is an error if a field in this list has a non-empty value.
  7817. // This may be used to include null fields in Patch requests.
  7818. NullFields []string `json:"-"`
  7819. }
  7820. func (s *OrderDocumentsListResponse) MarshalJSON() ([]byte, error) {
  7821. type NoMethod OrderDocumentsListResponse
  7822. raw := NoMethod(*s)
  7823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7824. }
  7825. // OrdersListResponse: Order List Response
  7826. type OrdersListResponse struct {
  7827. // Kind: Identifies what kind of resource this is. Value: the fixed
  7828. // string "dfareporting#ordersListResponse".
  7829. Kind string `json:"kind,omitempty"`
  7830. // NextPageToken: Pagination token to be used for the next list
  7831. // operation.
  7832. NextPageToken string `json:"nextPageToken,omitempty"`
  7833. // Orders: Order collection.
  7834. Orders []*Order `json:"orders,omitempty"`
  7835. // ServerResponse contains the HTTP response code and headers from the
  7836. // server.
  7837. googleapi.ServerResponse `json:"-"`
  7838. // ForceSendFields is a list of field names (e.g. "Kind") to
  7839. // unconditionally include in API requests. By default, fields with
  7840. // empty values are omitted from API requests. However, any non-pointer,
  7841. // non-interface field appearing in ForceSendFields will be sent to the
  7842. // server regardless of whether the field is empty or not. This may be
  7843. // used to include empty fields in Patch requests.
  7844. ForceSendFields []string `json:"-"`
  7845. // NullFields is a list of field names (e.g. "Kind") to include in API
  7846. // requests with the JSON null value. By default, fields with empty
  7847. // values are omitted from API requests. However, any field with an
  7848. // empty value appearing in NullFields will be sent to the server as
  7849. // null. It is an error if a field in this list has a non-empty value.
  7850. // This may be used to include null fields in Patch requests.
  7851. NullFields []string `json:"-"`
  7852. }
  7853. func (s *OrdersListResponse) MarshalJSON() ([]byte, error) {
  7854. type NoMethod OrdersListResponse
  7855. raw := NoMethod(*s)
  7856. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7857. }
  7858. // PathToConversionReportCompatibleFields: Represents fields that are
  7859. // compatible to be selected for a report of type "PATH_TO_CONVERSION".
  7860. type PathToConversionReportCompatibleFields struct {
  7861. // ConversionDimensions: Conversion dimensions which are compatible to
  7862. // be selected in the "conversionDimensions" section of the report.
  7863. ConversionDimensions []*Dimension `json:"conversionDimensions,omitempty"`
  7864. // CustomFloodlightVariables: Custom floodlight variables which are
  7865. // compatible to be selected in the "customFloodlightVariables" section
  7866. // of the report.
  7867. CustomFloodlightVariables []*Dimension `json:"customFloodlightVariables,omitempty"`
  7868. // Kind: The kind of resource this is, in this case
  7869. // dfareporting#pathToConversionReportCompatibleFields.
  7870. Kind string `json:"kind,omitempty"`
  7871. // Metrics: Metrics which are compatible to be selected in the
  7872. // "metricNames" section of the report.
  7873. Metrics []*Metric `json:"metrics,omitempty"`
  7874. // PerInteractionDimensions: Per-interaction dimensions which are
  7875. // compatible to be selected in the "perInteractionDimensions" section
  7876. // of the report.
  7877. PerInteractionDimensions []*Dimension `json:"perInteractionDimensions,omitempty"`
  7878. // ForceSendFields is a list of field names (e.g.
  7879. // "ConversionDimensions") to unconditionally include in API requests.
  7880. // By default, fields with empty values are omitted from API requests.
  7881. // However, any non-pointer, non-interface field appearing in
  7882. // ForceSendFields will be sent to the server regardless of whether the
  7883. // field is empty or not. This may be used to include empty fields in
  7884. // Patch requests.
  7885. ForceSendFields []string `json:"-"`
  7886. // NullFields is a list of field names (e.g. "ConversionDimensions") to
  7887. // include in API requests with the JSON null value. By default, fields
  7888. // with empty values are omitted from API requests. However, any field
  7889. // with an empty value appearing in NullFields will be sent to the
  7890. // server as null. It is an error if a field in this list has a
  7891. // non-empty value. This may be used to include null fields in Patch
  7892. // requests.
  7893. NullFields []string `json:"-"`
  7894. }
  7895. func (s *PathToConversionReportCompatibleFields) MarshalJSON() ([]byte, error) {
  7896. type NoMethod PathToConversionReportCompatibleFields
  7897. raw := NoMethod(*s)
  7898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  7899. }
  7900. // Placement: Contains properties of a placement.
  7901. type Placement struct {
  7902. // AccountId: Account ID of this placement. This field can be left
  7903. // blank.
  7904. AccountId int64 `json:"accountId,omitempty,string"`
  7905. // AdvertiserId: Advertiser ID of this placement. This field can be left
  7906. // blank.
  7907. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  7908. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  7909. // advertiser. This is a read-only, auto-generated field.
  7910. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  7911. // Archived: Whether this placement is archived.
  7912. Archived bool `json:"archived,omitempty"`
  7913. // CampaignId: Campaign ID of this placement. This field is a required
  7914. // field on insertion.
  7915. CampaignId int64 `json:"campaignId,omitempty,string"`
  7916. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  7917. // This is a read-only, auto-generated field.
  7918. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  7919. // Comment: Comments for this placement.
  7920. Comment string `json:"comment,omitempty"`
  7921. // Compatibility: Placement compatibility. DISPLAY and
  7922. // DISPLAY_INTERSTITIAL refer to rendering on desktop, on mobile devices
  7923. // or in mobile apps for regular or interstitial ads respectively. APP
  7924. // and APP_INTERSTITIAL are no longer allowed for new placement
  7925. // insertions. Instead, use DISPLAY or DISPLAY_INTERSTITIAL.
  7926. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  7927. // with the VAST standard. This field is required on insertion.
  7928. //
  7929. // Possible values:
  7930. // "APP"
  7931. // "APP_INTERSTITIAL"
  7932. // "DISPLAY"
  7933. // "DISPLAY_INTERSTITIAL"
  7934. // "IN_STREAM_VIDEO"
  7935. Compatibility string `json:"compatibility,omitempty"`
  7936. // ContentCategoryId: ID of the content category assigned to this
  7937. // placement.
  7938. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  7939. // CreateInfo: Information about the creation of this placement. This is
  7940. // a read-only field.
  7941. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  7942. // DirectorySiteId: Directory site ID of this placement. On insert, you
  7943. // must set either this field or the siteId field to specify the site
  7944. // associated with this placement. This is a required field that is
  7945. // read-only after insertion.
  7946. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  7947. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  7948. // directory site. This is a read-only, auto-generated field.
  7949. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  7950. // ExternalId: External ID for this placement.
  7951. ExternalId string `json:"externalId,omitempty"`
  7952. // Id: ID of this placement. This is a read-only, auto-generated field.
  7953. Id int64 `json:"id,omitempty,string"`
  7954. // IdDimensionValue: Dimension value for the ID of this placement. This
  7955. // is a read-only, auto-generated field.
  7956. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  7957. // KeyName: Key name of this placement. This is a read-only,
  7958. // auto-generated field.
  7959. KeyName string `json:"keyName,omitempty"`
  7960. // Kind: Identifies what kind of resource this is. Value: the fixed
  7961. // string "dfareporting#placement".
  7962. Kind string `json:"kind,omitempty"`
  7963. // LastModifiedInfo: Information about the most recent modification of
  7964. // this placement. This is a read-only field.
  7965. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  7966. // LookbackConfiguration: Lookback window settings for this placement.
  7967. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  7968. // Name: Name of this placement.This is a required field and must be
  7969. // less than 256 characters long.
  7970. Name string `json:"name,omitempty"`
  7971. // PaymentApproved: Whether payment was approved for this placement.
  7972. // This is a read-only field relevant only to publisher-paid placements.
  7973. PaymentApproved bool `json:"paymentApproved,omitempty"`
  7974. // PaymentSource: Payment source for this placement. This is a required
  7975. // field that is read-only after insertion.
  7976. //
  7977. // Possible values:
  7978. // "PLACEMENT_AGENCY_PAID"
  7979. // "PLACEMENT_PUBLISHER_PAID"
  7980. PaymentSource string `json:"paymentSource,omitempty"`
  7981. // PlacementGroupId: ID of this placement's group, if applicable.
  7982. PlacementGroupId int64 `json:"placementGroupId,omitempty,string"`
  7983. // PlacementGroupIdDimensionValue: Dimension value for the ID of the
  7984. // placement group. This is a read-only, auto-generated field.
  7985. PlacementGroupIdDimensionValue *DimensionValue `json:"placementGroupIdDimensionValue,omitempty"`
  7986. // PlacementStrategyId: ID of the placement strategy assigned to this
  7987. // placement.
  7988. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  7989. // PricingSchedule: Pricing schedule of this placement. This field is
  7990. // required on insertion, specifically subfields startDate, endDate and
  7991. // pricingType.
  7992. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  7993. // Primary: Whether this placement is the primary placement of a
  7994. // roadblock (placement group). You cannot change this field from true
  7995. // to false. Setting this field to true will automatically set the
  7996. // primary field on the original primary placement of the roadblock to
  7997. // false, and it will automatically set the roadblock's
  7998. // primaryPlacementId field to the ID of this placement.
  7999. Primary bool `json:"primary,omitempty"`
  8000. // PublisherUpdateInfo: Information about the last publisher update.
  8001. // This is a read-only field.
  8002. PublisherUpdateInfo *LastModifiedInfo `json:"publisherUpdateInfo,omitempty"`
  8003. // SiteId: Site ID associated with this placement. On insert, you must
  8004. // set either this field or the directorySiteId field to specify the
  8005. // site associated with this placement. This is a required field that is
  8006. // read-only after insertion.
  8007. SiteId int64 `json:"siteId,omitempty,string"`
  8008. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8009. // a read-only, auto-generated field.
  8010. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8011. // Size: Size associated with this placement. When inserting or updating
  8012. // a placement, only the size ID field is used. This field is required
  8013. // on insertion.
  8014. Size *Size `json:"size,omitempty"`
  8015. // SslRequired: Whether creatives assigned to this placement must be
  8016. // SSL-compliant.
  8017. SslRequired bool `json:"sslRequired,omitempty"`
  8018. // Status: Third-party placement status.
  8019. //
  8020. // Possible values:
  8021. // "ACKNOWLEDGE_ACCEPTANCE"
  8022. // "ACKNOWLEDGE_REJECTION"
  8023. // "DRAFT"
  8024. // "PAYMENT_ACCEPTED"
  8025. // "PAYMENT_REJECTED"
  8026. // "PENDING_REVIEW"
  8027. Status string `json:"status,omitempty"`
  8028. // SubaccountId: Subaccount ID of this placement. This field can be left
  8029. // blank.
  8030. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8031. // TagFormats: Tag formats to generate for this placement. This field is
  8032. // required on insertion.
  8033. // Acceptable values are:
  8034. // - "PLACEMENT_TAG_STANDARD"
  8035. // - "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8036. // - "PLACEMENT_TAG_IFRAME_ILAYER"
  8037. // - "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8038. // - "PLACEMENT_TAG_JAVASCRIPT"
  8039. // - "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8040. // - "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8041. // - "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8042. // - "PLACEMENT_TAG_CLICK_COMMANDS"
  8043. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8044. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8045. // - "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8046. // - "PLACEMENT_TAG_TRACKING"
  8047. // - "PLACEMENT_TAG_TRACKING_IFRAME"
  8048. // - "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8049. //
  8050. // Possible values:
  8051. // "PLACEMENT_TAG_CLICK_COMMANDS"
  8052. // "PLACEMENT_TAG_IFRAME_ILAYER"
  8053. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  8054. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  8055. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  8056. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  8057. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  8058. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  8059. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  8060. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  8061. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  8062. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  8063. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  8064. // "PLACEMENT_TAG_JAVASCRIPT"
  8065. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  8066. // "PLACEMENT_TAG_STANDARD"
  8067. // "PLACEMENT_TAG_TRACKING"
  8068. // "PLACEMENT_TAG_TRACKING_IFRAME"
  8069. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  8070. TagFormats []string `json:"tagFormats,omitempty"`
  8071. // TagSetting: Tag settings for this placement.
  8072. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  8073. // VideoActiveViewOptOut: Whether Verification and ActiveView are
  8074. // disabled for in-stream video creatives for this placement. The same
  8075. // setting videoActiveViewOptOut exists on the site level -- the opt out
  8076. // occurs if either of these settings are true. These settings are
  8077. // distinct from DirectorySites.settings.activeViewOptOut or
  8078. // Sites.siteSettings.activeViewOptOut which only apply to display ads.
  8079. // However, Accounts.activeViewOptOut opts out both video traffic, as
  8080. // well as display ads, from Verification and ActiveView.
  8081. VideoActiveViewOptOut bool `json:"videoActiveViewOptOut,omitempty"`
  8082. // VideoSettings: A collection of settings which affect video creatives
  8083. // served through this placement. Applicable to placements with
  8084. // IN_STREAM_VIDEO compatibility.
  8085. VideoSettings *VideoSettings `json:"videoSettings,omitempty"`
  8086. // VpaidAdapterChoice: VPAID adapter setting for this placement.
  8087. // Controls which VPAID format the measurement adapter will use for
  8088. // in-stream video creatives assigned to this placement.
  8089. //
  8090. // Note: Flash is no longer supported. This field now defaults to HTML5
  8091. // when the following values are provided: FLASH, BOTH.
  8092. //
  8093. // Possible values:
  8094. // "BOTH"
  8095. // "DEFAULT"
  8096. // "FLASH"
  8097. // "HTML5"
  8098. VpaidAdapterChoice string `json:"vpaidAdapterChoice,omitempty"`
  8099. // ServerResponse contains the HTTP response code and headers from the
  8100. // server.
  8101. googleapi.ServerResponse `json:"-"`
  8102. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8103. // unconditionally include in API requests. By default, fields with
  8104. // empty values are omitted from API requests. However, any non-pointer,
  8105. // non-interface field appearing in ForceSendFields will be sent to the
  8106. // server regardless of whether the field is empty or not. This may be
  8107. // used to include empty fields in Patch requests.
  8108. ForceSendFields []string `json:"-"`
  8109. // NullFields is a list of field names (e.g. "AccountId") to include in
  8110. // API requests with the JSON null value. By default, fields with empty
  8111. // values are omitted from API requests. However, any field with an
  8112. // empty value appearing in NullFields will be sent to the server as
  8113. // null. It is an error if a field in this list has a non-empty value.
  8114. // This may be used to include null fields in Patch requests.
  8115. NullFields []string `json:"-"`
  8116. }
  8117. func (s *Placement) MarshalJSON() ([]byte, error) {
  8118. type NoMethod Placement
  8119. raw := NoMethod(*s)
  8120. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8121. }
  8122. // PlacementAssignment: Placement Assignment.
  8123. type PlacementAssignment struct {
  8124. // Active: Whether this placement assignment is active. When true, the
  8125. // placement will be included in the ad's rotation.
  8126. Active bool `json:"active,omitempty"`
  8127. // PlacementId: ID of the placement to be assigned. This is a required
  8128. // field.
  8129. PlacementId int64 `json:"placementId,omitempty,string"`
  8130. // PlacementIdDimensionValue: Dimension value for the ID of the
  8131. // placement. This is a read-only, auto-generated field.
  8132. PlacementIdDimensionValue *DimensionValue `json:"placementIdDimensionValue,omitempty"`
  8133. // SslRequired: Whether the placement to be assigned requires SSL. This
  8134. // is a read-only field that is auto-generated when the ad is inserted
  8135. // or updated.
  8136. SslRequired bool `json:"sslRequired,omitempty"`
  8137. // ForceSendFields is a list of field names (e.g. "Active") to
  8138. // unconditionally include in API requests. By default, fields with
  8139. // empty values are omitted from API requests. However, any non-pointer,
  8140. // non-interface field appearing in ForceSendFields will be sent to the
  8141. // server regardless of whether the field is empty or not. This may be
  8142. // used to include empty fields in Patch requests.
  8143. ForceSendFields []string `json:"-"`
  8144. // NullFields is a list of field names (e.g. "Active") to include in API
  8145. // requests with the JSON null value. By default, fields with empty
  8146. // values are omitted from API requests. However, any field with an
  8147. // empty value appearing in NullFields will be sent to the server as
  8148. // null. It is an error if a field in this list has a non-empty value.
  8149. // This may be used to include null fields in Patch requests.
  8150. NullFields []string `json:"-"`
  8151. }
  8152. func (s *PlacementAssignment) MarshalJSON() ([]byte, error) {
  8153. type NoMethod PlacementAssignment
  8154. raw := NoMethod(*s)
  8155. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8156. }
  8157. // PlacementGroup: Contains properties of a package or roadblock.
  8158. type PlacementGroup struct {
  8159. // AccountId: Account ID of this placement group. This is a read-only
  8160. // field that can be left blank.
  8161. AccountId int64 `json:"accountId,omitempty,string"`
  8162. // AdvertiserId: Advertiser ID of this placement group. This is a
  8163. // required field on insertion.
  8164. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8165. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  8166. // advertiser. This is a read-only, auto-generated field.
  8167. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  8168. // Archived: Whether this placement group is archived.
  8169. Archived bool `json:"archived,omitempty"`
  8170. // CampaignId: Campaign ID of this placement group. This field is
  8171. // required on insertion.
  8172. CampaignId int64 `json:"campaignId,omitempty,string"`
  8173. // CampaignIdDimensionValue: Dimension value for the ID of the campaign.
  8174. // This is a read-only, auto-generated field.
  8175. CampaignIdDimensionValue *DimensionValue `json:"campaignIdDimensionValue,omitempty"`
  8176. // ChildPlacementIds: IDs of placements which are assigned to this
  8177. // placement group. This is a read-only, auto-generated field.
  8178. ChildPlacementIds googleapi.Int64s `json:"childPlacementIds,omitempty"`
  8179. // Comment: Comments for this placement group.
  8180. Comment string `json:"comment,omitempty"`
  8181. // ContentCategoryId: ID of the content category assigned to this
  8182. // placement group.
  8183. ContentCategoryId int64 `json:"contentCategoryId,omitempty,string"`
  8184. // CreateInfo: Information about the creation of this placement group.
  8185. // This is a read-only field.
  8186. CreateInfo *LastModifiedInfo `json:"createInfo,omitempty"`
  8187. // DirectorySiteId: Directory site ID associated with this placement
  8188. // group. On insert, you must set either this field or the site_id field
  8189. // to specify the site associated with this placement group. This is a
  8190. // required field that is read-only after insertion.
  8191. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  8192. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  8193. // directory site. This is a read-only, auto-generated field.
  8194. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  8195. // ExternalId: External ID for this placement.
  8196. ExternalId string `json:"externalId,omitempty"`
  8197. // Id: ID of this placement group. This is a read-only, auto-generated
  8198. // field.
  8199. Id int64 `json:"id,omitempty,string"`
  8200. // IdDimensionValue: Dimension value for the ID of this placement group.
  8201. // This is a read-only, auto-generated field.
  8202. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  8203. // Kind: Identifies what kind of resource this is. Value: the fixed
  8204. // string "dfareporting#placementGroup".
  8205. Kind string `json:"kind,omitempty"`
  8206. // LastModifiedInfo: Information about the most recent modification of
  8207. // this placement group. This is a read-only field.
  8208. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8209. // Name: Name of this placement group. This is a required field and must
  8210. // be less than 256 characters long.
  8211. Name string `json:"name,omitempty"`
  8212. // PlacementGroupType: Type of this placement group. A package is a
  8213. // simple group of placements that acts as a single pricing point for a
  8214. // group of tags. A roadblock is a group of placements that not only
  8215. // acts as a single pricing point, but also assumes that all the tags in
  8216. // it will be served at the same time. A roadblock requires one of its
  8217. // assigned placements to be marked as primary for reporting. This field
  8218. // is required on insertion.
  8219. //
  8220. // Possible values:
  8221. // "PLACEMENT_PACKAGE"
  8222. // "PLACEMENT_ROADBLOCK"
  8223. PlacementGroupType string `json:"placementGroupType,omitempty"`
  8224. // PlacementStrategyId: ID of the placement strategy assigned to this
  8225. // placement group.
  8226. PlacementStrategyId int64 `json:"placementStrategyId,omitempty,string"`
  8227. // PricingSchedule: Pricing schedule of this placement group. This field
  8228. // is required on insertion.
  8229. PricingSchedule *PricingSchedule `json:"pricingSchedule,omitempty"`
  8230. // PrimaryPlacementId: ID of the primary placement, used to calculate
  8231. // the media cost of a roadblock (placement group). Modifying this field
  8232. // will automatically modify the primary field on all affected roadblock
  8233. // child placements.
  8234. PrimaryPlacementId int64 `json:"primaryPlacementId,omitempty,string"`
  8235. // PrimaryPlacementIdDimensionValue: Dimension value for the ID of the
  8236. // primary placement. This is a read-only, auto-generated field.
  8237. PrimaryPlacementIdDimensionValue *DimensionValue `json:"primaryPlacementIdDimensionValue,omitempty"`
  8238. // SiteId: Site ID associated with this placement group. On insert, you
  8239. // must set either this field or the directorySiteId field to specify
  8240. // the site associated with this placement group. This is a required
  8241. // field that is read-only after insertion.
  8242. SiteId int64 `json:"siteId,omitempty,string"`
  8243. // SiteIdDimensionValue: Dimension value for the ID of the site. This is
  8244. // a read-only, auto-generated field.
  8245. SiteIdDimensionValue *DimensionValue `json:"siteIdDimensionValue,omitempty"`
  8246. // SubaccountId: Subaccount ID of this placement group. This is a
  8247. // read-only field that can be left blank.
  8248. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8249. // ServerResponse contains the HTTP response code and headers from the
  8250. // server.
  8251. googleapi.ServerResponse `json:"-"`
  8252. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8253. // unconditionally include in API requests. By default, fields with
  8254. // empty values are omitted from API requests. However, any non-pointer,
  8255. // non-interface field appearing in ForceSendFields will be sent to the
  8256. // server regardless of whether the field is empty or not. This may be
  8257. // used to include empty fields in Patch requests.
  8258. ForceSendFields []string `json:"-"`
  8259. // NullFields is a list of field names (e.g. "AccountId") to include in
  8260. // API requests with the JSON null value. By default, fields with empty
  8261. // values are omitted from API requests. However, any field with an
  8262. // empty value appearing in NullFields will be sent to the server as
  8263. // null. It is an error if a field in this list has a non-empty value.
  8264. // This may be used to include null fields in Patch requests.
  8265. NullFields []string `json:"-"`
  8266. }
  8267. func (s *PlacementGroup) MarshalJSON() ([]byte, error) {
  8268. type NoMethod PlacementGroup
  8269. raw := NoMethod(*s)
  8270. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8271. }
  8272. // PlacementGroupsListResponse: Placement Group List Response
  8273. type PlacementGroupsListResponse struct {
  8274. // Kind: Identifies what kind of resource this is. Value: the fixed
  8275. // string "dfareporting#placementGroupsListResponse".
  8276. Kind string `json:"kind,omitempty"`
  8277. // NextPageToken: Pagination token to be used for the next list
  8278. // operation.
  8279. NextPageToken string `json:"nextPageToken,omitempty"`
  8280. // PlacementGroups: Placement group collection.
  8281. PlacementGroups []*PlacementGroup `json:"placementGroups,omitempty"`
  8282. // ServerResponse contains the HTTP response code and headers from the
  8283. // server.
  8284. googleapi.ServerResponse `json:"-"`
  8285. // ForceSendFields is a list of field names (e.g. "Kind") to
  8286. // unconditionally include in API requests. By default, fields with
  8287. // empty values are omitted from API requests. However, any non-pointer,
  8288. // non-interface field appearing in ForceSendFields will be sent to the
  8289. // server regardless of whether the field is empty or not. This may be
  8290. // used to include empty fields in Patch requests.
  8291. ForceSendFields []string `json:"-"`
  8292. // NullFields is a list of field names (e.g. "Kind") to include in API
  8293. // requests with the JSON null value. By default, fields with empty
  8294. // values are omitted from API requests. However, any field with an
  8295. // empty value appearing in NullFields will be sent to the server as
  8296. // null. It is an error if a field in this list has a non-empty value.
  8297. // This may be used to include null fields in Patch requests.
  8298. NullFields []string `json:"-"`
  8299. }
  8300. func (s *PlacementGroupsListResponse) MarshalJSON() ([]byte, error) {
  8301. type NoMethod PlacementGroupsListResponse
  8302. raw := NoMethod(*s)
  8303. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8304. }
  8305. // PlacementStrategiesListResponse: Placement Strategy List Response
  8306. type PlacementStrategiesListResponse struct {
  8307. // Kind: Identifies what kind of resource this is. Value: the fixed
  8308. // string "dfareporting#placementStrategiesListResponse".
  8309. Kind string `json:"kind,omitempty"`
  8310. // NextPageToken: Pagination token to be used for the next list
  8311. // operation.
  8312. NextPageToken string `json:"nextPageToken,omitempty"`
  8313. // PlacementStrategies: Placement strategy collection.
  8314. PlacementStrategies []*PlacementStrategy `json:"placementStrategies,omitempty"`
  8315. // ServerResponse contains the HTTP response code and headers from the
  8316. // server.
  8317. googleapi.ServerResponse `json:"-"`
  8318. // ForceSendFields is a list of field names (e.g. "Kind") to
  8319. // unconditionally include in API requests. By default, fields with
  8320. // empty values are omitted from API requests. However, any non-pointer,
  8321. // non-interface field appearing in ForceSendFields will be sent to the
  8322. // server regardless of whether the field is empty or not. This may be
  8323. // used to include empty fields in Patch requests.
  8324. ForceSendFields []string `json:"-"`
  8325. // NullFields is a list of field names (e.g. "Kind") to include in API
  8326. // requests with the JSON null value. By default, fields with empty
  8327. // values are omitted from API requests. However, any field with an
  8328. // empty value appearing in NullFields will be sent to the server as
  8329. // null. It is an error if a field in this list has a non-empty value.
  8330. // This may be used to include null fields in Patch requests.
  8331. NullFields []string `json:"-"`
  8332. }
  8333. func (s *PlacementStrategiesListResponse) MarshalJSON() ([]byte, error) {
  8334. type NoMethod PlacementStrategiesListResponse
  8335. raw := NoMethod(*s)
  8336. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8337. }
  8338. // PlacementStrategy: Contains properties of a placement strategy.
  8339. type PlacementStrategy struct {
  8340. // AccountId: Account ID of this placement strategy.This is a read-only
  8341. // field that can be left blank.
  8342. AccountId int64 `json:"accountId,omitempty,string"`
  8343. // Id: ID of this placement strategy. This is a read-only,
  8344. // auto-generated field.
  8345. Id int64 `json:"id,omitempty,string"`
  8346. // Kind: Identifies what kind of resource this is. Value: the fixed
  8347. // string "dfareporting#placementStrategy".
  8348. Kind string `json:"kind,omitempty"`
  8349. // Name: Name of this placement strategy. This is a required field. It
  8350. // must be less than 256 characters long and unique among placement
  8351. // strategies of the same account.
  8352. Name string `json:"name,omitempty"`
  8353. // ServerResponse contains the HTTP response code and headers from the
  8354. // server.
  8355. googleapi.ServerResponse `json:"-"`
  8356. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8357. // unconditionally include in API requests. By default, fields with
  8358. // empty values are omitted from API requests. However, any non-pointer,
  8359. // non-interface field appearing in ForceSendFields will be sent to the
  8360. // server regardless of whether the field is empty or not. This may be
  8361. // used to include empty fields in Patch requests.
  8362. ForceSendFields []string `json:"-"`
  8363. // NullFields is a list of field names (e.g. "AccountId") to include in
  8364. // API requests with the JSON null value. By default, fields with empty
  8365. // values are omitted from API requests. However, any field with an
  8366. // empty value appearing in NullFields will be sent to the server as
  8367. // null. It is an error if a field in this list has a non-empty value.
  8368. // This may be used to include null fields in Patch requests.
  8369. NullFields []string `json:"-"`
  8370. }
  8371. func (s *PlacementStrategy) MarshalJSON() ([]byte, error) {
  8372. type NoMethod PlacementStrategy
  8373. raw := NoMethod(*s)
  8374. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8375. }
  8376. // PlacementTag: Placement Tag
  8377. type PlacementTag struct {
  8378. // PlacementId: Placement ID
  8379. PlacementId int64 `json:"placementId,omitempty,string"`
  8380. // TagDatas: Tags generated for this placement.
  8381. TagDatas []*TagData `json:"tagDatas,omitempty"`
  8382. // ForceSendFields is a list of field names (e.g. "PlacementId") to
  8383. // unconditionally include in API requests. By default, fields with
  8384. // empty values are omitted from API requests. However, any non-pointer,
  8385. // non-interface field appearing in ForceSendFields will be sent to the
  8386. // server regardless of whether the field is empty or not. This may be
  8387. // used to include empty fields in Patch requests.
  8388. ForceSendFields []string `json:"-"`
  8389. // NullFields is a list of field names (e.g. "PlacementId") to include
  8390. // in API requests with the JSON null value. By default, fields with
  8391. // empty values are omitted from API requests. However, any field with
  8392. // an empty value appearing in NullFields will be sent to the server as
  8393. // null. It is an error if a field in this list has a non-empty value.
  8394. // This may be used to include null fields in Patch requests.
  8395. NullFields []string `json:"-"`
  8396. }
  8397. func (s *PlacementTag) MarshalJSON() ([]byte, error) {
  8398. type NoMethod PlacementTag
  8399. raw := NoMethod(*s)
  8400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8401. }
  8402. // PlacementsGenerateTagsResponse: Placement GenerateTags Response
  8403. type PlacementsGenerateTagsResponse struct {
  8404. // Kind: Identifies what kind of resource this is. Value: the fixed
  8405. // string "dfareporting#placementsGenerateTagsResponse".
  8406. Kind string `json:"kind,omitempty"`
  8407. // PlacementTags: Set of generated tags for the specified placements.
  8408. PlacementTags []*PlacementTag `json:"placementTags,omitempty"`
  8409. // ServerResponse contains the HTTP response code and headers from the
  8410. // server.
  8411. googleapi.ServerResponse `json:"-"`
  8412. // ForceSendFields is a list of field names (e.g. "Kind") to
  8413. // unconditionally include in API requests. By default, fields with
  8414. // empty values are omitted from API requests. However, any non-pointer,
  8415. // non-interface field appearing in ForceSendFields will be sent to the
  8416. // server regardless of whether the field is empty or not. This may be
  8417. // used to include empty fields in Patch requests.
  8418. ForceSendFields []string `json:"-"`
  8419. // NullFields is a list of field names (e.g. "Kind") to include in API
  8420. // requests with the JSON null value. By default, fields with empty
  8421. // values are omitted from API requests. However, any field with an
  8422. // empty value appearing in NullFields will be sent to the server as
  8423. // null. It is an error if a field in this list has a non-empty value.
  8424. // This may be used to include null fields in Patch requests.
  8425. NullFields []string `json:"-"`
  8426. }
  8427. func (s *PlacementsGenerateTagsResponse) MarshalJSON() ([]byte, error) {
  8428. type NoMethod PlacementsGenerateTagsResponse
  8429. raw := NoMethod(*s)
  8430. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8431. }
  8432. // PlacementsListResponse: Placement List Response
  8433. type PlacementsListResponse struct {
  8434. // Kind: Identifies what kind of resource this is. Value: the fixed
  8435. // string "dfareporting#placementsListResponse".
  8436. Kind string `json:"kind,omitempty"`
  8437. // NextPageToken: Pagination token to be used for the next list
  8438. // operation.
  8439. NextPageToken string `json:"nextPageToken,omitempty"`
  8440. // Placements: Placement collection.
  8441. Placements []*Placement `json:"placements,omitempty"`
  8442. // ServerResponse contains the HTTP response code and headers from the
  8443. // server.
  8444. googleapi.ServerResponse `json:"-"`
  8445. // ForceSendFields is a list of field names (e.g. "Kind") to
  8446. // unconditionally include in API requests. By default, fields with
  8447. // empty values are omitted from API requests. However, any non-pointer,
  8448. // non-interface field appearing in ForceSendFields will be sent to the
  8449. // server regardless of whether the field is empty or not. This may be
  8450. // used to include empty fields in Patch requests.
  8451. ForceSendFields []string `json:"-"`
  8452. // NullFields is a list of field names (e.g. "Kind") to include in API
  8453. // requests with the JSON null value. By default, fields with empty
  8454. // values are omitted from API requests. However, any field with an
  8455. // empty value appearing in NullFields will be sent to the server as
  8456. // null. It is an error if a field in this list has a non-empty value.
  8457. // This may be used to include null fields in Patch requests.
  8458. NullFields []string `json:"-"`
  8459. }
  8460. func (s *PlacementsListResponse) MarshalJSON() ([]byte, error) {
  8461. type NoMethod PlacementsListResponse
  8462. raw := NoMethod(*s)
  8463. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8464. }
  8465. // PlatformType: Contains information about a platform type that can be
  8466. // targeted by ads.
  8467. type PlatformType struct {
  8468. // Id: ID of this platform type.
  8469. Id int64 `json:"id,omitempty,string"`
  8470. // Kind: Identifies what kind of resource this is. Value: the fixed
  8471. // string "dfareporting#platformType".
  8472. Kind string `json:"kind,omitempty"`
  8473. // Name: Name of this platform type.
  8474. Name string `json:"name,omitempty"`
  8475. // ServerResponse contains the HTTP response code and headers from the
  8476. // server.
  8477. googleapi.ServerResponse `json:"-"`
  8478. // ForceSendFields is a list of field names (e.g. "Id") to
  8479. // unconditionally include in API requests. By default, fields with
  8480. // empty values are omitted from API requests. However, any non-pointer,
  8481. // non-interface field appearing in ForceSendFields will be sent to the
  8482. // server regardless of whether the field is empty or not. This may be
  8483. // used to include empty fields in Patch requests.
  8484. ForceSendFields []string `json:"-"`
  8485. // NullFields is a list of field names (e.g. "Id") to include in API
  8486. // requests with the JSON null value. By default, fields with empty
  8487. // values are omitted from API requests. However, any field with an
  8488. // empty value appearing in NullFields will be sent to the server as
  8489. // null. It is an error if a field in this list has a non-empty value.
  8490. // This may be used to include null fields in Patch requests.
  8491. NullFields []string `json:"-"`
  8492. }
  8493. func (s *PlatformType) MarshalJSON() ([]byte, error) {
  8494. type NoMethod PlatformType
  8495. raw := NoMethod(*s)
  8496. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8497. }
  8498. // PlatformTypesListResponse: Platform Type List Response
  8499. type PlatformTypesListResponse struct {
  8500. // Kind: Identifies what kind of resource this is. Value: the fixed
  8501. // string "dfareporting#platformTypesListResponse".
  8502. Kind string `json:"kind,omitempty"`
  8503. // PlatformTypes: Platform type collection.
  8504. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  8505. // ServerResponse contains the HTTP response code and headers from the
  8506. // server.
  8507. googleapi.ServerResponse `json:"-"`
  8508. // ForceSendFields is a list of field names (e.g. "Kind") to
  8509. // unconditionally include in API requests. By default, fields with
  8510. // empty values are omitted from API requests. However, any non-pointer,
  8511. // non-interface field appearing in ForceSendFields will be sent to the
  8512. // server regardless of whether the field is empty or not. This may be
  8513. // used to include empty fields in Patch requests.
  8514. ForceSendFields []string `json:"-"`
  8515. // NullFields is a list of field names (e.g. "Kind") to include in API
  8516. // requests with the JSON null value. By default, fields with empty
  8517. // values are omitted from API requests. However, any field with an
  8518. // empty value appearing in NullFields will be sent to the server as
  8519. // null. It is an error if a field in this list has a non-empty value.
  8520. // This may be used to include null fields in Patch requests.
  8521. NullFields []string `json:"-"`
  8522. }
  8523. func (s *PlatformTypesListResponse) MarshalJSON() ([]byte, error) {
  8524. type NoMethod PlatformTypesListResponse
  8525. raw := NoMethod(*s)
  8526. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8527. }
  8528. // PopupWindowProperties: Popup Window Properties.
  8529. type PopupWindowProperties struct {
  8530. // Dimension: Popup dimension for a creative. This is a read-only field.
  8531. // Applicable to the following creative types: all RICH_MEDIA and all
  8532. // VPAID
  8533. Dimension *Size `json:"dimension,omitempty"`
  8534. // Offset: Upper-left corner coordinates of the popup window. Applicable
  8535. // if positionType is COORDINATES.
  8536. Offset *OffsetPosition `json:"offset,omitempty"`
  8537. // PositionType: Popup window position either centered or at specific
  8538. // coordinate.
  8539. //
  8540. // Possible values:
  8541. // "CENTER"
  8542. // "COORDINATES"
  8543. PositionType string `json:"positionType,omitempty"`
  8544. // ShowAddressBar: Whether to display the browser address bar.
  8545. ShowAddressBar bool `json:"showAddressBar,omitempty"`
  8546. // ShowMenuBar: Whether to display the browser menu bar.
  8547. ShowMenuBar bool `json:"showMenuBar,omitempty"`
  8548. // ShowScrollBar: Whether to display the browser scroll bar.
  8549. ShowScrollBar bool `json:"showScrollBar,omitempty"`
  8550. // ShowStatusBar: Whether to display the browser status bar.
  8551. ShowStatusBar bool `json:"showStatusBar,omitempty"`
  8552. // ShowToolBar: Whether to display the browser tool bar.
  8553. ShowToolBar bool `json:"showToolBar,omitempty"`
  8554. // Title: Title of popup window.
  8555. Title string `json:"title,omitempty"`
  8556. // ForceSendFields is a list of field names (e.g. "Dimension") to
  8557. // unconditionally include in API requests. By default, fields with
  8558. // empty values are omitted from API requests. However, any non-pointer,
  8559. // non-interface field appearing in ForceSendFields will be sent to the
  8560. // server regardless of whether the field is empty or not. This may be
  8561. // used to include empty fields in Patch requests.
  8562. ForceSendFields []string `json:"-"`
  8563. // NullFields is a list of field names (e.g. "Dimension") to include in
  8564. // API requests with the JSON null value. By default, fields with empty
  8565. // values are omitted from API requests. However, any field with an
  8566. // empty value appearing in NullFields will be sent to the server as
  8567. // null. It is an error if a field in this list has a non-empty value.
  8568. // This may be used to include null fields in Patch requests.
  8569. NullFields []string `json:"-"`
  8570. }
  8571. func (s *PopupWindowProperties) MarshalJSON() ([]byte, error) {
  8572. type NoMethod PopupWindowProperties
  8573. raw := NoMethod(*s)
  8574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8575. }
  8576. // PostalCode: Contains information about a postal code that can be
  8577. // targeted by ads.
  8578. type PostalCode struct {
  8579. // Code: Postal code. This is equivalent to the id field.
  8580. Code string `json:"code,omitempty"`
  8581. // CountryCode: Country code of the country to which this postal code
  8582. // belongs.
  8583. CountryCode string `json:"countryCode,omitempty"`
  8584. // CountryDartId: DART ID of the country to which this postal code
  8585. // belongs.
  8586. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  8587. // Id: ID of this postal code.
  8588. Id string `json:"id,omitempty"`
  8589. // Kind: Identifies what kind of resource this is. Value: the fixed
  8590. // string "dfareporting#postalCode".
  8591. Kind string `json:"kind,omitempty"`
  8592. // ServerResponse contains the HTTP response code and headers from the
  8593. // server.
  8594. googleapi.ServerResponse `json:"-"`
  8595. // ForceSendFields is a list of field names (e.g. "Code") to
  8596. // unconditionally include in API requests. By default, fields with
  8597. // empty values are omitted from API requests. However, any non-pointer,
  8598. // non-interface field appearing in ForceSendFields will be sent to the
  8599. // server regardless of whether the field is empty or not. This may be
  8600. // used to include empty fields in Patch requests.
  8601. ForceSendFields []string `json:"-"`
  8602. // NullFields is a list of field names (e.g. "Code") to include in API
  8603. // requests with the JSON null value. By default, fields with empty
  8604. // values are omitted from API requests. However, any field with an
  8605. // empty value appearing in NullFields will be sent to the server as
  8606. // null. It is an error if a field in this list has a non-empty value.
  8607. // This may be used to include null fields in Patch requests.
  8608. NullFields []string `json:"-"`
  8609. }
  8610. func (s *PostalCode) MarshalJSON() ([]byte, error) {
  8611. type NoMethod PostalCode
  8612. raw := NoMethod(*s)
  8613. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8614. }
  8615. // PostalCodesListResponse: Postal Code List Response
  8616. type PostalCodesListResponse struct {
  8617. // Kind: Identifies what kind of resource this is. Value: the fixed
  8618. // string "dfareporting#postalCodesListResponse".
  8619. Kind string `json:"kind,omitempty"`
  8620. // PostalCodes: Postal code collection.
  8621. PostalCodes []*PostalCode `json:"postalCodes,omitempty"`
  8622. // ServerResponse contains the HTTP response code and headers from the
  8623. // server.
  8624. googleapi.ServerResponse `json:"-"`
  8625. // ForceSendFields is a list of field names (e.g. "Kind") to
  8626. // unconditionally include in API requests. By default, fields with
  8627. // empty values are omitted from API requests. However, any non-pointer,
  8628. // non-interface field appearing in ForceSendFields will be sent to the
  8629. // server regardless of whether the field is empty or not. This may be
  8630. // used to include empty fields in Patch requests.
  8631. ForceSendFields []string `json:"-"`
  8632. // NullFields is a list of field names (e.g. "Kind") to include in API
  8633. // requests with the JSON null value. By default, fields with empty
  8634. // values are omitted from API requests. However, any field with an
  8635. // empty value appearing in NullFields will be sent to the server as
  8636. // null. It is an error if a field in this list has a non-empty value.
  8637. // This may be used to include null fields in Patch requests.
  8638. NullFields []string `json:"-"`
  8639. }
  8640. func (s *PostalCodesListResponse) MarshalJSON() ([]byte, error) {
  8641. type NoMethod PostalCodesListResponse
  8642. raw := NoMethod(*s)
  8643. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8644. }
  8645. // Pricing: Pricing Information
  8646. type Pricing struct {
  8647. // CapCostType: Cap cost type of this inventory item.
  8648. //
  8649. // Possible values:
  8650. // "PLANNING_PLACEMENT_CAP_COST_TYPE_CUMULATIVE"
  8651. // "PLANNING_PLACEMENT_CAP_COST_TYPE_MONTHLY"
  8652. // "PLANNING_PLACEMENT_CAP_COST_TYPE_NONE"
  8653. CapCostType string `json:"capCostType,omitempty"`
  8654. // EndDate: End date of this inventory item.
  8655. EndDate string `json:"endDate,omitempty"`
  8656. // Flights: Flights of this inventory item. A flight (a.k.a. pricing
  8657. // period) represents the inventory item pricing information for a
  8658. // specific period of time.
  8659. Flights []*Flight `json:"flights,omitempty"`
  8660. // GroupType: Group type of this inventory item if it represents a
  8661. // placement group. Is null otherwise. There are two type of placement
  8662. // groups: PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE is a simple group of
  8663. // inventory items that acts as a single pricing point for a group of
  8664. // tags. PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK is a group of inventory
  8665. // items that not only acts as a single pricing point, but also assumes
  8666. // that all the tags in it will be served at the same time. A roadblock
  8667. // requires one of its assigned inventory items to be marked as primary.
  8668. //
  8669. // Possible values:
  8670. // "PLANNING_PLACEMENT_GROUP_TYPE_PACKAGE"
  8671. // "PLANNING_PLACEMENT_GROUP_TYPE_ROADBLOCK"
  8672. GroupType string `json:"groupType,omitempty"`
  8673. // PricingType: Pricing type of this inventory item.
  8674. //
  8675. // Possible values:
  8676. // "PLANNING_PLACEMENT_PRICING_TYPE_CLICKS"
  8677. // "PLANNING_PLACEMENT_PRICING_TYPE_CPA"
  8678. // "PLANNING_PLACEMENT_PRICING_TYPE_CPC"
  8679. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM"
  8680. // "PLANNING_PLACEMENT_PRICING_TYPE_CPM_ACTIVEVIEW"
  8681. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_CLICKS"
  8682. // "PLANNING_PLACEMENT_PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8683. // "PLANNING_PLACEMENT_PRICING_TYPE_IMPRESSIONS"
  8684. PricingType string `json:"pricingType,omitempty"`
  8685. // StartDate: Start date of this inventory item.
  8686. StartDate string `json:"startDate,omitempty"`
  8687. // ForceSendFields is a list of field names (e.g. "CapCostType") to
  8688. // unconditionally include in API requests. By default, fields with
  8689. // empty values are omitted from API requests. However, any non-pointer,
  8690. // non-interface field appearing in ForceSendFields will be sent to the
  8691. // server regardless of whether the field is empty or not. This may be
  8692. // used to include empty fields in Patch requests.
  8693. ForceSendFields []string `json:"-"`
  8694. // NullFields is a list of field names (e.g. "CapCostType") to include
  8695. // in API requests with the JSON null value. By default, fields with
  8696. // empty values are omitted from API requests. However, any field with
  8697. // an empty value appearing in NullFields will be sent to the server as
  8698. // null. It is an error if a field in this list has a non-empty value.
  8699. // This may be used to include null fields in Patch requests.
  8700. NullFields []string `json:"-"`
  8701. }
  8702. func (s *Pricing) MarshalJSON() ([]byte, error) {
  8703. type NoMethod Pricing
  8704. raw := NoMethod(*s)
  8705. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8706. }
  8707. // PricingSchedule: Pricing Schedule
  8708. type PricingSchedule struct {
  8709. // CapCostOption: Placement cap cost option.
  8710. //
  8711. // Possible values:
  8712. // "CAP_COST_CUMULATIVE"
  8713. // "CAP_COST_MONTHLY"
  8714. // "CAP_COST_NONE"
  8715. CapCostOption string `json:"capCostOption,omitempty"`
  8716. // DisregardOverdelivery: Whether cap costs are ignored by ad serving.
  8717. DisregardOverdelivery bool `json:"disregardOverdelivery,omitempty"`
  8718. // EndDate: Placement end date. This date must be later than, or the
  8719. // same day as, the placement start date, but not later than the
  8720. // campaign end date. If, for example, you set 6/25/2015 as both the
  8721. // start and end dates, the effective placement date is just that day
  8722. // only, 6/25/2015. The hours, minutes, and seconds of the end date
  8723. // should not be set, as doing so will result in an error. This field is
  8724. // required on insertion.
  8725. EndDate string `json:"endDate,omitempty"`
  8726. // Flighted: Whether this placement is flighted. If true, pricing
  8727. // periods will be computed automatically.
  8728. Flighted bool `json:"flighted,omitempty"`
  8729. // FloodlightActivityId: Floodlight activity ID associated with this
  8730. // placement. This field should be set when placement pricing type is
  8731. // set to PRICING_TYPE_CPA.
  8732. FloodlightActivityId int64 `json:"floodlightActivityId,omitempty,string"`
  8733. // PricingPeriods: Pricing periods for this placement.
  8734. PricingPeriods []*PricingSchedulePricingPeriod `json:"pricingPeriods,omitempty"`
  8735. // PricingType: Placement pricing type. This field is required on
  8736. // insertion.
  8737. //
  8738. // Possible values:
  8739. // "PRICING_TYPE_CPA"
  8740. // "PRICING_TYPE_CPC"
  8741. // "PRICING_TYPE_CPM"
  8742. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  8743. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  8744. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  8745. PricingType string `json:"pricingType,omitempty"`
  8746. // StartDate: Placement start date. This date must be later than, or the
  8747. // same day as, the campaign start date. The hours, minutes, and seconds
  8748. // of the start date should not be set, as doing so will result in an
  8749. // error. This field is required on insertion.
  8750. StartDate string `json:"startDate,omitempty"`
  8751. // TestingStartDate: Testing start date of this placement. The hours,
  8752. // minutes, and seconds of the start date should not be set, as doing so
  8753. // will result in an error.
  8754. TestingStartDate string `json:"testingStartDate,omitempty"`
  8755. // ForceSendFields is a list of field names (e.g. "CapCostOption") to
  8756. // unconditionally include in API requests. By default, fields with
  8757. // empty values are omitted from API requests. However, any non-pointer,
  8758. // non-interface field appearing in ForceSendFields will be sent to the
  8759. // server regardless of whether the field is empty or not. This may be
  8760. // used to include empty fields in Patch requests.
  8761. ForceSendFields []string `json:"-"`
  8762. // NullFields is a list of field names (e.g. "CapCostOption") to include
  8763. // in API requests with the JSON null value. By default, fields with
  8764. // empty values are omitted from API requests. However, any field with
  8765. // an empty value appearing in NullFields will be sent to the server as
  8766. // null. It is an error if a field in this list has a non-empty value.
  8767. // This may be used to include null fields in Patch requests.
  8768. NullFields []string `json:"-"`
  8769. }
  8770. func (s *PricingSchedule) MarshalJSON() ([]byte, error) {
  8771. type NoMethod PricingSchedule
  8772. raw := NoMethod(*s)
  8773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8774. }
  8775. // PricingSchedulePricingPeriod: Pricing Period
  8776. type PricingSchedulePricingPeriod struct {
  8777. // EndDate: Pricing period end date. This date must be later than, or
  8778. // the same day as, the pricing period start date, but not later than
  8779. // the placement end date. The period end date can be the same date as
  8780. // the period start date. If, for example, you set 6/25/2015 as both the
  8781. // start and end dates, the effective pricing period date is just that
  8782. // day only, 6/25/2015. The hours, minutes, and seconds of the end date
  8783. // should not be set, as doing so will result in an error.
  8784. EndDate string `json:"endDate,omitempty"`
  8785. // PricingComment: Comments for this pricing period.
  8786. PricingComment string `json:"pricingComment,omitempty"`
  8787. // RateOrCostNanos: Rate or cost of this pricing period in nanos (i.e.,
  8788. // multipled by 1000000000). Acceptable values are 0 to
  8789. // 1000000000000000000, inclusive.
  8790. RateOrCostNanos int64 `json:"rateOrCostNanos,omitempty,string"`
  8791. // StartDate: Pricing period start date. This date must be later than,
  8792. // or the same day as, the placement start date. The hours, minutes, and
  8793. // seconds of the start date should not be set, as doing so will result
  8794. // in an error.
  8795. StartDate string `json:"startDate,omitempty"`
  8796. // Units: Units of this pricing period. Acceptable values are 0 to
  8797. // 10000000000, inclusive.
  8798. Units int64 `json:"units,omitempty,string"`
  8799. // ForceSendFields is a list of field names (e.g. "EndDate") to
  8800. // unconditionally include in API requests. By default, fields with
  8801. // empty values are omitted from API requests. However, any non-pointer,
  8802. // non-interface field appearing in ForceSendFields will be sent to the
  8803. // server regardless of whether the field is empty or not. This may be
  8804. // used to include empty fields in Patch requests.
  8805. ForceSendFields []string `json:"-"`
  8806. // NullFields is a list of field names (e.g. "EndDate") to include in
  8807. // API requests with the JSON null value. By default, fields with empty
  8808. // values are omitted from API requests. However, any field with an
  8809. // empty value appearing in NullFields will be sent to the server as
  8810. // null. It is an error if a field in this list has a non-empty value.
  8811. // This may be used to include null fields in Patch requests.
  8812. NullFields []string `json:"-"`
  8813. }
  8814. func (s *PricingSchedulePricingPeriod) MarshalJSON() ([]byte, error) {
  8815. type NoMethod PricingSchedulePricingPeriod
  8816. raw := NoMethod(*s)
  8817. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8818. }
  8819. // Project: Contains properties of a DoubleClick Planning project.
  8820. type Project struct {
  8821. // AccountId: Account ID of this project.
  8822. AccountId int64 `json:"accountId,omitempty,string"`
  8823. // AdvertiserId: Advertiser ID of this project.
  8824. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  8825. // AudienceAgeGroup: Audience age group of this project.
  8826. //
  8827. // Possible values:
  8828. // "PLANNING_AUDIENCE_AGE_18_24"
  8829. // "PLANNING_AUDIENCE_AGE_25_34"
  8830. // "PLANNING_AUDIENCE_AGE_35_44"
  8831. // "PLANNING_AUDIENCE_AGE_45_54"
  8832. // "PLANNING_AUDIENCE_AGE_55_64"
  8833. // "PLANNING_AUDIENCE_AGE_65_OR_MORE"
  8834. // "PLANNING_AUDIENCE_AGE_UNKNOWN"
  8835. AudienceAgeGroup string `json:"audienceAgeGroup,omitempty"`
  8836. // AudienceGender: Audience gender of this project.
  8837. //
  8838. // Possible values:
  8839. // "PLANNING_AUDIENCE_GENDER_FEMALE"
  8840. // "PLANNING_AUDIENCE_GENDER_MALE"
  8841. AudienceGender string `json:"audienceGender,omitempty"`
  8842. // Budget: Budget of this project in the currency specified by the
  8843. // current account. The value stored in this field represents only the
  8844. // non-fractional amount. For example, for USD, the smallest value that
  8845. // can be represented by this field is 1 US dollar.
  8846. Budget int64 `json:"budget,omitempty,string"`
  8847. // ClientBillingCode: Client billing code of this project.
  8848. ClientBillingCode string `json:"clientBillingCode,omitempty"`
  8849. // ClientName: Name of the project client.
  8850. ClientName string `json:"clientName,omitempty"`
  8851. // EndDate: End date of the project.
  8852. EndDate string `json:"endDate,omitempty"`
  8853. // Id: ID of this project. This is a read-only, auto-generated field.
  8854. Id int64 `json:"id,omitempty,string"`
  8855. // Kind: Identifies what kind of resource this is. Value: the fixed
  8856. // string "dfareporting#project".
  8857. Kind string `json:"kind,omitempty"`
  8858. // LastModifiedInfo: Information about the most recent modification of
  8859. // this project.
  8860. LastModifiedInfo *LastModifiedInfo `json:"lastModifiedInfo,omitempty"`
  8861. // Name: Name of this project.
  8862. Name string `json:"name,omitempty"`
  8863. // Overview: Overview of this project.
  8864. Overview string `json:"overview,omitempty"`
  8865. // StartDate: Start date of the project.
  8866. StartDate string `json:"startDate,omitempty"`
  8867. // SubaccountId: Subaccount ID of this project.
  8868. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  8869. // TargetClicks: Number of clicks that the advertiser is targeting.
  8870. TargetClicks int64 `json:"targetClicks,omitempty,string"`
  8871. // TargetConversions: Number of conversions that the advertiser is
  8872. // targeting.
  8873. TargetConversions int64 `json:"targetConversions,omitempty,string"`
  8874. // TargetCpaNanos: CPA that the advertiser is targeting.
  8875. TargetCpaNanos int64 `json:"targetCpaNanos,omitempty,string"`
  8876. // TargetCpcNanos: CPC that the advertiser is targeting.
  8877. TargetCpcNanos int64 `json:"targetCpcNanos,omitempty,string"`
  8878. // TargetCpmActiveViewNanos: vCPM from Active View that the advertiser
  8879. // is targeting.
  8880. TargetCpmActiveViewNanos int64 `json:"targetCpmActiveViewNanos,omitempty,string"`
  8881. // TargetCpmNanos: CPM that the advertiser is targeting.
  8882. TargetCpmNanos int64 `json:"targetCpmNanos,omitempty,string"`
  8883. // TargetImpressions: Number of impressions that the advertiser is
  8884. // targeting.
  8885. TargetImpressions int64 `json:"targetImpressions,omitempty,string"`
  8886. // ServerResponse contains the HTTP response code and headers from the
  8887. // server.
  8888. googleapi.ServerResponse `json:"-"`
  8889. // ForceSendFields is a list of field names (e.g. "AccountId") to
  8890. // unconditionally include in API requests. By default, fields with
  8891. // empty values are omitted from API requests. However, any non-pointer,
  8892. // non-interface field appearing in ForceSendFields will be sent to the
  8893. // server regardless of whether the field is empty or not. This may be
  8894. // used to include empty fields in Patch requests.
  8895. ForceSendFields []string `json:"-"`
  8896. // NullFields is a list of field names (e.g. "AccountId") to include in
  8897. // API requests with the JSON null value. By default, fields with empty
  8898. // values are omitted from API requests. However, any field with an
  8899. // empty value appearing in NullFields will be sent to the server as
  8900. // null. It is an error if a field in this list has a non-empty value.
  8901. // This may be used to include null fields in Patch requests.
  8902. NullFields []string `json:"-"`
  8903. }
  8904. func (s *Project) MarshalJSON() ([]byte, error) {
  8905. type NoMethod Project
  8906. raw := NoMethod(*s)
  8907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8908. }
  8909. // ProjectsListResponse: Project List Response
  8910. type ProjectsListResponse struct {
  8911. // Kind: Identifies what kind of resource this is. Value: the fixed
  8912. // string "dfareporting#projectsListResponse".
  8913. Kind string `json:"kind,omitempty"`
  8914. // NextPageToken: Pagination token to be used for the next list
  8915. // operation.
  8916. NextPageToken string `json:"nextPageToken,omitempty"`
  8917. // Projects: Project collection.
  8918. Projects []*Project `json:"projects,omitempty"`
  8919. // ServerResponse contains the HTTP response code and headers from the
  8920. // server.
  8921. googleapi.ServerResponse `json:"-"`
  8922. // ForceSendFields is a list of field names (e.g. "Kind") to
  8923. // unconditionally include in API requests. By default, fields with
  8924. // empty values are omitted from API requests. However, any non-pointer,
  8925. // non-interface field appearing in ForceSendFields will be sent to the
  8926. // server regardless of whether the field is empty or not. This may be
  8927. // used to include empty fields in Patch requests.
  8928. ForceSendFields []string `json:"-"`
  8929. // NullFields is a list of field names (e.g. "Kind") to include in API
  8930. // requests with the JSON null value. By default, fields with empty
  8931. // values are omitted from API requests. However, any field with an
  8932. // empty value appearing in NullFields will be sent to the server as
  8933. // null. It is an error if a field in this list has a non-empty value.
  8934. // This may be used to include null fields in Patch requests.
  8935. NullFields []string `json:"-"`
  8936. }
  8937. func (s *ProjectsListResponse) MarshalJSON() ([]byte, error) {
  8938. type NoMethod ProjectsListResponse
  8939. raw := NoMethod(*s)
  8940. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8941. }
  8942. // ReachReportCompatibleFields: Represents fields that are compatible to
  8943. // be selected for a report of type "REACH".
  8944. type ReachReportCompatibleFields struct {
  8945. // DimensionFilters: Dimensions which are compatible to be selected in
  8946. // the "dimensionFilters" section of the report.
  8947. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  8948. // Dimensions: Dimensions which are compatible to be selected in the
  8949. // "dimensions" section of the report.
  8950. Dimensions []*Dimension `json:"dimensions,omitempty"`
  8951. // Kind: The kind of resource this is, in this case
  8952. // dfareporting#reachReportCompatibleFields.
  8953. Kind string `json:"kind,omitempty"`
  8954. // Metrics: Metrics which are compatible to be selected in the
  8955. // "metricNames" section of the report.
  8956. Metrics []*Metric `json:"metrics,omitempty"`
  8957. // PivotedActivityMetrics: Metrics which are compatible to be selected
  8958. // as activity metrics to pivot on in the "activities" section of the
  8959. // report.
  8960. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  8961. // ReachByFrequencyMetrics: Metrics which are compatible to be selected
  8962. // in the "reachByFrequencyMetricNames" section of the report.
  8963. ReachByFrequencyMetrics []*Metric `json:"reachByFrequencyMetrics,omitempty"`
  8964. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  8965. // unconditionally include in API requests. By default, fields with
  8966. // empty values are omitted from API requests. However, any non-pointer,
  8967. // non-interface field appearing in ForceSendFields will be sent to the
  8968. // server regardless of whether the field is empty or not. This may be
  8969. // used to include empty fields in Patch requests.
  8970. ForceSendFields []string `json:"-"`
  8971. // NullFields is a list of field names (e.g. "DimensionFilters") to
  8972. // include in API requests with the JSON null value. By default, fields
  8973. // with empty values are omitted from API requests. However, any field
  8974. // with an empty value appearing in NullFields will be sent to the
  8975. // server as null. It is an error if a field in this list has a
  8976. // non-empty value. This may be used to include null fields in Patch
  8977. // requests.
  8978. NullFields []string `json:"-"`
  8979. }
  8980. func (s *ReachReportCompatibleFields) MarshalJSON() ([]byte, error) {
  8981. type NoMethod ReachReportCompatibleFields
  8982. raw := NoMethod(*s)
  8983. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  8984. }
  8985. // Recipient: Represents a recipient.
  8986. type Recipient struct {
  8987. // DeliveryType: The delivery type for the recipient.
  8988. //
  8989. // Possible values:
  8990. // "ATTACHMENT"
  8991. // "LINK"
  8992. DeliveryType string `json:"deliveryType,omitempty"`
  8993. // Email: The email address of the recipient.
  8994. Email string `json:"email,omitempty"`
  8995. // Kind: The kind of resource this is, in this case
  8996. // dfareporting#recipient.
  8997. Kind string `json:"kind,omitempty"`
  8998. // ForceSendFields is a list of field names (e.g. "DeliveryType") to
  8999. // unconditionally include in API requests. By default, fields with
  9000. // empty values are omitted from API requests. However, any non-pointer,
  9001. // non-interface field appearing in ForceSendFields will be sent to the
  9002. // server regardless of whether the field is empty or not. This may be
  9003. // used to include empty fields in Patch requests.
  9004. ForceSendFields []string `json:"-"`
  9005. // NullFields is a list of field names (e.g. "DeliveryType") to include
  9006. // in API requests with the JSON null value. By default, fields with
  9007. // empty values are omitted from API requests. However, any field with
  9008. // an empty value appearing in NullFields will be sent to the server as
  9009. // null. It is an error if a field in this list has a non-empty value.
  9010. // This may be used to include null fields in Patch requests.
  9011. NullFields []string `json:"-"`
  9012. }
  9013. func (s *Recipient) MarshalJSON() ([]byte, error) {
  9014. type NoMethod Recipient
  9015. raw := NoMethod(*s)
  9016. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9017. }
  9018. // Region: Contains information about a region that can be targeted by
  9019. // ads.
  9020. type Region struct {
  9021. // CountryCode: Country code of the country to which this region
  9022. // belongs.
  9023. CountryCode string `json:"countryCode,omitempty"`
  9024. // CountryDartId: DART ID of the country to which this region belongs.
  9025. CountryDartId int64 `json:"countryDartId,omitempty,string"`
  9026. // DartId: DART ID of this region.
  9027. DartId int64 `json:"dartId,omitempty,string"`
  9028. // Kind: Identifies what kind of resource this is. Value: the fixed
  9029. // string "dfareporting#region".
  9030. Kind string `json:"kind,omitempty"`
  9031. // Name: Name of this region.
  9032. Name string `json:"name,omitempty"`
  9033. // RegionCode: Region code.
  9034. RegionCode string `json:"regionCode,omitempty"`
  9035. // ForceSendFields is a list of field names (e.g. "CountryCode") to
  9036. // unconditionally include in API requests. By default, fields with
  9037. // empty values are omitted from API requests. However, any non-pointer,
  9038. // non-interface field appearing in ForceSendFields will be sent to the
  9039. // server regardless of whether the field is empty or not. This may be
  9040. // used to include empty fields in Patch requests.
  9041. ForceSendFields []string `json:"-"`
  9042. // NullFields is a list of field names (e.g. "CountryCode") to include
  9043. // in API requests with the JSON null value. By default, fields with
  9044. // empty values are omitted from API requests. However, any field with
  9045. // an empty value appearing in NullFields will be sent to the server as
  9046. // null. It is an error if a field in this list has a non-empty value.
  9047. // This may be used to include null fields in Patch requests.
  9048. NullFields []string `json:"-"`
  9049. }
  9050. func (s *Region) MarshalJSON() ([]byte, error) {
  9051. type NoMethod Region
  9052. raw := NoMethod(*s)
  9053. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9054. }
  9055. // RegionsListResponse: Region List Response
  9056. type RegionsListResponse struct {
  9057. // Kind: Identifies what kind of resource this is. Value: the fixed
  9058. // string "dfareporting#regionsListResponse".
  9059. Kind string `json:"kind,omitempty"`
  9060. // Regions: Region collection.
  9061. Regions []*Region `json:"regions,omitempty"`
  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. "Kind") 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. "Kind") to include in API
  9073. // 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 *RegionsListResponse) MarshalJSON() ([]byte, error) {
  9081. type NoMethod RegionsListResponse
  9082. raw := NoMethod(*s)
  9083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9084. }
  9085. // RemarketingList: Contains properties of a remarketing list.
  9086. // Remarketing enables you to create lists of users who have performed
  9087. // specific actions on a site, then target ads to members of those
  9088. // lists. This resource can be used to manage remarketing lists that are
  9089. // owned by your advertisers. To see all remarketing lists that are
  9090. // visible to your advertisers, including those that are shared to your
  9091. // advertiser or account, use the TargetableRemarketingLists resource.
  9092. type RemarketingList struct {
  9093. // AccountId: Account ID of this remarketing list. This is a read-only,
  9094. // auto-generated field that is only returned in GET requests.
  9095. AccountId int64 `json:"accountId,omitempty,string"`
  9096. // Active: Whether this remarketing list is active.
  9097. Active bool `json:"active,omitempty"`
  9098. // AdvertiserId: Dimension value for the advertiser ID that owns this
  9099. // remarketing list. This is a required field.
  9100. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  9101. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  9102. // advertiser. This is a read-only, auto-generated field.
  9103. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  9104. // Description: Remarketing list description.
  9105. Description string `json:"description,omitempty"`
  9106. // Id: Remarketing list ID. This is a read-only, auto-generated field.
  9107. Id int64 `json:"id,omitempty,string"`
  9108. // Kind: Identifies what kind of resource this is. Value: the fixed
  9109. // string "dfareporting#remarketingList".
  9110. Kind string `json:"kind,omitempty"`
  9111. // LifeSpan: Number of days that a user should remain in the remarketing
  9112. // list without an impression. Acceptable values are 1 to 540,
  9113. // inclusive.
  9114. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  9115. // ListPopulationRule: Rule used to populate the remarketing list with
  9116. // users.
  9117. ListPopulationRule *ListPopulationRule `json:"listPopulationRule,omitempty"`
  9118. // ListSize: Number of users currently in the list. This is a read-only
  9119. // field.
  9120. ListSize int64 `json:"listSize,omitempty,string"`
  9121. // ListSource: Product from which this remarketing list was originated.
  9122. //
  9123. // Possible values:
  9124. // "REMARKETING_LIST_SOURCE_ADX"
  9125. // "REMARKETING_LIST_SOURCE_DBM"
  9126. // "REMARKETING_LIST_SOURCE_DFA"
  9127. // "REMARKETING_LIST_SOURCE_DFP"
  9128. // "REMARKETING_LIST_SOURCE_DMP"
  9129. // "REMARKETING_LIST_SOURCE_GA"
  9130. // "REMARKETING_LIST_SOURCE_GPLUS"
  9131. // "REMARKETING_LIST_SOURCE_OTHER"
  9132. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  9133. // "REMARKETING_LIST_SOURCE_XFP"
  9134. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  9135. ListSource string `json:"listSource,omitempty"`
  9136. // Name: Name of the remarketing list. This is a required field. Must be
  9137. // no greater than 128 characters long.
  9138. Name string `json:"name,omitempty"`
  9139. // SubaccountId: Subaccount ID of this remarketing list. This is a
  9140. // read-only, auto-generated field that is only returned in GET
  9141. // requests.
  9142. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9143. // ServerResponse contains the HTTP response code and headers from the
  9144. // server.
  9145. googleapi.ServerResponse `json:"-"`
  9146. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9147. // unconditionally include in API requests. By default, fields with
  9148. // empty values are omitted from API requests. However, any non-pointer,
  9149. // non-interface field appearing in ForceSendFields will be sent to the
  9150. // server regardless of whether the field is empty or not. This may be
  9151. // used to include empty fields in Patch requests.
  9152. ForceSendFields []string `json:"-"`
  9153. // NullFields is a list of field names (e.g. "AccountId") to include in
  9154. // API requests with the JSON null value. By default, fields with empty
  9155. // values are omitted from API requests. However, any field with an
  9156. // empty value appearing in NullFields will be sent to the server as
  9157. // null. It is an error if a field in this list has a non-empty value.
  9158. // This may be used to include null fields in Patch requests.
  9159. NullFields []string `json:"-"`
  9160. }
  9161. func (s *RemarketingList) MarshalJSON() ([]byte, error) {
  9162. type NoMethod RemarketingList
  9163. raw := NoMethod(*s)
  9164. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9165. }
  9166. // RemarketingListShare: Contains properties of a remarketing list's
  9167. // sharing information. Sharing allows other accounts or advertisers to
  9168. // target to your remarketing lists. This resource can be used to manage
  9169. // remarketing list sharing to other accounts and advertisers.
  9170. type RemarketingListShare struct {
  9171. // Kind: Identifies what kind of resource this is. Value: the fixed
  9172. // string "dfareporting#remarketingListShare".
  9173. Kind string `json:"kind,omitempty"`
  9174. // RemarketingListId: Remarketing list ID. This is a read-only,
  9175. // auto-generated field.
  9176. RemarketingListId int64 `json:"remarketingListId,omitempty,string"`
  9177. // SharedAccountIds: Accounts that the remarketing list is shared with.
  9178. SharedAccountIds googleapi.Int64s `json:"sharedAccountIds,omitempty"`
  9179. // SharedAdvertiserIds: Advertisers that the remarketing list is shared
  9180. // with.
  9181. SharedAdvertiserIds googleapi.Int64s `json:"sharedAdvertiserIds,omitempty"`
  9182. // ServerResponse contains the HTTP response code and headers from the
  9183. // server.
  9184. googleapi.ServerResponse `json:"-"`
  9185. // ForceSendFields is a list of field names (e.g. "Kind") to
  9186. // unconditionally include in API requests. By default, fields with
  9187. // empty values are omitted from API requests. However, any non-pointer,
  9188. // non-interface field appearing in ForceSendFields will be sent to the
  9189. // server regardless of whether the field is empty or not. This may be
  9190. // used to include empty fields in Patch requests.
  9191. ForceSendFields []string `json:"-"`
  9192. // NullFields is a list of field names (e.g. "Kind") to include in API
  9193. // requests with the JSON null value. By default, fields with empty
  9194. // values are omitted from API requests. However, any field with an
  9195. // empty value appearing in NullFields will be sent to the server as
  9196. // null. It is an error if a field in this list has a non-empty value.
  9197. // This may be used to include null fields in Patch requests.
  9198. NullFields []string `json:"-"`
  9199. }
  9200. func (s *RemarketingListShare) MarshalJSON() ([]byte, error) {
  9201. type NoMethod RemarketingListShare
  9202. raw := NoMethod(*s)
  9203. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9204. }
  9205. // RemarketingListsListResponse: Remarketing list response
  9206. type RemarketingListsListResponse struct {
  9207. // Kind: Identifies what kind of resource this is. Value: the fixed
  9208. // string "dfareporting#remarketingListsListResponse".
  9209. Kind string `json:"kind,omitempty"`
  9210. // NextPageToken: Pagination token to be used for the next list
  9211. // operation.
  9212. NextPageToken string `json:"nextPageToken,omitempty"`
  9213. // RemarketingLists: Remarketing list collection.
  9214. RemarketingLists []*RemarketingList `json:"remarketingLists,omitempty"`
  9215. // ServerResponse contains the HTTP response code and headers from the
  9216. // server.
  9217. googleapi.ServerResponse `json:"-"`
  9218. // ForceSendFields is a list of field names (e.g. "Kind") to
  9219. // unconditionally include in API requests. By default, fields with
  9220. // empty values are omitted from API requests. However, any non-pointer,
  9221. // non-interface field appearing in ForceSendFields will be sent to the
  9222. // server regardless of whether the field is empty or not. This may be
  9223. // used to include empty fields in Patch requests.
  9224. ForceSendFields []string `json:"-"`
  9225. // NullFields is a list of field names (e.g. "Kind") to include in API
  9226. // requests with the JSON null value. By default, fields with empty
  9227. // values are omitted from API requests. However, any field with an
  9228. // empty value appearing in NullFields will be sent to the server as
  9229. // null. It is an error if a field in this list has a non-empty value.
  9230. // This may be used to include null fields in Patch requests.
  9231. NullFields []string `json:"-"`
  9232. }
  9233. func (s *RemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  9234. type NoMethod RemarketingListsListResponse
  9235. raw := NoMethod(*s)
  9236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9237. }
  9238. // Report: Represents a Report resource.
  9239. type Report struct {
  9240. // AccountId: The account ID to which this report belongs.
  9241. AccountId int64 `json:"accountId,omitempty,string"`
  9242. // Criteria: The report criteria for a report of type "STANDARD".
  9243. Criteria *ReportCriteria `json:"criteria,omitempty"`
  9244. // CrossDimensionReachCriteria: The report criteria for a report of type
  9245. // "CROSS_DIMENSION_REACH".
  9246. CrossDimensionReachCriteria *ReportCrossDimensionReachCriteria `json:"crossDimensionReachCriteria,omitempty"`
  9247. // Delivery: The report's email delivery settings.
  9248. Delivery *ReportDelivery `json:"delivery,omitempty"`
  9249. // Etag: The eTag of this response for caching purposes.
  9250. Etag string `json:"etag,omitempty"`
  9251. // FileName: The filename used when generating report files for this
  9252. // report.
  9253. FileName string `json:"fileName,omitempty"`
  9254. // FloodlightCriteria: The report criteria for a report of type
  9255. // "FLOODLIGHT".
  9256. FloodlightCriteria *ReportFloodlightCriteria `json:"floodlightCriteria,omitempty"`
  9257. // Format: The output format of the report. If not specified, default
  9258. // format is "CSV". Note that the actual format in the completed report
  9259. // file might differ if for instance the report's size exceeds the
  9260. // format's capabilities. "CSV" will then be the fallback format.
  9261. //
  9262. // Possible values:
  9263. // "CSV"
  9264. // "EXCEL"
  9265. Format string `json:"format,omitempty"`
  9266. // Id: The unique ID identifying this report resource.
  9267. Id int64 `json:"id,omitempty,string"`
  9268. // Kind: The kind of resource this is, in this case dfareporting#report.
  9269. Kind string `json:"kind,omitempty"`
  9270. // LastModifiedTime: The timestamp (in milliseconds since epoch) of when
  9271. // this report was last modified.
  9272. LastModifiedTime uint64 `json:"lastModifiedTime,omitempty,string"`
  9273. // Name: The name of the report.
  9274. Name string `json:"name,omitempty"`
  9275. // OwnerProfileId: The user profile id of the owner of this report.
  9276. OwnerProfileId int64 `json:"ownerProfileId,omitempty,string"`
  9277. // PathToConversionCriteria: The report criteria for a report of type
  9278. // "PATH_TO_CONVERSION".
  9279. PathToConversionCriteria *ReportPathToConversionCriteria `json:"pathToConversionCriteria,omitempty"`
  9280. // ReachCriteria: The report criteria for a report of type "REACH".
  9281. ReachCriteria *ReportReachCriteria `json:"reachCriteria,omitempty"`
  9282. // Schedule: The report's schedule. Can only be set if the report's
  9283. // 'dateRange' is a relative date range and the relative date range is
  9284. // not "TODAY".
  9285. Schedule *ReportSchedule `json:"schedule,omitempty"`
  9286. // SubAccountId: The subaccount ID to which this report belongs if
  9287. // applicable.
  9288. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  9289. // Type: The type of the report.
  9290. //
  9291. // Possible values:
  9292. // "CROSS_DIMENSION_REACH"
  9293. // "FLOODLIGHT"
  9294. // "PATH_TO_CONVERSION"
  9295. // "REACH"
  9296. // "STANDARD"
  9297. Type string `json:"type,omitempty"`
  9298. // ServerResponse contains the HTTP response code and headers from the
  9299. // server.
  9300. googleapi.ServerResponse `json:"-"`
  9301. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9302. // unconditionally include in API requests. By default, fields with
  9303. // empty values are omitted from API requests. However, any non-pointer,
  9304. // non-interface field appearing in ForceSendFields will be sent to the
  9305. // server regardless of whether the field is empty or not. This may be
  9306. // used to include empty fields in Patch requests.
  9307. ForceSendFields []string `json:"-"`
  9308. // NullFields is a list of field names (e.g. "AccountId") to include in
  9309. // API requests with the JSON null value. By default, fields with empty
  9310. // values are omitted from API requests. However, any field with an
  9311. // empty value appearing in NullFields will be sent to the server as
  9312. // null. It is an error if a field in this list has a non-empty value.
  9313. // This may be used to include null fields in Patch requests.
  9314. NullFields []string `json:"-"`
  9315. }
  9316. func (s *Report) MarshalJSON() ([]byte, error) {
  9317. type NoMethod Report
  9318. raw := NoMethod(*s)
  9319. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9320. }
  9321. // ReportCriteria: The report criteria for a report of type "STANDARD".
  9322. type ReportCriteria struct {
  9323. // Activities: Activity group.
  9324. Activities *Activities `json:"activities,omitempty"`
  9325. // CustomRichMediaEvents: Custom Rich Media Events group.
  9326. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9327. // DateRange: The date range for which this report should be run.
  9328. DateRange *DateRange `json:"dateRange,omitempty"`
  9329. // DimensionFilters: The list of filters on which dimensions are
  9330. // filtered.
  9331. // Filters for different dimensions are ANDed, filters for the same
  9332. // dimension are grouped together and ORed.
  9333. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9334. // Dimensions: The list of standard dimensions the report should
  9335. // include.
  9336. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9337. // MetricNames: The list of names of metrics the report should include.
  9338. MetricNames []string `json:"metricNames,omitempty"`
  9339. // ForceSendFields is a list of field names (e.g. "Activities") to
  9340. // unconditionally include in API requests. By default, fields with
  9341. // empty values are omitted from API requests. However, any non-pointer,
  9342. // non-interface field appearing in ForceSendFields will be sent to the
  9343. // server regardless of whether the field is empty or not. This may be
  9344. // used to include empty fields in Patch requests.
  9345. ForceSendFields []string `json:"-"`
  9346. // NullFields is a list of field names (e.g. "Activities") to include in
  9347. // API requests with the JSON null value. By default, fields with empty
  9348. // values are omitted from API requests. However, any field with an
  9349. // empty value appearing in NullFields will be sent to the server as
  9350. // null. It is an error if a field in this list has a non-empty value.
  9351. // This may be used to include null fields in Patch requests.
  9352. NullFields []string `json:"-"`
  9353. }
  9354. func (s *ReportCriteria) MarshalJSON() ([]byte, error) {
  9355. type NoMethod ReportCriteria
  9356. raw := NoMethod(*s)
  9357. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9358. }
  9359. // ReportCrossDimensionReachCriteria: The report criteria for a report
  9360. // of type "CROSS_DIMENSION_REACH".
  9361. type ReportCrossDimensionReachCriteria struct {
  9362. // Breakdown: The list of dimensions the report should include.
  9363. Breakdown []*SortedDimension `json:"breakdown,omitempty"`
  9364. // DateRange: The date range this report should be run for.
  9365. DateRange *DateRange `json:"dateRange,omitempty"`
  9366. // Dimension: The dimension option.
  9367. //
  9368. // Possible values:
  9369. // "ADVERTISER"
  9370. // "CAMPAIGN"
  9371. // "SITE_BY_ADVERTISER"
  9372. // "SITE_BY_CAMPAIGN"
  9373. Dimension string `json:"dimension,omitempty"`
  9374. // DimensionFilters: The list of filters on which dimensions are
  9375. // filtered.
  9376. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9377. // MetricNames: The list of names of metrics the report should include.
  9378. MetricNames []string `json:"metricNames,omitempty"`
  9379. // OverlapMetricNames: The list of names of overlap metrics the report
  9380. // should include.
  9381. OverlapMetricNames []string `json:"overlapMetricNames,omitempty"`
  9382. // Pivoted: Whether the report is pivoted or not. Defaults to true.
  9383. Pivoted bool `json:"pivoted,omitempty"`
  9384. // ForceSendFields is a list of field names (e.g. "Breakdown") to
  9385. // unconditionally include in API requests. By default, fields with
  9386. // empty values are omitted from API requests. However, any non-pointer,
  9387. // non-interface field appearing in ForceSendFields will be sent to the
  9388. // server regardless of whether the field is empty or not. This may be
  9389. // used to include empty fields in Patch requests.
  9390. ForceSendFields []string `json:"-"`
  9391. // NullFields is a list of field names (e.g. "Breakdown") to include in
  9392. // API requests with the JSON null value. By default, fields with empty
  9393. // values are omitted from API requests. However, any field with an
  9394. // empty value appearing in NullFields will be sent to the server as
  9395. // null. It is an error if a field in this list has a non-empty value.
  9396. // This may be used to include null fields in Patch requests.
  9397. NullFields []string `json:"-"`
  9398. }
  9399. func (s *ReportCrossDimensionReachCriteria) MarshalJSON() ([]byte, error) {
  9400. type NoMethod ReportCrossDimensionReachCriteria
  9401. raw := NoMethod(*s)
  9402. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9403. }
  9404. // ReportDelivery: The report's email delivery settings.
  9405. type ReportDelivery struct {
  9406. // EmailOwner: Whether the report should be emailed to the report owner.
  9407. EmailOwner bool `json:"emailOwner,omitempty"`
  9408. // EmailOwnerDeliveryType: The type of delivery for the owner to
  9409. // receive, if enabled.
  9410. //
  9411. // Possible values:
  9412. // "ATTACHMENT"
  9413. // "LINK"
  9414. EmailOwnerDeliveryType string `json:"emailOwnerDeliveryType,omitempty"`
  9415. // Message: The message to be sent with each email.
  9416. Message string `json:"message,omitempty"`
  9417. // Recipients: The list of recipients to which to email the report.
  9418. Recipients []*Recipient `json:"recipients,omitempty"`
  9419. // ForceSendFields is a list of field names (e.g. "EmailOwner") to
  9420. // unconditionally include in API requests. By default, fields with
  9421. // empty values are omitted from API requests. However, any non-pointer,
  9422. // non-interface field appearing in ForceSendFields will be sent to the
  9423. // server regardless of whether the field is empty or not. This may be
  9424. // used to include empty fields in Patch requests.
  9425. ForceSendFields []string `json:"-"`
  9426. // NullFields is a list of field names (e.g. "EmailOwner") to include in
  9427. // API requests with the JSON null value. By default, fields with empty
  9428. // values are omitted from API requests. However, any field with an
  9429. // empty value appearing in NullFields will be sent to the server as
  9430. // null. It is an error if a field in this list has a non-empty value.
  9431. // This may be used to include null fields in Patch requests.
  9432. NullFields []string `json:"-"`
  9433. }
  9434. func (s *ReportDelivery) MarshalJSON() ([]byte, error) {
  9435. type NoMethod ReportDelivery
  9436. raw := NoMethod(*s)
  9437. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9438. }
  9439. // ReportFloodlightCriteria: The report criteria for a report of type
  9440. // "FLOODLIGHT".
  9441. type ReportFloodlightCriteria struct {
  9442. // CustomRichMediaEvents: The list of custom rich media events to
  9443. // include.
  9444. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9445. // DateRange: The date range this report should be run for.
  9446. DateRange *DateRange `json:"dateRange,omitempty"`
  9447. // DimensionFilters: The list of filters on which dimensions are
  9448. // filtered.
  9449. // Filters for different dimensions are ANDed, filters for the same
  9450. // dimension are grouped together and ORed.
  9451. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9452. // Dimensions: The list of dimensions the report should include.
  9453. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9454. // FloodlightConfigId: The floodlight ID for which to show data in this
  9455. // report. All advertisers associated with that ID will automatically be
  9456. // added. The dimension of the value needs to be
  9457. // 'dfa:floodlightConfigId'.
  9458. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9459. // MetricNames: The list of names of metrics the report should include.
  9460. MetricNames []string `json:"metricNames,omitempty"`
  9461. // ReportProperties: The properties of the report.
  9462. ReportProperties *ReportFloodlightCriteriaReportProperties `json:"reportProperties,omitempty"`
  9463. // ForceSendFields is a list of field names (e.g.
  9464. // "CustomRichMediaEvents") to unconditionally include in API requests.
  9465. // By default, fields with empty values are omitted from API requests.
  9466. // However, any non-pointer, non-interface field appearing in
  9467. // ForceSendFields will be sent to the server regardless of whether the
  9468. // field is empty or not. This may be used to include empty fields in
  9469. // Patch requests.
  9470. ForceSendFields []string `json:"-"`
  9471. // NullFields is a list of field names (e.g. "CustomRichMediaEvents") to
  9472. // include in API requests with the JSON null value. By default, fields
  9473. // with empty values are omitted from API requests. However, any field
  9474. // with an empty value appearing in NullFields will be sent to the
  9475. // server as null. It is an error if a field in this list has a
  9476. // non-empty value. This may be used to include null fields in Patch
  9477. // requests.
  9478. NullFields []string `json:"-"`
  9479. }
  9480. func (s *ReportFloodlightCriteria) MarshalJSON() ([]byte, error) {
  9481. type NoMethod ReportFloodlightCriteria
  9482. raw := NoMethod(*s)
  9483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9484. }
  9485. // ReportFloodlightCriteriaReportProperties: The properties of the
  9486. // report.
  9487. type ReportFloodlightCriteriaReportProperties struct {
  9488. // IncludeAttributedIPConversions: Include conversions that have no
  9489. // cookie, but do have an exposure path.
  9490. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9491. // IncludeUnattributedCookieConversions: Include conversions of users
  9492. // with a DoubleClick cookie but without an exposure. That means the
  9493. // user did not click or see an ad from the advertiser within the
  9494. // Floodlight group, or that the interaction happened outside the
  9495. // lookback window.
  9496. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9497. // IncludeUnattributedIPConversions: Include conversions that have no
  9498. // associated cookies and no exposures. It’s therefore impossible to
  9499. // know how the user was exposed to your ads during the lookback window
  9500. // prior to a conversion.
  9501. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9502. // ForceSendFields is a list of field names (e.g.
  9503. // "IncludeAttributedIPConversions") to unconditionally include in API
  9504. // requests. By default, fields with empty values are omitted from API
  9505. // requests. However, any non-pointer, non-interface field appearing in
  9506. // ForceSendFields will be sent to the server regardless of whether the
  9507. // field is empty or not. This may be used to include empty fields in
  9508. // Patch requests.
  9509. ForceSendFields []string `json:"-"`
  9510. // NullFields is a list of field names (e.g.
  9511. // "IncludeAttributedIPConversions") to include in API requests with the
  9512. // JSON null value. By default, fields with empty values are omitted
  9513. // from API requests. However, any field with an empty value appearing
  9514. // in NullFields will be sent to the server as null. It is an error if a
  9515. // field in this list has a non-empty value. This may be used to include
  9516. // null fields in Patch requests.
  9517. NullFields []string `json:"-"`
  9518. }
  9519. func (s *ReportFloodlightCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9520. type NoMethod ReportFloodlightCriteriaReportProperties
  9521. raw := NoMethod(*s)
  9522. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9523. }
  9524. // ReportPathToConversionCriteria: The report criteria for a report of
  9525. // type "PATH_TO_CONVERSION".
  9526. type ReportPathToConversionCriteria struct {
  9527. // ActivityFilters: The list of 'dfa:activity' values to filter on.
  9528. ActivityFilters []*DimensionValue `json:"activityFilters,omitempty"`
  9529. // ConversionDimensions: The list of conversion dimensions the report
  9530. // should include.
  9531. ConversionDimensions []*SortedDimension `json:"conversionDimensions,omitempty"`
  9532. // CustomFloodlightVariables: The list of custom floodlight variables
  9533. // the report should include.
  9534. CustomFloodlightVariables []*SortedDimension `json:"customFloodlightVariables,omitempty"`
  9535. // CustomRichMediaEvents: The list of custom rich media events to
  9536. // include.
  9537. CustomRichMediaEvents []*DimensionValue `json:"customRichMediaEvents,omitempty"`
  9538. // DateRange: The date range this report should be run for.
  9539. DateRange *DateRange `json:"dateRange,omitempty"`
  9540. // FloodlightConfigId: The floodlight ID for which to show data in this
  9541. // report. All advertisers associated with that ID will automatically be
  9542. // added. The dimension of the value needs to be
  9543. // 'dfa:floodlightConfigId'.
  9544. FloodlightConfigId *DimensionValue `json:"floodlightConfigId,omitempty"`
  9545. // MetricNames: The list of names of metrics the report should include.
  9546. MetricNames []string `json:"metricNames,omitempty"`
  9547. // PerInteractionDimensions: The list of per interaction dimensions the
  9548. // report should include.
  9549. PerInteractionDimensions []*SortedDimension `json:"perInteractionDimensions,omitempty"`
  9550. // ReportProperties: The properties of the report.
  9551. ReportProperties *ReportPathToConversionCriteriaReportProperties `json:"reportProperties,omitempty"`
  9552. // ForceSendFields is a list of field names (e.g. "ActivityFilters") to
  9553. // unconditionally include in API requests. By default, fields with
  9554. // empty values are omitted from API requests. However, any non-pointer,
  9555. // non-interface field appearing in ForceSendFields will be sent to the
  9556. // server regardless of whether the field is empty or not. This may be
  9557. // used to include empty fields in Patch requests.
  9558. ForceSendFields []string `json:"-"`
  9559. // NullFields is a list of field names (e.g. "ActivityFilters") to
  9560. // include in API requests with the JSON null value. By default, fields
  9561. // with empty values are omitted from API requests. However, any field
  9562. // with an empty value appearing in NullFields will be sent to the
  9563. // server as null. It is an error if a field in this list has a
  9564. // non-empty value. This may be used to include null fields in Patch
  9565. // requests.
  9566. NullFields []string `json:"-"`
  9567. }
  9568. func (s *ReportPathToConversionCriteria) MarshalJSON() ([]byte, error) {
  9569. type NoMethod ReportPathToConversionCriteria
  9570. raw := NoMethod(*s)
  9571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9572. }
  9573. // ReportPathToConversionCriteriaReportProperties: The properties of the
  9574. // report.
  9575. type ReportPathToConversionCriteriaReportProperties struct {
  9576. // ClicksLookbackWindow: DFA checks to see if a click interaction
  9577. // occurred within the specified period of time before a conversion. By
  9578. // default the value is pulled from Floodlight or you can manually enter
  9579. // a custom value. Valid values: 1-90.
  9580. ClicksLookbackWindow int64 `json:"clicksLookbackWindow,omitempty"`
  9581. // ImpressionsLookbackWindow: DFA checks to see if an impression
  9582. // interaction occurred within the specified period of time before a
  9583. // conversion. By default the value is pulled from Floodlight or you can
  9584. // manually enter a custom value. Valid values: 1-90.
  9585. ImpressionsLookbackWindow int64 `json:"impressionsLookbackWindow,omitempty"`
  9586. // IncludeAttributedIPConversions: Deprecated: has no effect.
  9587. IncludeAttributedIPConversions bool `json:"includeAttributedIPConversions,omitempty"`
  9588. // IncludeUnattributedCookieConversions: Include conversions of users
  9589. // with a DoubleClick cookie but without an exposure. That means the
  9590. // user did not click or see an ad from the advertiser within the
  9591. // Floodlight group, or that the interaction happened outside the
  9592. // lookback window.
  9593. IncludeUnattributedCookieConversions bool `json:"includeUnattributedCookieConversions,omitempty"`
  9594. // IncludeUnattributedIPConversions: Include conversions that have no
  9595. // associated cookies and no exposures. It’s therefore impossible to
  9596. // know how the user was exposed to your ads during the lookback window
  9597. // prior to a conversion.
  9598. IncludeUnattributedIPConversions bool `json:"includeUnattributedIPConversions,omitempty"`
  9599. // MaximumClickInteractions: The maximum number of click interactions to
  9600. // include in the report. Advertisers currently paying for E2C reports
  9601. // get up to 200 (100 clicks, 100 impressions). If another advertiser in
  9602. // your network is paying for E2C, you can have up to 5 total exposures
  9603. // per report.
  9604. MaximumClickInteractions int64 `json:"maximumClickInteractions,omitempty"`
  9605. // MaximumImpressionInteractions: The maximum number of click
  9606. // interactions to include in the report. Advertisers currently paying
  9607. // for E2C reports get up to 200 (100 clicks, 100 impressions). If
  9608. // another advertiser in your network is paying for E2C, you can have up
  9609. // to 5 total exposures per report.
  9610. MaximumImpressionInteractions int64 `json:"maximumImpressionInteractions,omitempty"`
  9611. // MaximumInteractionGap: The maximum amount of time that can take place
  9612. // between interactions (clicks or impressions) by the same user. Valid
  9613. // values: 1-90.
  9614. MaximumInteractionGap int64 `json:"maximumInteractionGap,omitempty"`
  9615. // PivotOnInteractionPath: Enable pivoting on interaction path.
  9616. PivotOnInteractionPath bool `json:"pivotOnInteractionPath,omitempty"`
  9617. // ForceSendFields is a list of field names (e.g.
  9618. // "ClicksLookbackWindow") to unconditionally include in API requests.
  9619. // By default, fields with empty values are omitted from API requests.
  9620. // However, any non-pointer, non-interface field appearing in
  9621. // ForceSendFields will be sent to the server regardless of whether the
  9622. // field is empty or not. This may be used to include empty fields in
  9623. // Patch requests.
  9624. ForceSendFields []string `json:"-"`
  9625. // NullFields is a list of field names (e.g. "ClicksLookbackWindow") to
  9626. // include in API requests with the JSON null value. By default, fields
  9627. // with empty values are omitted from API requests. However, any field
  9628. // with an empty value appearing in NullFields will be sent to the
  9629. // server as null. It is an error if a field in this list has a
  9630. // non-empty value. This may be used to include null fields in Patch
  9631. // requests.
  9632. NullFields []string `json:"-"`
  9633. }
  9634. func (s *ReportPathToConversionCriteriaReportProperties) MarshalJSON() ([]byte, error) {
  9635. type NoMethod ReportPathToConversionCriteriaReportProperties
  9636. raw := NoMethod(*s)
  9637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9638. }
  9639. // ReportReachCriteria: The report criteria for a report of type
  9640. // "REACH".
  9641. type ReportReachCriteria struct {
  9642. // Activities: Activity group.
  9643. Activities *Activities `json:"activities,omitempty"`
  9644. // CustomRichMediaEvents: Custom Rich Media Events group.
  9645. CustomRichMediaEvents *CustomRichMediaEvents `json:"customRichMediaEvents,omitempty"`
  9646. // DateRange: The date range this report should be run for.
  9647. DateRange *DateRange `json:"dateRange,omitempty"`
  9648. // DimensionFilters: The list of filters on which dimensions are
  9649. // filtered.
  9650. // Filters for different dimensions are ANDed, filters for the same
  9651. // dimension are grouped together and ORed.
  9652. DimensionFilters []*DimensionValue `json:"dimensionFilters,omitempty"`
  9653. // Dimensions: The list of dimensions the report should include.
  9654. Dimensions []*SortedDimension `json:"dimensions,omitempty"`
  9655. // EnableAllDimensionCombinations: Whether to enable all reach dimension
  9656. // combinations in the report. Defaults to false. If enabled, the date
  9657. // range of the report should be within the last three months.
  9658. EnableAllDimensionCombinations bool `json:"enableAllDimensionCombinations,omitempty"`
  9659. // MetricNames: The list of names of metrics the report should include.
  9660. MetricNames []string `json:"metricNames,omitempty"`
  9661. // ReachByFrequencyMetricNames: The list of names of Reach By Frequency
  9662. // metrics the report should include.
  9663. ReachByFrequencyMetricNames []string `json:"reachByFrequencyMetricNames,omitempty"`
  9664. // ForceSendFields is a list of field names (e.g. "Activities") to
  9665. // unconditionally include in API requests. By default, fields with
  9666. // empty values are omitted from API requests. However, any non-pointer,
  9667. // non-interface field appearing in ForceSendFields will be sent to the
  9668. // server regardless of whether the field is empty or not. This may be
  9669. // used to include empty fields in Patch requests.
  9670. ForceSendFields []string `json:"-"`
  9671. // NullFields is a list of field names (e.g. "Activities") to include in
  9672. // API requests with the JSON null value. By default, fields with empty
  9673. // values are omitted from API requests. However, any field with an
  9674. // empty value appearing in NullFields will be sent to the server as
  9675. // null. It is an error if a field in this list has a non-empty value.
  9676. // This may be used to include null fields in Patch requests.
  9677. NullFields []string `json:"-"`
  9678. }
  9679. func (s *ReportReachCriteria) MarshalJSON() ([]byte, error) {
  9680. type NoMethod ReportReachCriteria
  9681. raw := NoMethod(*s)
  9682. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9683. }
  9684. // ReportSchedule: The report's schedule. Can only be set if the
  9685. // report's 'dateRange' is a relative date range and the relative date
  9686. // range is not "TODAY".
  9687. type ReportSchedule struct {
  9688. // Active: Whether the schedule is active or not. Must be set to either
  9689. // true or false.
  9690. Active bool `json:"active,omitempty"`
  9691. // Every: Defines every how many days, weeks or months the report should
  9692. // be run. Needs to be set when "repeats" is either "DAILY", "WEEKLY" or
  9693. // "MONTHLY".
  9694. Every int64 `json:"every,omitempty"`
  9695. // ExpirationDate: The expiration date when the scheduled report stops
  9696. // running.
  9697. ExpirationDate string `json:"expirationDate,omitempty"`
  9698. // Repeats: The interval for which the report is repeated. Note:
  9699. // - "DAILY" also requires field "every" to be set.
  9700. // - "WEEKLY" also requires fields "every" and "repeatsOnWeekDays" to be
  9701. // set.
  9702. // - "MONTHLY" also requires fields "every" and "runsOnDayOfMonth" to be
  9703. // set.
  9704. Repeats string `json:"repeats,omitempty"`
  9705. // RepeatsOnWeekDays: List of week days "WEEKLY" on which scheduled
  9706. // reports should run.
  9707. //
  9708. // Possible values:
  9709. // "FRIDAY"
  9710. // "MONDAY"
  9711. // "SATURDAY"
  9712. // "SUNDAY"
  9713. // "THURSDAY"
  9714. // "TUESDAY"
  9715. // "WEDNESDAY"
  9716. RepeatsOnWeekDays []string `json:"repeatsOnWeekDays,omitempty"`
  9717. // RunsOnDayOfMonth: Enum to define for "MONTHLY" scheduled reports
  9718. // whether reports should be repeated on the same day of the month as
  9719. // "startDate" or the same day of the week of the month.
  9720. // Example: If 'startDate' is Monday, April 2nd 2012 (2012-04-02),
  9721. // "DAY_OF_MONTH" would run subsequent reports on the 2nd of every
  9722. // Month, and "WEEK_OF_MONTH" would run subsequent reports on the first
  9723. // Monday of the month.
  9724. //
  9725. // Possible values:
  9726. // "DAY_OF_MONTH"
  9727. // "WEEK_OF_MONTH"
  9728. RunsOnDayOfMonth string `json:"runsOnDayOfMonth,omitempty"`
  9729. // StartDate: Start date of date range for which scheduled reports
  9730. // should be run.
  9731. StartDate string `json:"startDate,omitempty"`
  9732. // ForceSendFields is a list of field names (e.g. "Active") to
  9733. // unconditionally include in API requests. By default, fields with
  9734. // empty values are omitted from API requests. However, any non-pointer,
  9735. // non-interface field appearing in ForceSendFields will be sent to the
  9736. // server regardless of whether the field is empty or not. This may be
  9737. // used to include empty fields in Patch requests.
  9738. ForceSendFields []string `json:"-"`
  9739. // NullFields is a list of field names (e.g. "Active") to include in API
  9740. // requests with the JSON null value. By default, fields with empty
  9741. // values are omitted from API requests. However, any field with an
  9742. // empty value appearing in NullFields will be sent to the server as
  9743. // null. It is an error if a field in this list has a non-empty value.
  9744. // This may be used to include null fields in Patch requests.
  9745. NullFields []string `json:"-"`
  9746. }
  9747. func (s *ReportSchedule) MarshalJSON() ([]byte, error) {
  9748. type NoMethod ReportSchedule
  9749. raw := NoMethod(*s)
  9750. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9751. }
  9752. // ReportCompatibleFields: Represents fields that are compatible to be
  9753. // selected for a report of type "STANDARD".
  9754. type ReportCompatibleFields struct {
  9755. // DimensionFilters: Dimensions which are compatible to be selected in
  9756. // the "dimensionFilters" section of the report.
  9757. DimensionFilters []*Dimension `json:"dimensionFilters,omitempty"`
  9758. // Dimensions: Dimensions which are compatible to be selected in the
  9759. // "dimensions" section of the report.
  9760. Dimensions []*Dimension `json:"dimensions,omitempty"`
  9761. // Kind: The kind of resource this is, in this case
  9762. // dfareporting#reportCompatibleFields.
  9763. Kind string `json:"kind,omitempty"`
  9764. // Metrics: Metrics which are compatible to be selected in the
  9765. // "metricNames" section of the report.
  9766. Metrics []*Metric `json:"metrics,omitempty"`
  9767. // PivotedActivityMetrics: Metrics which are compatible to be selected
  9768. // as activity metrics to pivot on in the "activities" section of the
  9769. // report.
  9770. PivotedActivityMetrics []*Metric `json:"pivotedActivityMetrics,omitempty"`
  9771. // ForceSendFields is a list of field names (e.g. "DimensionFilters") to
  9772. // unconditionally include in API requests. By default, fields with
  9773. // empty values are omitted from API requests. However, any non-pointer,
  9774. // non-interface field appearing in ForceSendFields will be sent to the
  9775. // server regardless of whether the field is empty or not. This may be
  9776. // used to include empty fields in Patch requests.
  9777. ForceSendFields []string `json:"-"`
  9778. // NullFields is a list of field names (e.g. "DimensionFilters") to
  9779. // include in API requests with the JSON null value. By default, fields
  9780. // with empty values are omitted from API requests. However, any field
  9781. // with an empty value appearing in NullFields will be sent to the
  9782. // server as null. It is an error if a field in this list has a
  9783. // non-empty value. This may be used to include null fields in Patch
  9784. // requests.
  9785. NullFields []string `json:"-"`
  9786. }
  9787. func (s *ReportCompatibleFields) MarshalJSON() ([]byte, error) {
  9788. type NoMethod ReportCompatibleFields
  9789. raw := NoMethod(*s)
  9790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9791. }
  9792. // ReportList: Represents the list of reports.
  9793. type ReportList struct {
  9794. // Etag: The eTag of this response for caching purposes.
  9795. Etag string `json:"etag,omitempty"`
  9796. // Items: The reports returned in this response.
  9797. Items []*Report `json:"items,omitempty"`
  9798. // Kind: The kind of list this is, in this case dfareporting#reportList.
  9799. Kind string `json:"kind,omitempty"`
  9800. // NextPageToken: Continuation token used to page through reports. To
  9801. // retrieve the next page of results, set the next request's "pageToken"
  9802. // to the value of this field. The page token is only valid for a
  9803. // limited amount of time and should not be persisted.
  9804. NextPageToken string `json:"nextPageToken,omitempty"`
  9805. // ServerResponse contains the HTTP response code and headers from the
  9806. // server.
  9807. googleapi.ServerResponse `json:"-"`
  9808. // ForceSendFields is a list of field names (e.g. "Etag") to
  9809. // unconditionally include in API requests. By default, fields with
  9810. // empty values are omitted from API requests. However, any non-pointer,
  9811. // non-interface field appearing in ForceSendFields will be sent to the
  9812. // server regardless of whether the field is empty or not. This may be
  9813. // used to include empty fields in Patch requests.
  9814. ForceSendFields []string `json:"-"`
  9815. // NullFields is a list of field names (e.g. "Etag") to include in API
  9816. // requests with the JSON null value. By default, fields with empty
  9817. // values are omitted from API requests. However, any field with an
  9818. // empty value appearing in NullFields will be sent to the server as
  9819. // null. It is an error if a field in this list has a non-empty value.
  9820. // This may be used to include null fields in Patch requests.
  9821. NullFields []string `json:"-"`
  9822. }
  9823. func (s *ReportList) MarshalJSON() ([]byte, error) {
  9824. type NoMethod ReportList
  9825. raw := NoMethod(*s)
  9826. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9827. }
  9828. // ReportsConfiguration: Reporting Configuration
  9829. type ReportsConfiguration struct {
  9830. // ExposureToConversionEnabled: Whether the exposure to conversion
  9831. // report is enabled. This report shows detailed pathway information on
  9832. // up to 10 of the most recent ad exposures seen by a user before
  9833. // converting.
  9834. ExposureToConversionEnabled bool `json:"exposureToConversionEnabled,omitempty"`
  9835. // LookbackConfiguration: Default lookback windows for new advertisers
  9836. // in this account.
  9837. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  9838. // ReportGenerationTimeZoneId: Report generation time zone ID of this
  9839. // account. This is a required field that can only be changed by a
  9840. // superuser.
  9841. // Acceptable values are:
  9842. //
  9843. // - "1" for "America/New_York"
  9844. // - "2" for "Europe/London"
  9845. // - "3" for "Europe/Paris"
  9846. // - "4" for "Africa/Johannesburg"
  9847. // - "5" for "Asia/Jerusalem"
  9848. // - "6" for "Asia/Shanghai"
  9849. // - "7" for "Asia/Hong_Kong"
  9850. // - "8" for "Asia/Tokyo"
  9851. // - "9" for "Australia/Sydney"
  9852. // - "10" for "Asia/Dubai"
  9853. // - "11" for "America/Los_Angeles"
  9854. // - "12" for "Pacific/Auckland"
  9855. // - "13" for "America/Sao_Paulo"
  9856. ReportGenerationTimeZoneId int64 `json:"reportGenerationTimeZoneId,omitempty,string"`
  9857. // ForceSendFields is a list of field names (e.g.
  9858. // "ExposureToConversionEnabled") to unconditionally include in API
  9859. // requests. By default, fields with empty values are omitted from API
  9860. // requests. However, any non-pointer, non-interface field appearing in
  9861. // ForceSendFields will be sent to the server regardless of whether the
  9862. // field is empty or not. This may be used to include empty fields in
  9863. // Patch requests.
  9864. ForceSendFields []string `json:"-"`
  9865. // NullFields is a list of field names (e.g.
  9866. // "ExposureToConversionEnabled") to include in API requests with the
  9867. // JSON null value. By default, fields with empty values are omitted
  9868. // from API requests. However, any field with an empty value appearing
  9869. // in NullFields will be sent to the server as null. It is an error if a
  9870. // field in this list has a non-empty value. This may be used to include
  9871. // null fields in Patch requests.
  9872. NullFields []string `json:"-"`
  9873. }
  9874. func (s *ReportsConfiguration) MarshalJSON() ([]byte, error) {
  9875. type NoMethod ReportsConfiguration
  9876. raw := NoMethod(*s)
  9877. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9878. }
  9879. // RichMediaExitOverride: Rich Media Exit Override.
  9880. type RichMediaExitOverride struct {
  9881. // ClickThroughUrl: Click-through URL of this rich media exit override.
  9882. // Applicable if the enabled field is set to true.
  9883. ClickThroughUrl *ClickThroughUrl `json:"clickThroughUrl,omitempty"`
  9884. // Enabled: Whether to use the clickThroughUrl. If false, the
  9885. // creative-level exit will be used.
  9886. Enabled bool `json:"enabled,omitempty"`
  9887. // ExitId: ID for the override to refer to a specific exit in the
  9888. // creative.
  9889. ExitId int64 `json:"exitId,omitempty,string"`
  9890. // ForceSendFields is a list of field names (e.g. "ClickThroughUrl") to
  9891. // unconditionally include in API requests. By default, fields with
  9892. // empty values are omitted from API requests. However, any non-pointer,
  9893. // non-interface field appearing in ForceSendFields will be sent to the
  9894. // server regardless of whether the field is empty or not. This may be
  9895. // used to include empty fields in Patch requests.
  9896. ForceSendFields []string `json:"-"`
  9897. // NullFields is a list of field names (e.g. "ClickThroughUrl") to
  9898. // include in API requests with the JSON null value. By default, fields
  9899. // with empty values are omitted from API requests. However, any field
  9900. // with an empty value appearing in NullFields will be sent to the
  9901. // server as null. It is an error if a field in this list has a
  9902. // non-empty value. This may be used to include null fields in Patch
  9903. // requests.
  9904. NullFields []string `json:"-"`
  9905. }
  9906. func (s *RichMediaExitOverride) MarshalJSON() ([]byte, error) {
  9907. type NoMethod RichMediaExitOverride
  9908. raw := NoMethod(*s)
  9909. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9910. }
  9911. // Rule: A rule associates an asset with a targeting template for
  9912. // asset-level targeting. Applicable to INSTREAM_VIDEO creatives.
  9913. type Rule struct {
  9914. // AssetId: A creativeAssets[].id. This should refer to one of the
  9915. // parent assets in this creative. This is a required field.
  9916. AssetId int64 `json:"assetId,omitempty,string"`
  9917. // Name: A user-friendly name for this rule. This is a required field.
  9918. Name string `json:"name,omitempty"`
  9919. // TargetingTemplateId: A targeting template ID. The targeting from the
  9920. // targeting template will be used to determine whether this asset
  9921. // should be served. This is a required field.
  9922. TargetingTemplateId int64 `json:"targetingTemplateId,omitempty,string"`
  9923. // ForceSendFields is a list of field names (e.g. "AssetId") to
  9924. // unconditionally include in API requests. By default, fields with
  9925. // empty values are omitted from API requests. However, any non-pointer,
  9926. // non-interface field appearing in ForceSendFields will be sent to the
  9927. // server regardless of whether the field is empty or not. This may be
  9928. // used to include empty fields in Patch requests.
  9929. ForceSendFields []string `json:"-"`
  9930. // NullFields is a list of field names (e.g. "AssetId") to include in
  9931. // API requests with the JSON null value. By default, fields with empty
  9932. // values are omitted from API requests. However, any field with an
  9933. // empty value appearing in NullFields will be sent to the server as
  9934. // null. It is an error if a field in this list has a non-empty value.
  9935. // This may be used to include null fields in Patch requests.
  9936. NullFields []string `json:"-"`
  9937. }
  9938. func (s *Rule) MarshalJSON() ([]byte, error) {
  9939. type NoMethod Rule
  9940. raw := NoMethod(*s)
  9941. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  9942. }
  9943. // Site: Contains properties of a site.
  9944. type Site struct {
  9945. // AccountId: Account ID of this site. This is a read-only field that
  9946. // can be left blank.
  9947. AccountId int64 `json:"accountId,omitempty,string"`
  9948. // Approved: Whether this site is approved.
  9949. Approved bool `json:"approved,omitempty"`
  9950. // DirectorySiteId: Directory site associated with this site. This is a
  9951. // required field that is read-only after insertion.
  9952. DirectorySiteId int64 `json:"directorySiteId,omitempty,string"`
  9953. // DirectorySiteIdDimensionValue: Dimension value for the ID of the
  9954. // directory site. This is a read-only, auto-generated field.
  9955. DirectorySiteIdDimensionValue *DimensionValue `json:"directorySiteIdDimensionValue,omitempty"`
  9956. // Id: ID of this site. This is a read-only, auto-generated field.
  9957. Id int64 `json:"id,omitempty,string"`
  9958. // IdDimensionValue: Dimension value for the ID of this site. This is a
  9959. // read-only, auto-generated field.
  9960. IdDimensionValue *DimensionValue `json:"idDimensionValue,omitempty"`
  9961. // KeyName: Key name of this site. This is a read-only, auto-generated
  9962. // field.
  9963. KeyName string `json:"keyName,omitempty"`
  9964. // Kind: Identifies what kind of resource this is. Value: the fixed
  9965. // string "dfareporting#site".
  9966. Kind string `json:"kind,omitempty"`
  9967. // Name: Name of this site.This is a required field. Must be less than
  9968. // 128 characters long. If this site is under a subaccount, the name
  9969. // must be unique among sites of the same subaccount. Otherwise, this
  9970. // site is a top-level site, and the name must be unique among top-level
  9971. // sites of the same account.
  9972. Name string `json:"name,omitempty"`
  9973. // SiteContacts: Site contacts.
  9974. SiteContacts []*SiteContact `json:"siteContacts,omitempty"`
  9975. // SiteSettings: Site-wide settings.
  9976. SiteSettings *SiteSettings `json:"siteSettings,omitempty"`
  9977. // SubaccountId: Subaccount ID of this site. This is a read-only field
  9978. // that can be left blank.
  9979. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  9980. // ServerResponse contains the HTTP response code and headers from the
  9981. // server.
  9982. googleapi.ServerResponse `json:"-"`
  9983. // ForceSendFields is a list of field names (e.g. "AccountId") to
  9984. // unconditionally include in API requests. By default, fields with
  9985. // empty values are omitted from API requests. However, any non-pointer,
  9986. // non-interface field appearing in ForceSendFields will be sent to the
  9987. // server regardless of whether the field is empty or not. This may be
  9988. // used to include empty fields in Patch requests.
  9989. ForceSendFields []string `json:"-"`
  9990. // NullFields is a list of field names (e.g. "AccountId") to include in
  9991. // API requests with the JSON null value. By default, fields with empty
  9992. // values are omitted from API requests. However, any field with an
  9993. // empty value appearing in NullFields will be sent to the server as
  9994. // null. It is an error if a field in this list has a non-empty value.
  9995. // This may be used to include null fields in Patch requests.
  9996. NullFields []string `json:"-"`
  9997. }
  9998. func (s *Site) MarshalJSON() ([]byte, error) {
  9999. type NoMethod Site
  10000. raw := NoMethod(*s)
  10001. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10002. }
  10003. // SiteContact: Site Contact
  10004. type SiteContact struct {
  10005. // Address: Address of this site contact.
  10006. Address string `json:"address,omitempty"`
  10007. // ContactType: Site contact type.
  10008. //
  10009. // Possible values:
  10010. // "SALES_PERSON"
  10011. // "TRAFFICKER"
  10012. ContactType string `json:"contactType,omitempty"`
  10013. // Email: Email address of this site contact. This is a required field.
  10014. Email string `json:"email,omitempty"`
  10015. // FirstName: First name of this site contact.
  10016. FirstName string `json:"firstName,omitempty"`
  10017. // Id: ID of this site contact. This is a read-only, auto-generated
  10018. // field.
  10019. Id int64 `json:"id,omitempty,string"`
  10020. // LastName: Last name of this site contact.
  10021. LastName string `json:"lastName,omitempty"`
  10022. // Phone: Primary phone number of this site contact.
  10023. Phone string `json:"phone,omitempty"`
  10024. // Title: Title or designation of this site contact.
  10025. Title string `json:"title,omitempty"`
  10026. // ForceSendFields is a list of field names (e.g. "Address") to
  10027. // unconditionally include in API requests. By default, fields with
  10028. // empty values are omitted from API requests. However, any non-pointer,
  10029. // non-interface field appearing in ForceSendFields will be sent to the
  10030. // server regardless of whether the field is empty or not. This may be
  10031. // used to include empty fields in Patch requests.
  10032. ForceSendFields []string `json:"-"`
  10033. // NullFields is a list of field names (e.g. "Address") to include in
  10034. // API requests with the JSON null value. By default, fields with empty
  10035. // values are omitted from API requests. However, any field with an
  10036. // empty value appearing in NullFields will be sent to the server as
  10037. // null. It is an error if a field in this list has a non-empty value.
  10038. // This may be used to include null fields in Patch requests.
  10039. NullFields []string `json:"-"`
  10040. }
  10041. func (s *SiteContact) MarshalJSON() ([]byte, error) {
  10042. type NoMethod SiteContact
  10043. raw := NoMethod(*s)
  10044. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10045. }
  10046. // SiteSettings: Site Settings
  10047. type SiteSettings struct {
  10048. // ActiveViewOptOut: Whether active view creatives are disabled for this
  10049. // site.
  10050. ActiveViewOptOut bool `json:"activeViewOptOut,omitempty"`
  10051. // CreativeSettings: Site-wide creative settings.
  10052. CreativeSettings *CreativeSettings `json:"creativeSettings,omitempty"`
  10053. // DisableBrandSafeAds: Whether brand safe ads are disabled for this
  10054. // site.
  10055. DisableBrandSafeAds bool `json:"disableBrandSafeAds,omitempty"`
  10056. // DisableNewCookie: Whether new cookies are disabled for this site.
  10057. DisableNewCookie bool `json:"disableNewCookie,omitempty"`
  10058. // LookbackConfiguration: Lookback window settings for this site.
  10059. LookbackConfiguration *LookbackConfiguration `json:"lookbackConfiguration,omitempty"`
  10060. // TagSetting: Configuration settings for dynamic and image floodlight
  10061. // tags.
  10062. TagSetting *TagSetting `json:"tagSetting,omitempty"`
  10063. // VideoActiveViewOptOutTemplate: Whether Verification and ActiveView
  10064. // for in-stream video creatives are disabled by default for new
  10065. // placements created under this site. This value will be used to
  10066. // populate the placement.videoActiveViewOptOut field, when no value is
  10067. // specified for the new placement.
  10068. VideoActiveViewOptOutTemplate bool `json:"videoActiveViewOptOutTemplate,omitempty"`
  10069. // VpaidAdapterChoiceTemplate: Default VPAID adapter setting for new
  10070. // placements created under this site. This value will be used to
  10071. // populate the placements.vpaidAdapterChoice field, when no value is
  10072. // specified for the new placement. Controls which VPAID format the
  10073. // measurement adapter will use for in-stream video creatives assigned
  10074. // to the placement. The publisher's specifications will typically
  10075. // determine this setting. For VPAID creatives, the adapter format will
  10076. // match the VPAID format (HTML5 VPAID creatives use the HTML5
  10077. // adapter).
  10078. //
  10079. // Note: Flash is no longer supported. This field now defaults to HTML5
  10080. // when the following values are provided: FLASH, BOTH.
  10081. //
  10082. // Possible values:
  10083. // "BOTH"
  10084. // "DEFAULT"
  10085. // "FLASH"
  10086. // "HTML5"
  10087. VpaidAdapterChoiceTemplate string `json:"vpaidAdapterChoiceTemplate,omitempty"`
  10088. // ForceSendFields is a list of field names (e.g. "ActiveViewOptOut") to
  10089. // unconditionally include in API requests. By default, fields with
  10090. // empty values are omitted from API requests. However, any non-pointer,
  10091. // non-interface field appearing in ForceSendFields will be sent to the
  10092. // server regardless of whether the field is empty or not. This may be
  10093. // used to include empty fields in Patch requests.
  10094. ForceSendFields []string `json:"-"`
  10095. // NullFields is a list of field names (e.g. "ActiveViewOptOut") to
  10096. // include in API requests with the JSON null value. By default, fields
  10097. // with empty values are omitted from API requests. However, any field
  10098. // with an empty value appearing in NullFields will be sent to the
  10099. // server as null. It is an error if a field in this list has a
  10100. // non-empty value. This may be used to include null fields in Patch
  10101. // requests.
  10102. NullFields []string `json:"-"`
  10103. }
  10104. func (s *SiteSettings) MarshalJSON() ([]byte, error) {
  10105. type NoMethod SiteSettings
  10106. raw := NoMethod(*s)
  10107. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10108. }
  10109. // SitesListResponse: Site List Response
  10110. type SitesListResponse struct {
  10111. // Kind: Identifies what kind of resource this is. Value: the fixed
  10112. // string "dfareporting#sitesListResponse".
  10113. Kind string `json:"kind,omitempty"`
  10114. // NextPageToken: Pagination token to be used for the next list
  10115. // operation.
  10116. NextPageToken string `json:"nextPageToken,omitempty"`
  10117. // Sites: Site collection.
  10118. Sites []*Site `json:"sites,omitempty"`
  10119. // ServerResponse contains the HTTP response code and headers from the
  10120. // server.
  10121. googleapi.ServerResponse `json:"-"`
  10122. // ForceSendFields is a list of field names (e.g. "Kind") to
  10123. // unconditionally include in API requests. By default, fields with
  10124. // empty values are omitted from API requests. However, any non-pointer,
  10125. // non-interface field appearing in ForceSendFields will be sent to the
  10126. // server regardless of whether the field is empty or not. This may be
  10127. // used to include empty fields in Patch requests.
  10128. ForceSendFields []string `json:"-"`
  10129. // NullFields is a list of field names (e.g. "Kind") to include in API
  10130. // requests with the JSON null value. By default, fields with empty
  10131. // values are omitted from API requests. However, any field with an
  10132. // empty value appearing in NullFields will be sent to the server as
  10133. // null. It is an error if a field in this list has a non-empty value.
  10134. // This may be used to include null fields in Patch requests.
  10135. NullFields []string `json:"-"`
  10136. }
  10137. func (s *SitesListResponse) MarshalJSON() ([]byte, error) {
  10138. type NoMethod SitesListResponse
  10139. raw := NoMethod(*s)
  10140. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10141. }
  10142. // Size: Represents the dimensions of ads, placements, creatives, or
  10143. // creative assets.
  10144. type Size struct {
  10145. // Height: Height of this size. Acceptable values are 0 to 32767,
  10146. // inclusive.
  10147. Height int64 `json:"height,omitempty"`
  10148. // Iab: IAB standard size. This is a read-only, auto-generated field.
  10149. Iab bool `json:"iab,omitempty"`
  10150. // Id: ID of this size. This is a read-only, auto-generated field.
  10151. Id int64 `json:"id,omitempty,string"`
  10152. // Kind: Identifies what kind of resource this is. Value: the fixed
  10153. // string "dfareporting#size".
  10154. Kind string `json:"kind,omitempty"`
  10155. // Width: Width of this size. Acceptable values are 0 to 32767,
  10156. // inclusive.
  10157. Width int64 `json:"width,omitempty"`
  10158. // ServerResponse contains the HTTP response code and headers from the
  10159. // server.
  10160. googleapi.ServerResponse `json:"-"`
  10161. // ForceSendFields is a list of field names (e.g. "Height") to
  10162. // unconditionally include in API requests. By default, fields with
  10163. // empty values are omitted from API requests. However, any non-pointer,
  10164. // non-interface field appearing in ForceSendFields will be sent to the
  10165. // server regardless of whether the field is empty or not. This may be
  10166. // used to include empty fields in Patch requests.
  10167. ForceSendFields []string `json:"-"`
  10168. // NullFields is a list of field names (e.g. "Height") to include in API
  10169. // requests with the JSON null value. By default, fields with empty
  10170. // values are omitted from API requests. However, any field with an
  10171. // empty value appearing in NullFields will be sent to the server as
  10172. // null. It is an error if a field in this list has a non-empty value.
  10173. // This may be used to include null fields in Patch requests.
  10174. NullFields []string `json:"-"`
  10175. }
  10176. func (s *Size) MarshalJSON() ([]byte, error) {
  10177. type NoMethod Size
  10178. raw := NoMethod(*s)
  10179. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10180. }
  10181. // SizesListResponse: Size List Response
  10182. type SizesListResponse struct {
  10183. // Kind: Identifies what kind of resource this is. Value: the fixed
  10184. // string "dfareporting#sizesListResponse".
  10185. Kind string `json:"kind,omitempty"`
  10186. // Sizes: Size collection.
  10187. Sizes []*Size `json:"sizes,omitempty"`
  10188. // ServerResponse contains the HTTP response code and headers from the
  10189. // server.
  10190. googleapi.ServerResponse `json:"-"`
  10191. // ForceSendFields is a list of field names (e.g. "Kind") to
  10192. // unconditionally include in API requests. By default, fields with
  10193. // empty values are omitted from API requests. However, any non-pointer,
  10194. // non-interface field appearing in ForceSendFields will be sent to the
  10195. // server regardless of whether the field is empty or not. This may be
  10196. // used to include empty fields in Patch requests.
  10197. ForceSendFields []string `json:"-"`
  10198. // NullFields is a list of field names (e.g. "Kind") to include in API
  10199. // requests with the JSON null value. By default, fields with empty
  10200. // values are omitted from API requests. However, any field with an
  10201. // empty value appearing in NullFields will be sent to the server as
  10202. // null. It is an error if a field in this list has a non-empty value.
  10203. // This may be used to include null fields in Patch requests.
  10204. NullFields []string `json:"-"`
  10205. }
  10206. func (s *SizesListResponse) MarshalJSON() ([]byte, error) {
  10207. type NoMethod SizesListResponse
  10208. raw := NoMethod(*s)
  10209. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10210. }
  10211. // SkippableSetting: Skippable Settings
  10212. type SkippableSetting struct {
  10213. // Kind: Identifies what kind of resource this is. Value: the fixed
  10214. // string "dfareporting#skippableSetting".
  10215. Kind string `json:"kind,omitempty"`
  10216. // ProgressOffset: Amount of time to play videos served to this
  10217. // placement before counting a view. Applicable when skippable is true.
  10218. ProgressOffset *VideoOffset `json:"progressOffset,omitempty"`
  10219. // SkipOffset: Amount of time to play videos served to this placement
  10220. // before the skip button should appear. Applicable when skippable is
  10221. // true.
  10222. SkipOffset *VideoOffset `json:"skipOffset,omitempty"`
  10223. // Skippable: Whether the user can skip creatives served to this
  10224. // placement.
  10225. Skippable bool `json:"skippable,omitempty"`
  10226. // ForceSendFields is a list of field names (e.g. "Kind") to
  10227. // unconditionally include in API requests. By default, fields with
  10228. // empty values are omitted from API requests. However, any non-pointer,
  10229. // non-interface field appearing in ForceSendFields will be sent to the
  10230. // server regardless of whether the field is empty or not. This may be
  10231. // used to include empty fields in Patch requests.
  10232. ForceSendFields []string `json:"-"`
  10233. // NullFields is a list of field names (e.g. "Kind") to include in API
  10234. // requests with the JSON null value. By default, fields with empty
  10235. // values are omitted from API requests. However, any field with an
  10236. // empty value appearing in NullFields will be sent to the server as
  10237. // null. It is an error if a field in this list has a non-empty value.
  10238. // This may be used to include null fields in Patch requests.
  10239. NullFields []string `json:"-"`
  10240. }
  10241. func (s *SkippableSetting) MarshalJSON() ([]byte, error) {
  10242. type NoMethod SkippableSetting
  10243. raw := NoMethod(*s)
  10244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10245. }
  10246. // SortedDimension: Represents a sorted dimension.
  10247. type SortedDimension struct {
  10248. // Kind: The kind of resource this is, in this case
  10249. // dfareporting#sortedDimension.
  10250. Kind string `json:"kind,omitempty"`
  10251. // Name: The name of the dimension.
  10252. Name string `json:"name,omitempty"`
  10253. // SortOrder: An optional sort order for the dimension column.
  10254. //
  10255. // Possible values:
  10256. // "ASCENDING"
  10257. // "DESCENDING"
  10258. SortOrder string `json:"sortOrder,omitempty"`
  10259. // ForceSendFields is a list of field names (e.g. "Kind") to
  10260. // unconditionally include in API requests. By default, fields with
  10261. // empty values are omitted from API requests. However, any non-pointer,
  10262. // non-interface field appearing in ForceSendFields will be sent to the
  10263. // server regardless of whether the field is empty or not. This may be
  10264. // used to include empty fields in Patch requests.
  10265. ForceSendFields []string `json:"-"`
  10266. // NullFields is a list of field names (e.g. "Kind") to include in API
  10267. // requests with the JSON null value. By default, fields with empty
  10268. // values are omitted from API requests. However, any field with an
  10269. // empty value appearing in NullFields will be sent to the server as
  10270. // null. It is an error if a field in this list has a non-empty value.
  10271. // This may be used to include null fields in Patch requests.
  10272. NullFields []string `json:"-"`
  10273. }
  10274. func (s *SortedDimension) MarshalJSON() ([]byte, error) {
  10275. type NoMethod SortedDimension
  10276. raw := NoMethod(*s)
  10277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10278. }
  10279. // Subaccount: Contains properties of a DCM subaccount.
  10280. type Subaccount struct {
  10281. // AccountId: ID of the account that contains this subaccount. This is a
  10282. // read-only field that can be left blank.
  10283. AccountId int64 `json:"accountId,omitempty,string"`
  10284. // AvailablePermissionIds: IDs of the available user role permissions
  10285. // for this subaccount.
  10286. AvailablePermissionIds googleapi.Int64s `json:"availablePermissionIds,omitempty"`
  10287. // Id: ID of this subaccount. This is a read-only, auto-generated field.
  10288. Id int64 `json:"id,omitempty,string"`
  10289. // Kind: Identifies what kind of resource this is. Value: the fixed
  10290. // string "dfareporting#subaccount".
  10291. Kind string `json:"kind,omitempty"`
  10292. // Name: Name of this subaccount. This is a required field. Must be less
  10293. // than 128 characters long and be unique among subaccounts of the same
  10294. // account.
  10295. Name string `json:"name,omitempty"`
  10296. // ServerResponse contains the HTTP response code and headers from the
  10297. // server.
  10298. googleapi.ServerResponse `json:"-"`
  10299. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10300. // unconditionally include in API requests. By default, fields with
  10301. // empty values are omitted from API requests. However, any non-pointer,
  10302. // non-interface field appearing in ForceSendFields will be sent to the
  10303. // server regardless of whether the field is empty or not. This may be
  10304. // used to include empty fields in Patch requests.
  10305. ForceSendFields []string `json:"-"`
  10306. // NullFields is a list of field names (e.g. "AccountId") to include in
  10307. // API requests with the JSON null value. By default, fields with empty
  10308. // values are omitted from API requests. However, any field with an
  10309. // empty value appearing in NullFields will be sent to the server as
  10310. // null. It is an error if a field in this list has a non-empty value.
  10311. // This may be used to include null fields in Patch requests.
  10312. NullFields []string `json:"-"`
  10313. }
  10314. func (s *Subaccount) MarshalJSON() ([]byte, error) {
  10315. type NoMethod Subaccount
  10316. raw := NoMethod(*s)
  10317. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10318. }
  10319. // SubaccountsListResponse: Subaccount List Response
  10320. type SubaccountsListResponse struct {
  10321. // Kind: Identifies what kind of resource this is. Value: the fixed
  10322. // string "dfareporting#subaccountsListResponse".
  10323. Kind string `json:"kind,omitempty"`
  10324. // NextPageToken: Pagination token to be used for the next list
  10325. // operation.
  10326. NextPageToken string `json:"nextPageToken,omitempty"`
  10327. // Subaccounts: Subaccount collection.
  10328. Subaccounts []*Subaccount `json:"subaccounts,omitempty"`
  10329. // ServerResponse contains the HTTP response code and headers from the
  10330. // server.
  10331. googleapi.ServerResponse `json:"-"`
  10332. // ForceSendFields is a list of field names (e.g. "Kind") to
  10333. // unconditionally include in API requests. By default, fields with
  10334. // empty values are omitted from API requests. However, any non-pointer,
  10335. // non-interface field appearing in ForceSendFields will be sent to the
  10336. // server regardless of whether the field is empty or not. This may be
  10337. // used to include empty fields in Patch requests.
  10338. ForceSendFields []string `json:"-"`
  10339. // NullFields is a list of field names (e.g. "Kind") to include in API
  10340. // requests with the JSON null value. By default, fields with empty
  10341. // values are omitted from API requests. However, any field with an
  10342. // empty value appearing in NullFields will be sent to the server as
  10343. // null. It is an error if a field in this list has a non-empty value.
  10344. // This may be used to include null fields in Patch requests.
  10345. NullFields []string `json:"-"`
  10346. }
  10347. func (s *SubaccountsListResponse) MarshalJSON() ([]byte, error) {
  10348. type NoMethod SubaccountsListResponse
  10349. raw := NoMethod(*s)
  10350. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10351. }
  10352. // TagData: Placement Tag Data
  10353. type TagData struct {
  10354. // AdId: Ad associated with this placement tag. Applicable only when
  10355. // format is PLACEMENT_TAG_TRACKING.
  10356. AdId int64 `json:"adId,omitempty,string"`
  10357. // ClickTag: Tag string to record a click.
  10358. ClickTag string `json:"clickTag,omitempty"`
  10359. // CreativeId: Creative associated with this placement tag. Applicable
  10360. // only when format is PLACEMENT_TAG_TRACKING.
  10361. CreativeId int64 `json:"creativeId,omitempty,string"`
  10362. // Format: TagData tag format of this tag.
  10363. //
  10364. // Possible values:
  10365. // "PLACEMENT_TAG_CLICK_COMMANDS"
  10366. // "PLACEMENT_TAG_IFRAME_ILAYER"
  10367. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  10368. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  10369. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  10370. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  10371. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  10372. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  10373. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  10374. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  10375. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  10376. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  10377. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  10378. // "PLACEMENT_TAG_JAVASCRIPT"
  10379. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  10380. // "PLACEMENT_TAG_STANDARD"
  10381. // "PLACEMENT_TAG_TRACKING"
  10382. // "PLACEMENT_TAG_TRACKING_IFRAME"
  10383. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  10384. Format string `json:"format,omitempty"`
  10385. // ImpressionTag: Tag string for serving an ad.
  10386. ImpressionTag string `json:"impressionTag,omitempty"`
  10387. // ForceSendFields is a list of field names (e.g. "AdId") to
  10388. // unconditionally include in API requests. By default, fields with
  10389. // empty values are omitted from API requests. However, any non-pointer,
  10390. // non-interface field appearing in ForceSendFields will be sent to the
  10391. // server regardless of whether the field is empty or not. This may be
  10392. // used to include empty fields in Patch requests.
  10393. ForceSendFields []string `json:"-"`
  10394. // NullFields is a list of field names (e.g. "AdId") to include in API
  10395. // requests with the JSON null value. By default, fields with empty
  10396. // values are omitted from API requests. However, any field with an
  10397. // empty value appearing in NullFields will be sent to the server as
  10398. // null. It is an error if a field in this list has a non-empty value.
  10399. // This may be used to include null fields in Patch requests.
  10400. NullFields []string `json:"-"`
  10401. }
  10402. func (s *TagData) MarshalJSON() ([]byte, error) {
  10403. type NoMethod TagData
  10404. raw := NoMethod(*s)
  10405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10406. }
  10407. // TagSetting: Tag Settings
  10408. type TagSetting struct {
  10409. // AdditionalKeyValues: Additional key-values to be included in tags.
  10410. // Each key-value pair must be of the form key=value, and pairs must be
  10411. // separated by a semicolon (;). Keys and values must not contain
  10412. // commas. For example, id=2;color=red is a valid value for this field.
  10413. AdditionalKeyValues string `json:"additionalKeyValues,omitempty"`
  10414. // IncludeClickThroughUrls: Whether static landing page URLs should be
  10415. // included in the tags. This setting applies only to placements.
  10416. IncludeClickThroughUrls bool `json:"includeClickThroughUrls,omitempty"`
  10417. // IncludeClickTracking: Whether click-tracking string should be
  10418. // included in the tags.
  10419. IncludeClickTracking bool `json:"includeClickTracking,omitempty"`
  10420. // KeywordOption: Option specifying how keywords are embedded in ad
  10421. // tags. This setting can be used to specify whether keyword
  10422. // placeholders are inserted in placement tags for this site. Publishers
  10423. // can then add keywords to those placeholders.
  10424. //
  10425. // Possible values:
  10426. // "GENERATE_SEPARATE_TAG_FOR_EACH_KEYWORD"
  10427. // "IGNORE"
  10428. // "PLACEHOLDER_WITH_LIST_OF_KEYWORDS"
  10429. KeywordOption string `json:"keywordOption,omitempty"`
  10430. // ForceSendFields is a list of field names (e.g. "AdditionalKeyValues")
  10431. // to unconditionally include in API requests. By default, fields with
  10432. // empty values are omitted from API requests. However, any non-pointer,
  10433. // non-interface field appearing in ForceSendFields will be sent to the
  10434. // server regardless of whether the field is empty or not. This may be
  10435. // used to include empty fields in Patch requests.
  10436. ForceSendFields []string `json:"-"`
  10437. // NullFields is a list of field names (e.g. "AdditionalKeyValues") to
  10438. // include in API requests with the JSON null value. By default, fields
  10439. // with empty values are omitted from API requests. However, any field
  10440. // with an empty value appearing in NullFields will be sent to the
  10441. // server as null. It is an error if a field in this list has a
  10442. // non-empty value. This may be used to include null fields in Patch
  10443. // requests.
  10444. NullFields []string `json:"-"`
  10445. }
  10446. func (s *TagSetting) MarshalJSON() ([]byte, error) {
  10447. type NoMethod TagSetting
  10448. raw := NoMethod(*s)
  10449. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10450. }
  10451. // TagSettings: Dynamic and Image Tag Settings.
  10452. type TagSettings struct {
  10453. // DynamicTagEnabled: Whether dynamic floodlight tags are enabled.
  10454. DynamicTagEnabled bool `json:"dynamicTagEnabled,omitempty"`
  10455. // ImageTagEnabled: Whether image tags are enabled.
  10456. ImageTagEnabled bool `json:"imageTagEnabled,omitempty"`
  10457. // ForceSendFields is a list of field names (e.g. "DynamicTagEnabled")
  10458. // to unconditionally include in API requests. By default, fields with
  10459. // empty values are omitted from API requests. However, any non-pointer,
  10460. // non-interface field appearing in ForceSendFields will be sent to the
  10461. // server regardless of whether the field is empty or not. This may be
  10462. // used to include empty fields in Patch requests.
  10463. ForceSendFields []string `json:"-"`
  10464. // NullFields is a list of field names (e.g. "DynamicTagEnabled") to
  10465. // include in API requests with the JSON null value. By default, fields
  10466. // with empty values are omitted from API requests. However, any field
  10467. // with an empty value appearing in NullFields will be sent to the
  10468. // server as null. It is an error if a field in this list has a
  10469. // non-empty value. This may be used to include null fields in Patch
  10470. // requests.
  10471. NullFields []string `json:"-"`
  10472. }
  10473. func (s *TagSettings) MarshalJSON() ([]byte, error) {
  10474. type NoMethod TagSettings
  10475. raw := NoMethod(*s)
  10476. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10477. }
  10478. // TargetWindow: Target Window.
  10479. type TargetWindow struct {
  10480. // CustomHtml: User-entered value.
  10481. CustomHtml string `json:"customHtml,omitempty"`
  10482. // TargetWindowOption: Type of browser window for which the backup image
  10483. // of the flash creative can be displayed.
  10484. //
  10485. // Possible values:
  10486. // "CURRENT_WINDOW"
  10487. // "CUSTOM"
  10488. // "NEW_WINDOW"
  10489. TargetWindowOption string `json:"targetWindowOption,omitempty"`
  10490. // ForceSendFields is a list of field names (e.g. "CustomHtml") to
  10491. // unconditionally include in API requests. By default, fields with
  10492. // empty values are omitted from API requests. However, any non-pointer,
  10493. // non-interface field appearing in ForceSendFields will be sent to the
  10494. // server regardless of whether the field is empty or not. This may be
  10495. // used to include empty fields in Patch requests.
  10496. ForceSendFields []string `json:"-"`
  10497. // NullFields is a list of field names (e.g. "CustomHtml") to include in
  10498. // API requests with the JSON null value. By default, fields with empty
  10499. // values are omitted from API requests. However, any field with an
  10500. // empty value appearing in NullFields will be sent to the server as
  10501. // null. It is an error if a field in this list has a non-empty value.
  10502. // This may be used to include null fields in Patch requests.
  10503. NullFields []string `json:"-"`
  10504. }
  10505. func (s *TargetWindow) MarshalJSON() ([]byte, error) {
  10506. type NoMethod TargetWindow
  10507. raw := NoMethod(*s)
  10508. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10509. }
  10510. // TargetableRemarketingList: Contains properties of a targetable
  10511. // remarketing list. Remarketing enables you to create lists of users
  10512. // who have performed specific actions on a site, then target ads to
  10513. // members of those lists. This resource is a read-only view of a
  10514. // remarketing list to be used to faciliate targeting ads to specific
  10515. // lists. Remarketing lists that are owned by your advertisers and those
  10516. // that are shared to your advertisers or account are accessible via
  10517. // this resource. To manage remarketing lists that are owned by your
  10518. // advertisers, use the RemarketingLists resource.
  10519. type TargetableRemarketingList struct {
  10520. // AccountId: Account ID of this remarketing list. This is a read-only,
  10521. // auto-generated field that is only returned in GET requests.
  10522. AccountId int64 `json:"accountId,omitempty,string"`
  10523. // Active: Whether this targetable remarketing list is active.
  10524. Active bool `json:"active,omitempty"`
  10525. // AdvertiserId: Dimension value for the advertiser ID that owns this
  10526. // targetable remarketing list.
  10527. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10528. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10529. // advertiser.
  10530. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10531. // Description: Targetable remarketing list description.
  10532. Description string `json:"description,omitempty"`
  10533. // Id: Targetable remarketing list ID.
  10534. Id int64 `json:"id,omitempty,string"`
  10535. // Kind: Identifies what kind of resource this is. Value: the fixed
  10536. // string "dfareporting#targetableRemarketingList".
  10537. Kind string `json:"kind,omitempty"`
  10538. // LifeSpan: Number of days that a user should remain in the targetable
  10539. // remarketing list without an impression.
  10540. LifeSpan int64 `json:"lifeSpan,omitempty,string"`
  10541. // ListSize: Number of users currently in the list. This is a read-only
  10542. // field.
  10543. ListSize int64 `json:"listSize,omitempty,string"`
  10544. // ListSource: Product from which this targetable remarketing list was
  10545. // originated.
  10546. //
  10547. // Possible values:
  10548. // "REMARKETING_LIST_SOURCE_ADX"
  10549. // "REMARKETING_LIST_SOURCE_DBM"
  10550. // "REMARKETING_LIST_SOURCE_DFA"
  10551. // "REMARKETING_LIST_SOURCE_DFP"
  10552. // "REMARKETING_LIST_SOURCE_DMP"
  10553. // "REMARKETING_LIST_SOURCE_GA"
  10554. // "REMARKETING_LIST_SOURCE_GPLUS"
  10555. // "REMARKETING_LIST_SOURCE_OTHER"
  10556. // "REMARKETING_LIST_SOURCE_PLAY_STORE"
  10557. // "REMARKETING_LIST_SOURCE_XFP"
  10558. // "REMARKETING_LIST_SOURCE_YOUTUBE"
  10559. ListSource string `json:"listSource,omitempty"`
  10560. // Name: Name of the targetable remarketing list. Is no greater than 128
  10561. // characters long.
  10562. Name string `json:"name,omitempty"`
  10563. // SubaccountId: Subaccount ID of this remarketing list. This is a
  10564. // read-only, auto-generated field that is only returned in GET
  10565. // requests.
  10566. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10567. // ServerResponse contains the HTTP response code and headers from the
  10568. // server.
  10569. googleapi.ServerResponse `json:"-"`
  10570. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10571. // unconditionally include in API requests. By default, fields with
  10572. // empty values are omitted from API requests. However, any non-pointer,
  10573. // non-interface field appearing in ForceSendFields will be sent to the
  10574. // server regardless of whether the field is empty or not. This may be
  10575. // used to include empty fields in Patch requests.
  10576. ForceSendFields []string `json:"-"`
  10577. // NullFields is a list of field names (e.g. "AccountId") to include in
  10578. // API requests with the JSON null value. By default, fields with empty
  10579. // values are omitted from API requests. However, any field with an
  10580. // empty value appearing in NullFields will be sent to the server as
  10581. // null. It is an error if a field in this list has a non-empty value.
  10582. // This may be used to include null fields in Patch requests.
  10583. NullFields []string `json:"-"`
  10584. }
  10585. func (s *TargetableRemarketingList) MarshalJSON() ([]byte, error) {
  10586. type NoMethod TargetableRemarketingList
  10587. raw := NoMethod(*s)
  10588. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10589. }
  10590. // TargetableRemarketingListsListResponse: Targetable remarketing list
  10591. // response
  10592. type TargetableRemarketingListsListResponse struct {
  10593. // Kind: Identifies what kind of resource this is. Value: the fixed
  10594. // string "dfareporting#targetableRemarketingListsListResponse".
  10595. Kind string `json:"kind,omitempty"`
  10596. // NextPageToken: Pagination token to be used for the next list
  10597. // operation.
  10598. NextPageToken string `json:"nextPageToken,omitempty"`
  10599. // TargetableRemarketingLists: Targetable remarketing list collection.
  10600. TargetableRemarketingLists []*TargetableRemarketingList `json:"targetableRemarketingLists,omitempty"`
  10601. // ServerResponse contains the HTTP response code and headers from the
  10602. // server.
  10603. googleapi.ServerResponse `json:"-"`
  10604. // ForceSendFields is a list of field names (e.g. "Kind") to
  10605. // unconditionally include in API requests. By default, fields with
  10606. // empty values are omitted from API requests. However, any non-pointer,
  10607. // non-interface field appearing in ForceSendFields will be sent to the
  10608. // server regardless of whether the field is empty or not. This may be
  10609. // used to include empty fields in Patch requests.
  10610. ForceSendFields []string `json:"-"`
  10611. // NullFields is a list of field names (e.g. "Kind") to include in API
  10612. // requests with the JSON null value. By default, fields with empty
  10613. // values are omitted from API requests. However, any field with an
  10614. // empty value appearing in NullFields will be sent to the server as
  10615. // null. It is an error if a field in this list has a non-empty value.
  10616. // This may be used to include null fields in Patch requests.
  10617. NullFields []string `json:"-"`
  10618. }
  10619. func (s *TargetableRemarketingListsListResponse) MarshalJSON() ([]byte, error) {
  10620. type NoMethod TargetableRemarketingListsListResponse
  10621. raw := NoMethod(*s)
  10622. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10623. }
  10624. // TargetingTemplate: Contains properties of a targeting template. A
  10625. // targeting template encapsulates targeting information which can be
  10626. // reused across multiple ads.
  10627. type TargetingTemplate struct {
  10628. // AccountId: Account ID of this targeting template. This field, if left
  10629. // unset, will be auto-generated on insert and is read-only after
  10630. // insert.
  10631. AccountId int64 `json:"accountId,omitempty,string"`
  10632. // AdvertiserId: Advertiser ID of this targeting template. This is a
  10633. // required field on insert and is read-only after insert.
  10634. AdvertiserId int64 `json:"advertiserId,omitempty,string"`
  10635. // AdvertiserIdDimensionValue: Dimension value for the ID of the
  10636. // advertiser. This is a read-only, auto-generated field.
  10637. AdvertiserIdDimensionValue *DimensionValue `json:"advertiserIdDimensionValue,omitempty"`
  10638. // DayPartTargeting: Time and day targeting criteria.
  10639. DayPartTargeting *DayPartTargeting `json:"dayPartTargeting,omitempty"`
  10640. // GeoTargeting: Geographical targeting criteria.
  10641. GeoTargeting *GeoTargeting `json:"geoTargeting,omitempty"`
  10642. // Id: ID of this targeting template. This is a read-only,
  10643. // auto-generated field.
  10644. Id int64 `json:"id,omitempty,string"`
  10645. // KeyValueTargetingExpression: Key-value targeting criteria.
  10646. KeyValueTargetingExpression *KeyValueTargetingExpression `json:"keyValueTargetingExpression,omitempty"`
  10647. // Kind: Identifies what kind of resource this is. Value: the fixed
  10648. // string "dfareporting#targetingTemplate".
  10649. Kind string `json:"kind,omitempty"`
  10650. // LanguageTargeting: Language targeting criteria.
  10651. LanguageTargeting *LanguageTargeting `json:"languageTargeting,omitempty"`
  10652. // ListTargetingExpression: Remarketing list targeting criteria.
  10653. ListTargetingExpression *ListTargetingExpression `json:"listTargetingExpression,omitempty"`
  10654. // Name: Name of this targeting template. This field is required. It
  10655. // must be less than 256 characters long and unique within an
  10656. // advertiser.
  10657. Name string `json:"name,omitempty"`
  10658. // SubaccountId: Subaccount ID of this targeting template. This field,
  10659. // if left unset, will be auto-generated on insert and is read-only
  10660. // after insert.
  10661. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  10662. // TechnologyTargeting: Technology platform targeting criteria.
  10663. TechnologyTargeting *TechnologyTargeting `json:"technologyTargeting,omitempty"`
  10664. // ServerResponse contains the HTTP response code and headers from the
  10665. // server.
  10666. googleapi.ServerResponse `json:"-"`
  10667. // ForceSendFields is a list of field names (e.g. "AccountId") to
  10668. // unconditionally include in API requests. By default, fields with
  10669. // empty values are omitted from API requests. However, any non-pointer,
  10670. // non-interface field appearing in ForceSendFields will be sent to the
  10671. // server regardless of whether the field is empty or not. This may be
  10672. // used to include empty fields in Patch requests.
  10673. ForceSendFields []string `json:"-"`
  10674. // NullFields is a list of field names (e.g. "AccountId") to include in
  10675. // API requests with the JSON null value. By default, fields with empty
  10676. // values are omitted from API requests. However, any field with an
  10677. // empty value appearing in NullFields will be sent to the server as
  10678. // null. It is an error if a field in this list has a non-empty value.
  10679. // This may be used to include null fields in Patch requests.
  10680. NullFields []string `json:"-"`
  10681. }
  10682. func (s *TargetingTemplate) MarshalJSON() ([]byte, error) {
  10683. type NoMethod TargetingTemplate
  10684. raw := NoMethod(*s)
  10685. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10686. }
  10687. // TargetingTemplatesListResponse: Targeting Template List Response
  10688. type TargetingTemplatesListResponse struct {
  10689. // Kind: Identifies what kind of resource this is. Value: the fixed
  10690. // string "dfareporting#targetingTemplatesListResponse".
  10691. Kind string `json:"kind,omitempty"`
  10692. // NextPageToken: Pagination token to be used for the next list
  10693. // operation.
  10694. NextPageToken string `json:"nextPageToken,omitempty"`
  10695. // TargetingTemplates: Targeting template collection.
  10696. TargetingTemplates []*TargetingTemplate `json:"targetingTemplates,omitempty"`
  10697. // ServerResponse contains the HTTP response code and headers from the
  10698. // server.
  10699. googleapi.ServerResponse `json:"-"`
  10700. // ForceSendFields is a list of field names (e.g. "Kind") to
  10701. // unconditionally include in API requests. By default, fields with
  10702. // empty values are omitted from API requests. However, any non-pointer,
  10703. // non-interface field appearing in ForceSendFields will be sent to the
  10704. // server regardless of whether the field is empty or not. This may be
  10705. // used to include empty fields in Patch requests.
  10706. ForceSendFields []string `json:"-"`
  10707. // NullFields is a list of field names (e.g. "Kind") to include in API
  10708. // requests with the JSON null value. By default, fields with empty
  10709. // values are omitted from API requests. However, any field with an
  10710. // empty value appearing in NullFields will be sent to the server as
  10711. // null. It is an error if a field in this list has a non-empty value.
  10712. // This may be used to include null fields in Patch requests.
  10713. NullFields []string `json:"-"`
  10714. }
  10715. func (s *TargetingTemplatesListResponse) MarshalJSON() ([]byte, error) {
  10716. type NoMethod TargetingTemplatesListResponse
  10717. raw := NoMethod(*s)
  10718. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10719. }
  10720. // TechnologyTargeting: Technology Targeting.
  10721. type TechnologyTargeting struct {
  10722. // Browsers: Browsers that this ad targets. For each browser either set
  10723. // browserVersionId or dartId along with the version numbers. If both
  10724. // are specified, only browserVersionId will be used. The other fields
  10725. // are populated automatically when the ad is inserted or updated.
  10726. Browsers []*Browser `json:"browsers,omitempty"`
  10727. // ConnectionTypes: Connection types that this ad targets. For each
  10728. // connection type only id is required. The other fields are populated
  10729. // automatically when the ad is inserted or updated.
  10730. ConnectionTypes []*ConnectionType `json:"connectionTypes,omitempty"`
  10731. // MobileCarriers: Mobile carriers that this ad targets. For each mobile
  10732. // carrier only id is required, and the other fields are populated
  10733. // automatically when the ad is inserted or updated. If targeting a
  10734. // mobile carrier, do not set targeting for any zip codes.
  10735. MobileCarriers []*MobileCarrier `json:"mobileCarriers,omitempty"`
  10736. // OperatingSystemVersions: Operating system versions that this ad
  10737. // targets. To target all versions, use operatingSystems. For each
  10738. // operating system version, only id is required. The other fields are
  10739. // populated automatically when the ad is inserted or updated. If
  10740. // targeting an operating system version, do not set targeting for the
  10741. // corresponding operating system in operatingSystems.
  10742. OperatingSystemVersions []*OperatingSystemVersion `json:"operatingSystemVersions,omitempty"`
  10743. // OperatingSystems: Operating systems that this ad targets. To target
  10744. // specific versions, use operatingSystemVersions. For each operating
  10745. // system only dartId is required. The other fields are populated
  10746. // automatically when the ad is inserted or updated. If targeting an
  10747. // operating system, do not set targeting for operating system versions
  10748. // for the same operating system.
  10749. OperatingSystems []*OperatingSystem `json:"operatingSystems,omitempty"`
  10750. // PlatformTypes: Platform types that this ad targets. For example,
  10751. // desktop, mobile, or tablet. For each platform type, only id is
  10752. // required, and the other fields are populated automatically when the
  10753. // ad is inserted or updated.
  10754. PlatformTypes []*PlatformType `json:"platformTypes,omitempty"`
  10755. // ForceSendFields is a list of field names (e.g. "Browsers") to
  10756. // unconditionally include in API requests. By default, fields with
  10757. // empty values are omitted from API requests. However, any non-pointer,
  10758. // non-interface field appearing in ForceSendFields will be sent to the
  10759. // server regardless of whether the field is empty or not. This may be
  10760. // used to include empty fields in Patch requests.
  10761. ForceSendFields []string `json:"-"`
  10762. // NullFields is a list of field names (e.g. "Browsers") to include in
  10763. // API requests with the JSON null value. By default, fields with empty
  10764. // values are omitted from API requests. However, any field with an
  10765. // empty value appearing in NullFields will be sent to the server as
  10766. // null. It is an error if a field in this list has a non-empty value.
  10767. // This may be used to include null fields in Patch requests.
  10768. NullFields []string `json:"-"`
  10769. }
  10770. func (s *TechnologyTargeting) MarshalJSON() ([]byte, error) {
  10771. type NoMethod TechnologyTargeting
  10772. raw := NoMethod(*s)
  10773. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10774. }
  10775. // ThirdPartyAuthenticationToken: Third Party Authentication Token
  10776. type ThirdPartyAuthenticationToken struct {
  10777. // Name: Name of the third-party authentication token.
  10778. Name string `json:"name,omitempty"`
  10779. // Value: Value of the third-party authentication token. This is a
  10780. // read-only, auto-generated field.
  10781. Value string `json:"value,omitempty"`
  10782. // ForceSendFields is a list of field names (e.g. "Name") 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. "Name") 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 *ThirdPartyAuthenticationToken) MarshalJSON() ([]byte, error) {
  10798. type NoMethod ThirdPartyAuthenticationToken
  10799. raw := NoMethod(*s)
  10800. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10801. }
  10802. // ThirdPartyTrackingUrl: Third-party Tracking URL.
  10803. type ThirdPartyTrackingUrl struct {
  10804. // ThirdPartyUrlType: Third-party URL type for in-stream video
  10805. // creatives.
  10806. //
  10807. // Possible values:
  10808. // "CLICK_TRACKING"
  10809. // "IMPRESSION"
  10810. // "RICH_MEDIA_BACKUP_IMPRESSION"
  10811. // "RICH_MEDIA_IMPRESSION"
  10812. // "RICH_MEDIA_RM_IMPRESSION"
  10813. // "SURVEY"
  10814. // "VIDEO_COMPLETE"
  10815. // "VIDEO_CUSTOM"
  10816. // "VIDEO_FIRST_QUARTILE"
  10817. // "VIDEO_FULLSCREEN"
  10818. // "VIDEO_MIDPOINT"
  10819. // "VIDEO_MUTE"
  10820. // "VIDEO_PAUSE"
  10821. // "VIDEO_PROGRESS"
  10822. // "VIDEO_REWIND"
  10823. // "VIDEO_SKIP"
  10824. // "VIDEO_START"
  10825. // "VIDEO_STOP"
  10826. // "VIDEO_THIRD_QUARTILE"
  10827. ThirdPartyUrlType string `json:"thirdPartyUrlType,omitempty"`
  10828. // Url: URL for the specified third-party URL type.
  10829. Url string `json:"url,omitempty"`
  10830. // ForceSendFields is a list of field names (e.g. "ThirdPartyUrlType")
  10831. // to unconditionally include in API requests. By default, fields with
  10832. // empty values are omitted from API requests. However, any non-pointer,
  10833. // non-interface field appearing in ForceSendFields will be sent to the
  10834. // server regardless of whether the field is empty or not. This may be
  10835. // used to include empty fields in Patch requests.
  10836. ForceSendFields []string `json:"-"`
  10837. // NullFields is a list of field names (e.g. "ThirdPartyUrlType") to
  10838. // include in API requests with the JSON null value. By default, fields
  10839. // with empty values are omitted from API requests. However, any field
  10840. // with an empty value appearing in NullFields will be sent to the
  10841. // server as null. It is an error if a field in this list has a
  10842. // non-empty value. This may be used to include null fields in Patch
  10843. // requests.
  10844. NullFields []string `json:"-"`
  10845. }
  10846. func (s *ThirdPartyTrackingUrl) MarshalJSON() ([]byte, error) {
  10847. type NoMethod ThirdPartyTrackingUrl
  10848. raw := NoMethod(*s)
  10849. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10850. }
  10851. // TranscodeSetting: Transcode Settings
  10852. type TranscodeSetting struct {
  10853. // EnabledVideoFormats: Whitelist of video formats to be served to this
  10854. // placement. Set this list to null or empty to serve all video formats.
  10855. EnabledVideoFormats []int64 `json:"enabledVideoFormats,omitempty"`
  10856. // Kind: Identifies what kind of resource this is. Value: the fixed
  10857. // string "dfareporting#transcodeSetting".
  10858. Kind string `json:"kind,omitempty"`
  10859. // ForceSendFields is a list of field names (e.g. "EnabledVideoFormats")
  10860. // to unconditionally include in API requests. By default, fields with
  10861. // empty values are omitted from API requests. However, any non-pointer,
  10862. // non-interface field appearing in ForceSendFields will be sent to the
  10863. // server regardless of whether the field is empty or not. This may be
  10864. // used to include empty fields in Patch requests.
  10865. ForceSendFields []string `json:"-"`
  10866. // NullFields is a list of field names (e.g. "EnabledVideoFormats") to
  10867. // include in API requests with the JSON null value. By default, fields
  10868. // with empty values are omitted from API requests. However, any field
  10869. // with an empty value appearing in NullFields will be sent to the
  10870. // server as null. It is an error if a field in this list has a
  10871. // non-empty value. This may be used to include null fields in Patch
  10872. // requests.
  10873. NullFields []string `json:"-"`
  10874. }
  10875. func (s *TranscodeSetting) MarshalJSON() ([]byte, error) {
  10876. type NoMethod TranscodeSetting
  10877. raw := NoMethod(*s)
  10878. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  10879. }
  10880. // UserDefinedVariableConfiguration: User Defined Variable
  10881. // configuration.
  10882. type UserDefinedVariableConfiguration struct {
  10883. // DataType: Data type for the variable. This is a required field.
  10884. //
  10885. // Possible values:
  10886. // "NUMBER"
  10887. // "STRING"
  10888. DataType string `json:"dataType,omitempty"`
  10889. // ReportName: User-friendly name for the variable which will appear in
  10890. // reports. This is a required field, must be less than 64 characters
  10891. // long, and cannot contain the following characters: ""<>".
  10892. ReportName string `json:"reportName,omitempty"`
  10893. // VariableType: Variable name in the tag. This is a required field.
  10894. //
  10895. // Possible values:
  10896. // "U1"
  10897. // "U10"
  10898. // "U100"
  10899. // "U11"
  10900. // "U12"
  10901. // "U13"
  10902. // "U14"
  10903. // "U15"
  10904. // "U16"
  10905. // "U17"
  10906. // "U18"
  10907. // "U19"
  10908. // "U2"
  10909. // "U20"
  10910. // "U21"
  10911. // "U22"
  10912. // "U23"
  10913. // "U24"
  10914. // "U25"
  10915. // "U26"
  10916. // "U27"
  10917. // "U28"
  10918. // "U29"
  10919. // "U3"
  10920. // "U30"
  10921. // "U31"
  10922. // "U32"
  10923. // "U33"
  10924. // "U34"
  10925. // "U35"
  10926. // "U36"
  10927. // "U37"
  10928. // "U38"
  10929. // "U39"
  10930. // "U4"
  10931. // "U40"
  10932. // "U41"
  10933. // "U42"
  10934. // "U43"
  10935. // "U44"
  10936. // "U45"
  10937. // "U46"
  10938. // "U47"
  10939. // "U48"
  10940. // "U49"
  10941. // "U5"
  10942. // "U50"
  10943. // "U51"
  10944. // "U52"
  10945. // "U53"
  10946. // "U54"
  10947. // "U55"
  10948. // "U56"
  10949. // "U57"
  10950. // "U58"
  10951. // "U59"
  10952. // "U6"
  10953. // "U60"
  10954. // "U61"
  10955. // "U62"
  10956. // "U63"
  10957. // "U64"
  10958. // "U65"
  10959. // "U66"
  10960. // "U67"
  10961. // "U68"
  10962. // "U69"
  10963. // "U7"
  10964. // "U70"
  10965. // "U71"
  10966. // "U72"
  10967. // "U73"
  10968. // "U74"
  10969. // "U75"
  10970. // "U76"
  10971. // "U77"
  10972. // "U78"
  10973. // "U79"
  10974. // "U8"
  10975. // "U80"
  10976. // "U81"
  10977. // "U82"
  10978. // "U83"
  10979. // "U84"
  10980. // "U85"
  10981. // "U86"
  10982. // "U87"
  10983. // "U88"
  10984. // "U89"
  10985. // "U9"
  10986. // "U90"
  10987. // "U91"
  10988. // "U92"
  10989. // "U93"
  10990. // "U94"
  10991. // "U95"
  10992. // "U96"
  10993. // "U97"
  10994. // "U98"
  10995. // "U99"
  10996. VariableType string `json:"variableType,omitempty"`
  10997. // ForceSendFields is a list of field names (e.g. "DataType") to
  10998. // unconditionally include in API requests. By default, fields with
  10999. // empty values are omitted from API requests. However, any non-pointer,
  11000. // non-interface field appearing in ForceSendFields will be sent to the
  11001. // server regardless of whether the field is empty or not. This may be
  11002. // used to include empty fields in Patch requests.
  11003. ForceSendFields []string `json:"-"`
  11004. // NullFields is a list of field names (e.g. "DataType") to include in
  11005. // API requests with the JSON null value. By default, fields with empty
  11006. // values are omitted from API requests. However, any field with an
  11007. // empty value appearing in NullFields will be sent to the server as
  11008. // null. It is an error if a field in this list has a non-empty value.
  11009. // This may be used to include null fields in Patch requests.
  11010. NullFields []string `json:"-"`
  11011. }
  11012. func (s *UserDefinedVariableConfiguration) MarshalJSON() ([]byte, error) {
  11013. type NoMethod UserDefinedVariableConfiguration
  11014. raw := NoMethod(*s)
  11015. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11016. }
  11017. // UserProfile: Represents a UserProfile resource.
  11018. type UserProfile struct {
  11019. // AccountId: The account ID to which this profile belongs.
  11020. AccountId int64 `json:"accountId,omitempty,string"`
  11021. // AccountName: The account name this profile belongs to.
  11022. AccountName string `json:"accountName,omitempty"`
  11023. // Etag: The eTag of this response for caching purposes.
  11024. Etag string `json:"etag,omitempty"`
  11025. // Kind: The kind of resource this is, in this case
  11026. // dfareporting#userProfile.
  11027. Kind string `json:"kind,omitempty"`
  11028. // ProfileId: The unique ID of the user profile.
  11029. ProfileId int64 `json:"profileId,omitempty,string"`
  11030. // SubAccountId: The sub account ID this profile belongs to if
  11031. // applicable.
  11032. SubAccountId int64 `json:"subAccountId,omitempty,string"`
  11033. // SubAccountName: The sub account name this profile belongs to if
  11034. // applicable.
  11035. SubAccountName string `json:"subAccountName,omitempty"`
  11036. // UserName: The user name.
  11037. UserName string `json:"userName,omitempty"`
  11038. // ServerResponse contains the HTTP response code and headers from the
  11039. // server.
  11040. googleapi.ServerResponse `json:"-"`
  11041. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11042. // unconditionally include in API requests. By default, fields with
  11043. // empty values are omitted from API requests. However, any non-pointer,
  11044. // non-interface field appearing in ForceSendFields will be sent to the
  11045. // server regardless of whether the field is empty or not. This may be
  11046. // used to include empty fields in Patch requests.
  11047. ForceSendFields []string `json:"-"`
  11048. // NullFields is a list of field names (e.g. "AccountId") to include in
  11049. // API requests with the JSON null value. By default, fields with empty
  11050. // values are omitted from API requests. However, any field with an
  11051. // empty value appearing in NullFields will be sent to the server as
  11052. // null. It is an error if a field in this list has a non-empty value.
  11053. // This may be used to include null fields in Patch requests.
  11054. NullFields []string `json:"-"`
  11055. }
  11056. func (s *UserProfile) MarshalJSON() ([]byte, error) {
  11057. type NoMethod UserProfile
  11058. raw := NoMethod(*s)
  11059. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11060. }
  11061. // UserProfileList: Represents the list of user profiles.
  11062. type UserProfileList struct {
  11063. // Etag: The eTag of this response for caching purposes.
  11064. Etag string `json:"etag,omitempty"`
  11065. // Items: The user profiles returned in this response.
  11066. Items []*UserProfile `json:"items,omitempty"`
  11067. // Kind: The kind of list this is, in this case
  11068. // dfareporting#userProfileList.
  11069. Kind string `json:"kind,omitempty"`
  11070. // ServerResponse contains the HTTP response code and headers from the
  11071. // server.
  11072. googleapi.ServerResponse `json:"-"`
  11073. // ForceSendFields is a list of field names (e.g. "Etag") 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. "Etag") to include in API
  11081. // 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 *UserProfileList) MarshalJSON() ([]byte, error) {
  11089. type NoMethod UserProfileList
  11090. raw := NoMethod(*s)
  11091. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11092. }
  11093. // UserRole: Contains properties of auser role, which is used to manage
  11094. // user access.
  11095. type UserRole struct {
  11096. // AccountId: Account ID of this user role. This is a read-only field
  11097. // that can be left blank.
  11098. AccountId int64 `json:"accountId,omitempty,string"`
  11099. // DefaultUserRole: Whether this is a default user role. Default user
  11100. // roles are created by the system for the account/subaccount and cannot
  11101. // be modified or deleted. Each default user role comes with a basic set
  11102. // of preassigned permissions.
  11103. DefaultUserRole bool `json:"defaultUserRole,omitempty"`
  11104. // Id: ID of this user role. This is a read-only, auto-generated field.
  11105. Id int64 `json:"id,omitempty,string"`
  11106. // Kind: Identifies what kind of resource this is. Value: the fixed
  11107. // string "dfareporting#userRole".
  11108. Kind string `json:"kind,omitempty"`
  11109. // Name: Name of this user role. This is a required field. Must be less
  11110. // than 256 characters long. If this user role is under a subaccount,
  11111. // the name must be unique among sites of the same subaccount.
  11112. // Otherwise, this user role is a top-level user role, and the name must
  11113. // be unique among top-level user roles of the same account.
  11114. Name string `json:"name,omitempty"`
  11115. // ParentUserRoleId: ID of the user role that this user role is based on
  11116. // or copied from. This is a required field.
  11117. ParentUserRoleId int64 `json:"parentUserRoleId,omitempty,string"`
  11118. // Permissions: List of permissions associated with this user role.
  11119. Permissions []*UserRolePermission `json:"permissions,omitempty"`
  11120. // SubaccountId: Subaccount ID of this user role. This is a read-only
  11121. // field that can be left blank.
  11122. SubaccountId int64 `json:"subaccountId,omitempty,string"`
  11123. // ServerResponse contains the HTTP response code and headers from the
  11124. // server.
  11125. googleapi.ServerResponse `json:"-"`
  11126. // ForceSendFields is a list of field names (e.g. "AccountId") to
  11127. // unconditionally include in API requests. By default, fields with
  11128. // empty values are omitted from API requests. However, any non-pointer,
  11129. // non-interface field appearing in ForceSendFields will be sent to the
  11130. // server regardless of whether the field is empty or not. This may be
  11131. // used to include empty fields in Patch requests.
  11132. ForceSendFields []string `json:"-"`
  11133. // NullFields is a list of field names (e.g. "AccountId") to include in
  11134. // API requests with the JSON null value. By default, fields with empty
  11135. // values are omitted from API requests. However, any field with an
  11136. // empty value appearing in NullFields will be sent to the server as
  11137. // null. It is an error if a field in this list has a non-empty value.
  11138. // This may be used to include null fields in Patch requests.
  11139. NullFields []string `json:"-"`
  11140. }
  11141. func (s *UserRole) MarshalJSON() ([]byte, error) {
  11142. type NoMethod UserRole
  11143. raw := NoMethod(*s)
  11144. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11145. }
  11146. // UserRolePermission: Contains properties of a user role permission.
  11147. type UserRolePermission struct {
  11148. // Availability: Levels of availability for a user role permission.
  11149. //
  11150. // Possible values:
  11151. // "ACCOUNT_ALWAYS"
  11152. // "ACCOUNT_BY_DEFAULT"
  11153. // "NOT_AVAILABLE_BY_DEFAULT"
  11154. // "SUBACCOUNT_AND_ACCOUNT_ALWAYS"
  11155. // "SUBACCOUNT_AND_ACCOUNT_BY_DEFAULT"
  11156. Availability string `json:"availability,omitempty"`
  11157. // Id: ID of this user role permission.
  11158. Id int64 `json:"id,omitempty,string"`
  11159. // Kind: Identifies what kind of resource this is. Value: the fixed
  11160. // string "dfareporting#userRolePermission".
  11161. Kind string `json:"kind,omitempty"`
  11162. // Name: Name of this user role permission.
  11163. Name string `json:"name,omitempty"`
  11164. // PermissionGroupId: ID of the permission group that this user role
  11165. // permission belongs to.
  11166. PermissionGroupId int64 `json:"permissionGroupId,omitempty,string"`
  11167. // ServerResponse contains the HTTP response code and headers from the
  11168. // server.
  11169. googleapi.ServerResponse `json:"-"`
  11170. // ForceSendFields is a list of field names (e.g. "Availability") to
  11171. // unconditionally include in API requests. By default, fields with
  11172. // empty values are omitted from API requests. However, any non-pointer,
  11173. // non-interface field appearing in ForceSendFields will be sent to the
  11174. // server regardless of whether the field is empty or not. This may be
  11175. // used to include empty fields in Patch requests.
  11176. ForceSendFields []string `json:"-"`
  11177. // NullFields is a list of field names (e.g. "Availability") to include
  11178. // in API requests with the JSON null value. By default, fields with
  11179. // empty values are omitted from API requests. However, any field with
  11180. // an empty value appearing in NullFields will be sent to the server as
  11181. // null. It is an error if a field in this list has a non-empty value.
  11182. // This may be used to include null fields in Patch requests.
  11183. NullFields []string `json:"-"`
  11184. }
  11185. func (s *UserRolePermission) MarshalJSON() ([]byte, error) {
  11186. type NoMethod UserRolePermission
  11187. raw := NoMethod(*s)
  11188. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11189. }
  11190. // UserRolePermissionGroup: Represents a grouping of related user role
  11191. // permissions.
  11192. type UserRolePermissionGroup struct {
  11193. // Id: ID of this user role permission.
  11194. Id int64 `json:"id,omitempty,string"`
  11195. // Kind: Identifies what kind of resource this is. Value: the fixed
  11196. // string "dfareporting#userRolePermissionGroup".
  11197. Kind string `json:"kind,omitempty"`
  11198. // Name: Name of this user role permission group.
  11199. Name string `json:"name,omitempty"`
  11200. // ServerResponse contains the HTTP response code and headers from the
  11201. // server.
  11202. googleapi.ServerResponse `json:"-"`
  11203. // ForceSendFields is a list of field names (e.g. "Id") to
  11204. // unconditionally include in API requests. By default, fields with
  11205. // empty values are omitted from API requests. However, any non-pointer,
  11206. // non-interface field appearing in ForceSendFields will be sent to the
  11207. // server regardless of whether the field is empty or not. This may be
  11208. // used to include empty fields in Patch requests.
  11209. ForceSendFields []string `json:"-"`
  11210. // NullFields is a list of field names (e.g. "Id") to include in API
  11211. // requests with the JSON null value. By default, fields with empty
  11212. // values are omitted from API requests. However, any field with an
  11213. // empty value appearing in NullFields will be sent to the server as
  11214. // null. It is an error if a field in this list has a non-empty value.
  11215. // This may be used to include null fields in Patch requests.
  11216. NullFields []string `json:"-"`
  11217. }
  11218. func (s *UserRolePermissionGroup) MarshalJSON() ([]byte, error) {
  11219. type NoMethod UserRolePermissionGroup
  11220. raw := NoMethod(*s)
  11221. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11222. }
  11223. // UserRolePermissionGroupsListResponse: User Role Permission Group List
  11224. // Response
  11225. type UserRolePermissionGroupsListResponse struct {
  11226. // Kind: Identifies what kind of resource this is. Value: the fixed
  11227. // string "dfareporting#userRolePermissionGroupsListResponse".
  11228. Kind string `json:"kind,omitempty"`
  11229. // UserRolePermissionGroups: User role permission group collection.
  11230. UserRolePermissionGroups []*UserRolePermissionGroup `json:"userRolePermissionGroups,omitempty"`
  11231. // ServerResponse contains the HTTP response code and headers from the
  11232. // server.
  11233. googleapi.ServerResponse `json:"-"`
  11234. // ForceSendFields is a list of field names (e.g. "Kind") to
  11235. // unconditionally include in API requests. By default, fields with
  11236. // empty values are omitted from API requests. However, any non-pointer,
  11237. // non-interface field appearing in ForceSendFields will be sent to the
  11238. // server regardless of whether the field is empty or not. This may be
  11239. // used to include empty fields in Patch requests.
  11240. ForceSendFields []string `json:"-"`
  11241. // NullFields is a list of field names (e.g. "Kind") to include in API
  11242. // requests with the JSON null value. By default, fields with empty
  11243. // values are omitted from API requests. However, any field with an
  11244. // empty value appearing in NullFields will be sent to the server as
  11245. // null. It is an error if a field in this list has a non-empty value.
  11246. // This may be used to include null fields in Patch requests.
  11247. NullFields []string `json:"-"`
  11248. }
  11249. func (s *UserRolePermissionGroupsListResponse) MarshalJSON() ([]byte, error) {
  11250. type NoMethod UserRolePermissionGroupsListResponse
  11251. raw := NoMethod(*s)
  11252. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11253. }
  11254. // UserRolePermissionsListResponse: User Role Permission List Response
  11255. type UserRolePermissionsListResponse struct {
  11256. // Kind: Identifies what kind of resource this is. Value: the fixed
  11257. // string "dfareporting#userRolePermissionsListResponse".
  11258. Kind string `json:"kind,omitempty"`
  11259. // UserRolePermissions: User role permission collection.
  11260. UserRolePermissions []*UserRolePermission `json:"userRolePermissions,omitempty"`
  11261. // ServerResponse contains the HTTP response code and headers from the
  11262. // server.
  11263. googleapi.ServerResponse `json:"-"`
  11264. // ForceSendFields is a list of field names (e.g. "Kind") to
  11265. // unconditionally include in API requests. By default, fields with
  11266. // empty values are omitted from API requests. However, any non-pointer,
  11267. // non-interface field appearing in ForceSendFields will be sent to the
  11268. // server regardless of whether the field is empty or not. This may be
  11269. // used to include empty fields in Patch requests.
  11270. ForceSendFields []string `json:"-"`
  11271. // NullFields is a list of field names (e.g. "Kind") to include in API
  11272. // requests with the JSON null value. By default, fields with empty
  11273. // values are omitted from API requests. However, any field with an
  11274. // empty value appearing in NullFields will be sent to the server as
  11275. // null. It is an error if a field in this list has a non-empty value.
  11276. // This may be used to include null fields in Patch requests.
  11277. NullFields []string `json:"-"`
  11278. }
  11279. func (s *UserRolePermissionsListResponse) MarshalJSON() ([]byte, error) {
  11280. type NoMethod UserRolePermissionsListResponse
  11281. raw := NoMethod(*s)
  11282. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11283. }
  11284. // UserRolesListResponse: User Role List Response
  11285. type UserRolesListResponse struct {
  11286. // Kind: Identifies what kind of resource this is. Value: the fixed
  11287. // string "dfareporting#userRolesListResponse".
  11288. Kind string `json:"kind,omitempty"`
  11289. // NextPageToken: Pagination token to be used for the next list
  11290. // operation.
  11291. NextPageToken string `json:"nextPageToken,omitempty"`
  11292. // UserRoles: User role collection.
  11293. UserRoles []*UserRole `json:"userRoles,omitempty"`
  11294. // ServerResponse contains the HTTP response code and headers from the
  11295. // server.
  11296. googleapi.ServerResponse `json:"-"`
  11297. // ForceSendFields is a list of field names (e.g. "Kind") to
  11298. // unconditionally include in API requests. By default, fields with
  11299. // empty values are omitted from API requests. However, any non-pointer,
  11300. // non-interface field appearing in ForceSendFields will be sent to the
  11301. // server regardless of whether the field is empty or not. This may be
  11302. // used to include empty fields in Patch requests.
  11303. ForceSendFields []string `json:"-"`
  11304. // NullFields is a list of field names (e.g. "Kind") to include in API
  11305. // requests with the JSON null value. By default, fields with empty
  11306. // values are omitted from API requests. However, any field with an
  11307. // empty value appearing in NullFields will be sent to the server as
  11308. // null. It is an error if a field in this list has a non-empty value.
  11309. // This may be used to include null fields in Patch requests.
  11310. NullFields []string `json:"-"`
  11311. }
  11312. func (s *UserRolesListResponse) MarshalJSON() ([]byte, error) {
  11313. type NoMethod UserRolesListResponse
  11314. raw := NoMethod(*s)
  11315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11316. }
  11317. // VideoFormat: Contains information about supported video formats.
  11318. type VideoFormat struct {
  11319. // FileType: File type of the video format.
  11320. //
  11321. // Possible values:
  11322. // "FLV"
  11323. // "M3U8"
  11324. // "MP4"
  11325. // "THREEGPP"
  11326. // "WEBM"
  11327. FileType string `json:"fileType,omitempty"`
  11328. // Id: ID of the video format.
  11329. Id int64 `json:"id,omitempty"`
  11330. // Kind: Identifies what kind of resource this is. Value: the fixed
  11331. // string "dfareporting#videoFormat".
  11332. Kind string `json:"kind,omitempty"`
  11333. // Resolution: The resolution of this video format.
  11334. Resolution *Size `json:"resolution,omitempty"`
  11335. // TargetBitRate: The target bit rate of this video format.
  11336. TargetBitRate int64 `json:"targetBitRate,omitempty"`
  11337. // ServerResponse contains the HTTP response code and headers from the
  11338. // server.
  11339. googleapi.ServerResponse `json:"-"`
  11340. // ForceSendFields is a list of field names (e.g. "FileType") to
  11341. // unconditionally include in API requests. By default, fields with
  11342. // empty values are omitted from API requests. However, any non-pointer,
  11343. // non-interface field appearing in ForceSendFields will be sent to the
  11344. // server regardless of whether the field is empty or not. This may be
  11345. // used to include empty fields in Patch requests.
  11346. ForceSendFields []string `json:"-"`
  11347. // NullFields is a list of field names (e.g. "FileType") to include in
  11348. // API requests with the JSON null value. By default, fields with empty
  11349. // values are omitted from API requests. However, any field with an
  11350. // empty value appearing in NullFields will be sent to the server as
  11351. // null. It is an error if a field in this list has a non-empty value.
  11352. // This may be used to include null fields in Patch requests.
  11353. NullFields []string `json:"-"`
  11354. }
  11355. func (s *VideoFormat) MarshalJSON() ([]byte, error) {
  11356. type NoMethod VideoFormat
  11357. raw := NoMethod(*s)
  11358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11359. }
  11360. // VideoFormatsListResponse: Video Format List Response
  11361. type VideoFormatsListResponse struct {
  11362. // Kind: Identifies what kind of resource this is. Value: the fixed
  11363. // string "dfareporting#videoFormatsListResponse".
  11364. Kind string `json:"kind,omitempty"`
  11365. // VideoFormats: Video format collection.
  11366. VideoFormats []*VideoFormat `json:"videoFormats,omitempty"`
  11367. // ServerResponse contains the HTTP response code and headers from the
  11368. // server.
  11369. googleapi.ServerResponse `json:"-"`
  11370. // ForceSendFields is a list of field names (e.g. "Kind") to
  11371. // unconditionally include in API requests. By default, fields with
  11372. // empty values are omitted from API requests. However, any non-pointer,
  11373. // non-interface field appearing in ForceSendFields will be sent to the
  11374. // server regardless of whether the field is empty or not. This may be
  11375. // used to include empty fields in Patch requests.
  11376. ForceSendFields []string `json:"-"`
  11377. // NullFields is a list of field names (e.g. "Kind") to include in API
  11378. // requests with the JSON null value. By default, fields with empty
  11379. // values are omitted from API requests. However, any field with an
  11380. // empty value appearing in NullFields will be sent to the server as
  11381. // null. It is an error if a field in this list has a non-empty value.
  11382. // This may be used to include null fields in Patch requests.
  11383. NullFields []string `json:"-"`
  11384. }
  11385. func (s *VideoFormatsListResponse) MarshalJSON() ([]byte, error) {
  11386. type NoMethod VideoFormatsListResponse
  11387. raw := NoMethod(*s)
  11388. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11389. }
  11390. // VideoOffset: Video Offset
  11391. type VideoOffset struct {
  11392. // OffsetPercentage: Duration, as a percentage of video duration. Do not
  11393. // set when offsetSeconds is set. Acceptable values are 0 to 100,
  11394. // inclusive.
  11395. OffsetPercentage int64 `json:"offsetPercentage,omitempty"`
  11396. // OffsetSeconds: Duration, in seconds. Do not set when offsetPercentage
  11397. // is set. Acceptable values are 0 to 86399, inclusive.
  11398. OffsetSeconds int64 `json:"offsetSeconds,omitempty"`
  11399. // ForceSendFields is a list of field names (e.g. "OffsetPercentage") to
  11400. // unconditionally include in API requests. By default, fields with
  11401. // empty values are omitted from API requests. However, any non-pointer,
  11402. // non-interface field appearing in ForceSendFields will be sent to the
  11403. // server regardless of whether the field is empty or not. This may be
  11404. // used to include empty fields in Patch requests.
  11405. ForceSendFields []string `json:"-"`
  11406. // NullFields is a list of field names (e.g. "OffsetPercentage") to
  11407. // include in API requests with the JSON null value. By default, fields
  11408. // with empty values are omitted from API requests. However, any field
  11409. // with an empty value appearing in NullFields will be sent to the
  11410. // server as null. It is an error if a field in this list has a
  11411. // non-empty value. This may be used to include null fields in Patch
  11412. // requests.
  11413. NullFields []string `json:"-"`
  11414. }
  11415. func (s *VideoOffset) MarshalJSON() ([]byte, error) {
  11416. type NoMethod VideoOffset
  11417. raw := NoMethod(*s)
  11418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11419. }
  11420. // VideoSettings: Video Settings
  11421. type VideoSettings struct {
  11422. // CompanionSettings: Settings for the companion creatives of video
  11423. // creatives served to this placement.
  11424. CompanionSettings *CompanionSetting `json:"companionSettings,omitempty"`
  11425. // Kind: Identifies what kind of resource this is. Value: the fixed
  11426. // string "dfareporting#videoSettings".
  11427. Kind string `json:"kind,omitempty"`
  11428. // SkippableSettings: Settings for the skippability of video creatives
  11429. // served to this placement. If this object is provided, the
  11430. // creative-level skippable settings will be overridden.
  11431. SkippableSettings *SkippableSetting `json:"skippableSettings,omitempty"`
  11432. // TranscodeSettings: Settings for the transcodes of video creatives
  11433. // served to this placement. If this object is provided, the
  11434. // creative-level transcode settings will be overridden.
  11435. TranscodeSettings *TranscodeSetting `json:"transcodeSettings,omitempty"`
  11436. // ForceSendFields is a list of field names (e.g. "CompanionSettings")
  11437. // to unconditionally include in API requests. By default, fields with
  11438. // empty values are omitted from API requests. However, any non-pointer,
  11439. // non-interface field appearing in ForceSendFields will be sent to the
  11440. // server regardless of whether the field is empty or not. This may be
  11441. // used to include empty fields in Patch requests.
  11442. ForceSendFields []string `json:"-"`
  11443. // NullFields is a list of field names (e.g. "CompanionSettings") to
  11444. // include in API requests with the JSON null value. By default, fields
  11445. // with empty values are omitted from API requests. However, any field
  11446. // with an empty value appearing in NullFields will be sent to the
  11447. // server as null. It is an error if a field in this list has a
  11448. // non-empty value. This may be used to include null fields in Patch
  11449. // requests.
  11450. NullFields []string `json:"-"`
  11451. }
  11452. func (s *VideoSettings) MarshalJSON() ([]byte, error) {
  11453. type NoMethod VideoSettings
  11454. raw := NoMethod(*s)
  11455. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  11456. }
  11457. // method id "dfareporting.accountActiveAdSummaries.get":
  11458. type AccountActiveAdSummariesGetCall struct {
  11459. s *Service
  11460. profileId int64
  11461. summaryAccountId int64
  11462. urlParams_ gensupport.URLParams
  11463. ifNoneMatch_ string
  11464. ctx_ context.Context
  11465. header_ http.Header
  11466. }
  11467. // Get: Gets the account's active ad summary by account ID.
  11468. func (r *AccountActiveAdSummariesService) Get(profileId int64, summaryAccountId int64) *AccountActiveAdSummariesGetCall {
  11469. c := &AccountActiveAdSummariesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11470. c.profileId = profileId
  11471. c.summaryAccountId = summaryAccountId
  11472. return c
  11473. }
  11474. // Fields allows partial responses to be retrieved. See
  11475. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11476. // for more information.
  11477. func (c *AccountActiveAdSummariesGetCall) Fields(s ...googleapi.Field) *AccountActiveAdSummariesGetCall {
  11478. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11479. return c
  11480. }
  11481. // IfNoneMatch sets the optional parameter which makes the operation
  11482. // fail if the object's ETag matches the given value. This is useful for
  11483. // getting updates only after the object has changed since the last
  11484. // request. Use googleapi.IsNotModified to check whether the response
  11485. // error from Do is the result of In-None-Match.
  11486. func (c *AccountActiveAdSummariesGetCall) IfNoneMatch(entityTag string) *AccountActiveAdSummariesGetCall {
  11487. c.ifNoneMatch_ = entityTag
  11488. return c
  11489. }
  11490. // Context sets the context to be used in this call's Do method. Any
  11491. // pending HTTP request will be aborted if the provided context is
  11492. // canceled.
  11493. func (c *AccountActiveAdSummariesGetCall) Context(ctx context.Context) *AccountActiveAdSummariesGetCall {
  11494. c.ctx_ = ctx
  11495. return c
  11496. }
  11497. // Header returns an http.Header that can be modified by the caller to
  11498. // add HTTP headers to the request.
  11499. func (c *AccountActiveAdSummariesGetCall) Header() http.Header {
  11500. if c.header_ == nil {
  11501. c.header_ = make(http.Header)
  11502. }
  11503. return c.header_
  11504. }
  11505. func (c *AccountActiveAdSummariesGetCall) doRequest(alt string) (*http.Response, error) {
  11506. reqHeaders := make(http.Header)
  11507. for k, v := range c.header_ {
  11508. reqHeaders[k] = v
  11509. }
  11510. reqHeaders.Set("User-Agent", c.s.userAgent())
  11511. if c.ifNoneMatch_ != "" {
  11512. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11513. }
  11514. var body io.Reader = nil
  11515. c.urlParams_.Set("alt", alt)
  11516. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}")
  11517. urls += "?" + c.urlParams_.Encode()
  11518. req, _ := http.NewRequest("GET", urls, body)
  11519. req.Header = reqHeaders
  11520. googleapi.Expand(req.URL, map[string]string{
  11521. "profileId": strconv.FormatInt(c.profileId, 10),
  11522. "summaryAccountId": strconv.FormatInt(c.summaryAccountId, 10),
  11523. })
  11524. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11525. }
  11526. // Do executes the "dfareporting.accountActiveAdSummaries.get" call.
  11527. // Exactly one of *AccountActiveAdSummary or error will be non-nil. Any
  11528. // non-2xx status code is an error. Response headers are in either
  11529. // *AccountActiveAdSummary.ServerResponse.Header or (if a response was
  11530. // returned at all) in error.(*googleapi.Error).Header. Use
  11531. // googleapi.IsNotModified to check whether the returned error was
  11532. // because http.StatusNotModified was returned.
  11533. func (c *AccountActiveAdSummariesGetCall) Do(opts ...googleapi.CallOption) (*AccountActiveAdSummary, error) {
  11534. gensupport.SetOptions(c.urlParams_, opts...)
  11535. res, err := c.doRequest("json")
  11536. if res != nil && res.StatusCode == http.StatusNotModified {
  11537. if res.Body != nil {
  11538. res.Body.Close()
  11539. }
  11540. return nil, &googleapi.Error{
  11541. Code: res.StatusCode,
  11542. Header: res.Header,
  11543. }
  11544. }
  11545. if err != nil {
  11546. return nil, err
  11547. }
  11548. defer googleapi.CloseBody(res)
  11549. if err := googleapi.CheckResponse(res); err != nil {
  11550. return nil, err
  11551. }
  11552. ret := &AccountActiveAdSummary{
  11553. ServerResponse: googleapi.ServerResponse{
  11554. Header: res.Header,
  11555. HTTPStatusCode: res.StatusCode,
  11556. },
  11557. }
  11558. target := &ret
  11559. if err := gensupport.DecodeResponse(target, res); err != nil {
  11560. return nil, err
  11561. }
  11562. return ret, nil
  11563. // {
  11564. // "description": "Gets the account's active ad summary by account ID.",
  11565. // "httpMethod": "GET",
  11566. // "id": "dfareporting.accountActiveAdSummaries.get",
  11567. // "parameterOrder": [
  11568. // "profileId",
  11569. // "summaryAccountId"
  11570. // ],
  11571. // "parameters": {
  11572. // "profileId": {
  11573. // "description": "User profile ID associated with this request.",
  11574. // "format": "int64",
  11575. // "location": "path",
  11576. // "required": true,
  11577. // "type": "string"
  11578. // },
  11579. // "summaryAccountId": {
  11580. // "description": "Account ID.",
  11581. // "format": "int64",
  11582. // "location": "path",
  11583. // "required": true,
  11584. // "type": "string"
  11585. // }
  11586. // },
  11587. // "path": "userprofiles/{profileId}/accountActiveAdSummaries/{summaryAccountId}",
  11588. // "response": {
  11589. // "$ref": "AccountActiveAdSummary"
  11590. // },
  11591. // "scopes": [
  11592. // "https://www.googleapis.com/auth/dfatrafficking"
  11593. // ]
  11594. // }
  11595. }
  11596. // method id "dfareporting.accountPermissionGroups.get":
  11597. type AccountPermissionGroupsGetCall struct {
  11598. s *Service
  11599. profileId int64
  11600. id int64
  11601. urlParams_ gensupport.URLParams
  11602. ifNoneMatch_ string
  11603. ctx_ context.Context
  11604. header_ http.Header
  11605. }
  11606. // Get: Gets one account permission group by ID.
  11607. func (r *AccountPermissionGroupsService) Get(profileId int64, id int64) *AccountPermissionGroupsGetCall {
  11608. c := &AccountPermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11609. c.profileId = profileId
  11610. c.id = id
  11611. return c
  11612. }
  11613. // Fields allows partial responses to be retrieved. See
  11614. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11615. // for more information.
  11616. func (c *AccountPermissionGroupsGetCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsGetCall {
  11617. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11618. return c
  11619. }
  11620. // IfNoneMatch sets the optional parameter which makes the operation
  11621. // fail if the object's ETag matches the given value. This is useful for
  11622. // getting updates only after the object has changed since the last
  11623. // request. Use googleapi.IsNotModified to check whether the response
  11624. // error from Do is the result of In-None-Match.
  11625. func (c *AccountPermissionGroupsGetCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsGetCall {
  11626. c.ifNoneMatch_ = entityTag
  11627. return c
  11628. }
  11629. // Context sets the context to be used in this call's Do method. Any
  11630. // pending HTTP request will be aborted if the provided context is
  11631. // canceled.
  11632. func (c *AccountPermissionGroupsGetCall) Context(ctx context.Context) *AccountPermissionGroupsGetCall {
  11633. c.ctx_ = ctx
  11634. return c
  11635. }
  11636. // Header returns an http.Header that can be modified by the caller to
  11637. // add HTTP headers to the request.
  11638. func (c *AccountPermissionGroupsGetCall) Header() http.Header {
  11639. if c.header_ == nil {
  11640. c.header_ = make(http.Header)
  11641. }
  11642. return c.header_
  11643. }
  11644. func (c *AccountPermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  11645. reqHeaders := make(http.Header)
  11646. for k, v := range c.header_ {
  11647. reqHeaders[k] = v
  11648. }
  11649. reqHeaders.Set("User-Agent", c.s.userAgent())
  11650. if c.ifNoneMatch_ != "" {
  11651. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11652. }
  11653. var body io.Reader = nil
  11654. c.urlParams_.Set("alt", alt)
  11655. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups/{id}")
  11656. urls += "?" + c.urlParams_.Encode()
  11657. req, _ := http.NewRequest("GET", urls, body)
  11658. req.Header = reqHeaders
  11659. googleapi.Expand(req.URL, map[string]string{
  11660. "profileId": strconv.FormatInt(c.profileId, 10),
  11661. "id": strconv.FormatInt(c.id, 10),
  11662. })
  11663. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11664. }
  11665. // Do executes the "dfareporting.accountPermissionGroups.get" call.
  11666. // Exactly one of *AccountPermissionGroup or error will be non-nil. Any
  11667. // non-2xx status code is an error. Response headers are in either
  11668. // *AccountPermissionGroup.ServerResponse.Header or (if a response was
  11669. // returned at all) in error.(*googleapi.Error).Header. Use
  11670. // googleapi.IsNotModified to check whether the returned error was
  11671. // because http.StatusNotModified was returned.
  11672. func (c *AccountPermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroup, error) {
  11673. gensupport.SetOptions(c.urlParams_, opts...)
  11674. res, err := c.doRequest("json")
  11675. if res != nil && res.StatusCode == http.StatusNotModified {
  11676. if res.Body != nil {
  11677. res.Body.Close()
  11678. }
  11679. return nil, &googleapi.Error{
  11680. Code: res.StatusCode,
  11681. Header: res.Header,
  11682. }
  11683. }
  11684. if err != nil {
  11685. return nil, err
  11686. }
  11687. defer googleapi.CloseBody(res)
  11688. if err := googleapi.CheckResponse(res); err != nil {
  11689. return nil, err
  11690. }
  11691. ret := &AccountPermissionGroup{
  11692. ServerResponse: googleapi.ServerResponse{
  11693. Header: res.Header,
  11694. HTTPStatusCode: res.StatusCode,
  11695. },
  11696. }
  11697. target := &ret
  11698. if err := gensupport.DecodeResponse(target, res); err != nil {
  11699. return nil, err
  11700. }
  11701. return ret, nil
  11702. // {
  11703. // "description": "Gets one account permission group by ID.",
  11704. // "httpMethod": "GET",
  11705. // "id": "dfareporting.accountPermissionGroups.get",
  11706. // "parameterOrder": [
  11707. // "profileId",
  11708. // "id"
  11709. // ],
  11710. // "parameters": {
  11711. // "id": {
  11712. // "description": "Account permission group ID.",
  11713. // "format": "int64",
  11714. // "location": "path",
  11715. // "required": true,
  11716. // "type": "string"
  11717. // },
  11718. // "profileId": {
  11719. // "description": "User profile ID associated with this request.",
  11720. // "format": "int64",
  11721. // "location": "path",
  11722. // "required": true,
  11723. // "type": "string"
  11724. // }
  11725. // },
  11726. // "path": "userprofiles/{profileId}/accountPermissionGroups/{id}",
  11727. // "response": {
  11728. // "$ref": "AccountPermissionGroup"
  11729. // },
  11730. // "scopes": [
  11731. // "https://www.googleapis.com/auth/dfatrafficking"
  11732. // ]
  11733. // }
  11734. }
  11735. // method id "dfareporting.accountPermissionGroups.list":
  11736. type AccountPermissionGroupsListCall struct {
  11737. s *Service
  11738. profileId int64
  11739. urlParams_ gensupport.URLParams
  11740. ifNoneMatch_ string
  11741. ctx_ context.Context
  11742. header_ http.Header
  11743. }
  11744. // List: Retrieves the list of account permission groups.
  11745. func (r *AccountPermissionGroupsService) List(profileId int64) *AccountPermissionGroupsListCall {
  11746. c := &AccountPermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11747. c.profileId = profileId
  11748. return c
  11749. }
  11750. // Fields allows partial responses to be retrieved. See
  11751. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11752. // for more information.
  11753. func (c *AccountPermissionGroupsListCall) Fields(s ...googleapi.Field) *AccountPermissionGroupsListCall {
  11754. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11755. return c
  11756. }
  11757. // IfNoneMatch sets the optional parameter which makes the operation
  11758. // fail if the object's ETag matches the given value. This is useful for
  11759. // getting updates only after the object has changed since the last
  11760. // request. Use googleapi.IsNotModified to check whether the response
  11761. // error from Do is the result of In-None-Match.
  11762. func (c *AccountPermissionGroupsListCall) IfNoneMatch(entityTag string) *AccountPermissionGroupsListCall {
  11763. c.ifNoneMatch_ = entityTag
  11764. return c
  11765. }
  11766. // Context sets the context to be used in this call's Do method. Any
  11767. // pending HTTP request will be aborted if the provided context is
  11768. // canceled.
  11769. func (c *AccountPermissionGroupsListCall) Context(ctx context.Context) *AccountPermissionGroupsListCall {
  11770. c.ctx_ = ctx
  11771. return c
  11772. }
  11773. // Header returns an http.Header that can be modified by the caller to
  11774. // add HTTP headers to the request.
  11775. func (c *AccountPermissionGroupsListCall) Header() http.Header {
  11776. if c.header_ == nil {
  11777. c.header_ = make(http.Header)
  11778. }
  11779. return c.header_
  11780. }
  11781. func (c *AccountPermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  11782. reqHeaders := make(http.Header)
  11783. for k, v := range c.header_ {
  11784. reqHeaders[k] = v
  11785. }
  11786. reqHeaders.Set("User-Agent", c.s.userAgent())
  11787. if c.ifNoneMatch_ != "" {
  11788. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11789. }
  11790. var body io.Reader = nil
  11791. c.urlParams_.Set("alt", alt)
  11792. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissionGroups")
  11793. urls += "?" + c.urlParams_.Encode()
  11794. req, _ := http.NewRequest("GET", urls, body)
  11795. req.Header = reqHeaders
  11796. googleapi.Expand(req.URL, map[string]string{
  11797. "profileId": strconv.FormatInt(c.profileId, 10),
  11798. })
  11799. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11800. }
  11801. // Do executes the "dfareporting.accountPermissionGroups.list" call.
  11802. // Exactly one of *AccountPermissionGroupsListResponse or error will be
  11803. // non-nil. Any non-2xx status code is an error. Response headers are in
  11804. // either *AccountPermissionGroupsListResponse.ServerResponse.Header or
  11805. // (if a response was returned at all) in
  11806. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  11807. // whether the returned error was because http.StatusNotModified was
  11808. // returned.
  11809. func (c *AccountPermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionGroupsListResponse, error) {
  11810. gensupport.SetOptions(c.urlParams_, opts...)
  11811. res, err := c.doRequest("json")
  11812. if res != nil && res.StatusCode == http.StatusNotModified {
  11813. if res.Body != nil {
  11814. res.Body.Close()
  11815. }
  11816. return nil, &googleapi.Error{
  11817. Code: res.StatusCode,
  11818. Header: res.Header,
  11819. }
  11820. }
  11821. if err != nil {
  11822. return nil, err
  11823. }
  11824. defer googleapi.CloseBody(res)
  11825. if err := googleapi.CheckResponse(res); err != nil {
  11826. return nil, err
  11827. }
  11828. ret := &AccountPermissionGroupsListResponse{
  11829. ServerResponse: googleapi.ServerResponse{
  11830. Header: res.Header,
  11831. HTTPStatusCode: res.StatusCode,
  11832. },
  11833. }
  11834. target := &ret
  11835. if err := gensupport.DecodeResponse(target, res); err != nil {
  11836. return nil, err
  11837. }
  11838. return ret, nil
  11839. // {
  11840. // "description": "Retrieves the list of account permission groups.",
  11841. // "httpMethod": "GET",
  11842. // "id": "dfareporting.accountPermissionGroups.list",
  11843. // "parameterOrder": [
  11844. // "profileId"
  11845. // ],
  11846. // "parameters": {
  11847. // "profileId": {
  11848. // "description": "User profile ID associated with this request.",
  11849. // "format": "int64",
  11850. // "location": "path",
  11851. // "required": true,
  11852. // "type": "string"
  11853. // }
  11854. // },
  11855. // "path": "userprofiles/{profileId}/accountPermissionGroups",
  11856. // "response": {
  11857. // "$ref": "AccountPermissionGroupsListResponse"
  11858. // },
  11859. // "scopes": [
  11860. // "https://www.googleapis.com/auth/dfatrafficking"
  11861. // ]
  11862. // }
  11863. }
  11864. // method id "dfareporting.accountPermissions.get":
  11865. type AccountPermissionsGetCall struct {
  11866. s *Service
  11867. profileId int64
  11868. id int64
  11869. urlParams_ gensupport.URLParams
  11870. ifNoneMatch_ string
  11871. ctx_ context.Context
  11872. header_ http.Header
  11873. }
  11874. // Get: Gets one account permission by ID.
  11875. func (r *AccountPermissionsService) Get(profileId int64, id int64) *AccountPermissionsGetCall {
  11876. c := &AccountPermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11877. c.profileId = profileId
  11878. c.id = id
  11879. return c
  11880. }
  11881. // Fields allows partial responses to be retrieved. See
  11882. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11883. // for more information.
  11884. func (c *AccountPermissionsGetCall) Fields(s ...googleapi.Field) *AccountPermissionsGetCall {
  11885. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11886. return c
  11887. }
  11888. // IfNoneMatch sets the optional parameter which makes the operation
  11889. // fail if the object's ETag matches the given value. This is useful for
  11890. // getting updates only after the object has changed since the last
  11891. // request. Use googleapi.IsNotModified to check whether the response
  11892. // error from Do is the result of In-None-Match.
  11893. func (c *AccountPermissionsGetCall) IfNoneMatch(entityTag string) *AccountPermissionsGetCall {
  11894. c.ifNoneMatch_ = entityTag
  11895. return c
  11896. }
  11897. // Context sets the context to be used in this call's Do method. Any
  11898. // pending HTTP request will be aborted if the provided context is
  11899. // canceled.
  11900. func (c *AccountPermissionsGetCall) Context(ctx context.Context) *AccountPermissionsGetCall {
  11901. c.ctx_ = ctx
  11902. return c
  11903. }
  11904. // Header returns an http.Header that can be modified by the caller to
  11905. // add HTTP headers to the request.
  11906. func (c *AccountPermissionsGetCall) Header() http.Header {
  11907. if c.header_ == nil {
  11908. c.header_ = make(http.Header)
  11909. }
  11910. return c.header_
  11911. }
  11912. func (c *AccountPermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  11913. reqHeaders := make(http.Header)
  11914. for k, v := range c.header_ {
  11915. reqHeaders[k] = v
  11916. }
  11917. reqHeaders.Set("User-Agent", c.s.userAgent())
  11918. if c.ifNoneMatch_ != "" {
  11919. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11920. }
  11921. var body io.Reader = nil
  11922. c.urlParams_.Set("alt", alt)
  11923. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions/{id}")
  11924. urls += "?" + c.urlParams_.Encode()
  11925. req, _ := http.NewRequest("GET", urls, body)
  11926. req.Header = reqHeaders
  11927. googleapi.Expand(req.URL, map[string]string{
  11928. "profileId": strconv.FormatInt(c.profileId, 10),
  11929. "id": strconv.FormatInt(c.id, 10),
  11930. })
  11931. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11932. }
  11933. // Do executes the "dfareporting.accountPermissions.get" call.
  11934. // Exactly one of *AccountPermission or error will be non-nil. Any
  11935. // non-2xx status code is an error. Response headers are in either
  11936. // *AccountPermission.ServerResponse.Header or (if a response was
  11937. // returned at all) in error.(*googleapi.Error).Header. Use
  11938. // googleapi.IsNotModified to check whether the returned error was
  11939. // because http.StatusNotModified was returned.
  11940. func (c *AccountPermissionsGetCall) Do(opts ...googleapi.CallOption) (*AccountPermission, error) {
  11941. gensupport.SetOptions(c.urlParams_, opts...)
  11942. res, err := c.doRequest("json")
  11943. if res != nil && res.StatusCode == http.StatusNotModified {
  11944. if res.Body != nil {
  11945. res.Body.Close()
  11946. }
  11947. return nil, &googleapi.Error{
  11948. Code: res.StatusCode,
  11949. Header: res.Header,
  11950. }
  11951. }
  11952. if err != nil {
  11953. return nil, err
  11954. }
  11955. defer googleapi.CloseBody(res)
  11956. if err := googleapi.CheckResponse(res); err != nil {
  11957. return nil, err
  11958. }
  11959. ret := &AccountPermission{
  11960. ServerResponse: googleapi.ServerResponse{
  11961. Header: res.Header,
  11962. HTTPStatusCode: res.StatusCode,
  11963. },
  11964. }
  11965. target := &ret
  11966. if err := gensupport.DecodeResponse(target, res); err != nil {
  11967. return nil, err
  11968. }
  11969. return ret, nil
  11970. // {
  11971. // "description": "Gets one account permission by ID.",
  11972. // "httpMethod": "GET",
  11973. // "id": "dfareporting.accountPermissions.get",
  11974. // "parameterOrder": [
  11975. // "profileId",
  11976. // "id"
  11977. // ],
  11978. // "parameters": {
  11979. // "id": {
  11980. // "description": "Account permission ID.",
  11981. // "format": "int64",
  11982. // "location": "path",
  11983. // "required": true,
  11984. // "type": "string"
  11985. // },
  11986. // "profileId": {
  11987. // "description": "User profile ID associated with this request.",
  11988. // "format": "int64",
  11989. // "location": "path",
  11990. // "required": true,
  11991. // "type": "string"
  11992. // }
  11993. // },
  11994. // "path": "userprofiles/{profileId}/accountPermissions/{id}",
  11995. // "response": {
  11996. // "$ref": "AccountPermission"
  11997. // },
  11998. // "scopes": [
  11999. // "https://www.googleapis.com/auth/dfatrafficking"
  12000. // ]
  12001. // }
  12002. }
  12003. // method id "dfareporting.accountPermissions.list":
  12004. type AccountPermissionsListCall struct {
  12005. s *Service
  12006. profileId int64
  12007. urlParams_ gensupport.URLParams
  12008. ifNoneMatch_ string
  12009. ctx_ context.Context
  12010. header_ http.Header
  12011. }
  12012. // List: Retrieves the list of account permissions.
  12013. func (r *AccountPermissionsService) List(profileId int64) *AccountPermissionsListCall {
  12014. c := &AccountPermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12015. c.profileId = profileId
  12016. return c
  12017. }
  12018. // Fields allows partial responses to be retrieved. See
  12019. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12020. // for more information.
  12021. func (c *AccountPermissionsListCall) Fields(s ...googleapi.Field) *AccountPermissionsListCall {
  12022. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12023. return c
  12024. }
  12025. // IfNoneMatch sets the optional parameter which makes the operation
  12026. // fail if the object's ETag matches the given value. This is useful for
  12027. // getting updates only after the object has changed since the last
  12028. // request. Use googleapi.IsNotModified to check whether the response
  12029. // error from Do is the result of In-None-Match.
  12030. func (c *AccountPermissionsListCall) IfNoneMatch(entityTag string) *AccountPermissionsListCall {
  12031. c.ifNoneMatch_ = entityTag
  12032. return c
  12033. }
  12034. // Context sets the context to be used in this call's Do method. Any
  12035. // pending HTTP request will be aborted if the provided context is
  12036. // canceled.
  12037. func (c *AccountPermissionsListCall) Context(ctx context.Context) *AccountPermissionsListCall {
  12038. c.ctx_ = ctx
  12039. return c
  12040. }
  12041. // Header returns an http.Header that can be modified by the caller to
  12042. // add HTTP headers to the request.
  12043. func (c *AccountPermissionsListCall) Header() http.Header {
  12044. if c.header_ == nil {
  12045. c.header_ = make(http.Header)
  12046. }
  12047. return c.header_
  12048. }
  12049. func (c *AccountPermissionsListCall) doRequest(alt string) (*http.Response, error) {
  12050. reqHeaders := make(http.Header)
  12051. for k, v := range c.header_ {
  12052. reqHeaders[k] = v
  12053. }
  12054. reqHeaders.Set("User-Agent", c.s.userAgent())
  12055. if c.ifNoneMatch_ != "" {
  12056. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12057. }
  12058. var body io.Reader = nil
  12059. c.urlParams_.Set("alt", alt)
  12060. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountPermissions")
  12061. urls += "?" + c.urlParams_.Encode()
  12062. req, _ := http.NewRequest("GET", urls, body)
  12063. req.Header = reqHeaders
  12064. googleapi.Expand(req.URL, map[string]string{
  12065. "profileId": strconv.FormatInt(c.profileId, 10),
  12066. })
  12067. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12068. }
  12069. // Do executes the "dfareporting.accountPermissions.list" call.
  12070. // Exactly one of *AccountPermissionsListResponse or error will be
  12071. // non-nil. Any non-2xx status code is an error. Response headers are in
  12072. // either *AccountPermissionsListResponse.ServerResponse.Header or (if a
  12073. // response was returned at all) in error.(*googleapi.Error).Header. Use
  12074. // googleapi.IsNotModified to check whether the returned error was
  12075. // because http.StatusNotModified was returned.
  12076. func (c *AccountPermissionsListCall) Do(opts ...googleapi.CallOption) (*AccountPermissionsListResponse, error) {
  12077. gensupport.SetOptions(c.urlParams_, opts...)
  12078. res, err := c.doRequest("json")
  12079. if res != nil && res.StatusCode == http.StatusNotModified {
  12080. if res.Body != nil {
  12081. res.Body.Close()
  12082. }
  12083. return nil, &googleapi.Error{
  12084. Code: res.StatusCode,
  12085. Header: res.Header,
  12086. }
  12087. }
  12088. if err != nil {
  12089. return nil, err
  12090. }
  12091. defer googleapi.CloseBody(res)
  12092. if err := googleapi.CheckResponse(res); err != nil {
  12093. return nil, err
  12094. }
  12095. ret := &AccountPermissionsListResponse{
  12096. ServerResponse: googleapi.ServerResponse{
  12097. Header: res.Header,
  12098. HTTPStatusCode: res.StatusCode,
  12099. },
  12100. }
  12101. target := &ret
  12102. if err := gensupport.DecodeResponse(target, res); err != nil {
  12103. return nil, err
  12104. }
  12105. return ret, nil
  12106. // {
  12107. // "description": "Retrieves the list of account permissions.",
  12108. // "httpMethod": "GET",
  12109. // "id": "dfareporting.accountPermissions.list",
  12110. // "parameterOrder": [
  12111. // "profileId"
  12112. // ],
  12113. // "parameters": {
  12114. // "profileId": {
  12115. // "description": "User profile ID associated with this request.",
  12116. // "format": "int64",
  12117. // "location": "path",
  12118. // "required": true,
  12119. // "type": "string"
  12120. // }
  12121. // },
  12122. // "path": "userprofiles/{profileId}/accountPermissions",
  12123. // "response": {
  12124. // "$ref": "AccountPermissionsListResponse"
  12125. // },
  12126. // "scopes": [
  12127. // "https://www.googleapis.com/auth/dfatrafficking"
  12128. // ]
  12129. // }
  12130. }
  12131. // method id "dfareporting.accountUserProfiles.get":
  12132. type AccountUserProfilesGetCall struct {
  12133. s *Service
  12134. profileId int64
  12135. id int64
  12136. urlParams_ gensupport.URLParams
  12137. ifNoneMatch_ string
  12138. ctx_ context.Context
  12139. header_ http.Header
  12140. }
  12141. // Get: Gets one account user profile by ID.
  12142. func (r *AccountUserProfilesService) Get(profileId int64, id int64) *AccountUserProfilesGetCall {
  12143. c := &AccountUserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12144. c.profileId = profileId
  12145. c.id = id
  12146. return c
  12147. }
  12148. // Fields allows partial responses to be retrieved. See
  12149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12150. // for more information.
  12151. func (c *AccountUserProfilesGetCall) Fields(s ...googleapi.Field) *AccountUserProfilesGetCall {
  12152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12153. return c
  12154. }
  12155. // IfNoneMatch sets the optional parameter which makes the operation
  12156. // fail if the object's ETag matches the given value. This is useful for
  12157. // getting updates only after the object has changed since the last
  12158. // request. Use googleapi.IsNotModified to check whether the response
  12159. // error from Do is the result of In-None-Match.
  12160. func (c *AccountUserProfilesGetCall) IfNoneMatch(entityTag string) *AccountUserProfilesGetCall {
  12161. c.ifNoneMatch_ = entityTag
  12162. return c
  12163. }
  12164. // Context sets the context to be used in this call's Do method. Any
  12165. // pending HTTP request will be aborted if the provided context is
  12166. // canceled.
  12167. func (c *AccountUserProfilesGetCall) Context(ctx context.Context) *AccountUserProfilesGetCall {
  12168. c.ctx_ = ctx
  12169. return c
  12170. }
  12171. // Header returns an http.Header that can be modified by the caller to
  12172. // add HTTP headers to the request.
  12173. func (c *AccountUserProfilesGetCall) Header() http.Header {
  12174. if c.header_ == nil {
  12175. c.header_ = make(http.Header)
  12176. }
  12177. return c.header_
  12178. }
  12179. func (c *AccountUserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  12180. reqHeaders := make(http.Header)
  12181. for k, v := range c.header_ {
  12182. reqHeaders[k] = v
  12183. }
  12184. reqHeaders.Set("User-Agent", c.s.userAgent())
  12185. if c.ifNoneMatch_ != "" {
  12186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12187. }
  12188. var body io.Reader = nil
  12189. c.urlParams_.Set("alt", alt)
  12190. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles/{id}")
  12191. urls += "?" + c.urlParams_.Encode()
  12192. req, _ := http.NewRequest("GET", urls, body)
  12193. req.Header = reqHeaders
  12194. googleapi.Expand(req.URL, map[string]string{
  12195. "profileId": strconv.FormatInt(c.profileId, 10),
  12196. "id": strconv.FormatInt(c.id, 10),
  12197. })
  12198. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12199. }
  12200. // Do executes the "dfareporting.accountUserProfiles.get" call.
  12201. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12202. // non-2xx status code is an error. Response headers are in either
  12203. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12204. // returned at all) in error.(*googleapi.Error).Header. Use
  12205. // googleapi.IsNotModified to check whether the returned error was
  12206. // because http.StatusNotModified was returned.
  12207. func (c *AccountUserProfilesGetCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12208. gensupport.SetOptions(c.urlParams_, opts...)
  12209. res, err := c.doRequest("json")
  12210. if res != nil && res.StatusCode == http.StatusNotModified {
  12211. if res.Body != nil {
  12212. res.Body.Close()
  12213. }
  12214. return nil, &googleapi.Error{
  12215. Code: res.StatusCode,
  12216. Header: res.Header,
  12217. }
  12218. }
  12219. if err != nil {
  12220. return nil, err
  12221. }
  12222. defer googleapi.CloseBody(res)
  12223. if err := googleapi.CheckResponse(res); err != nil {
  12224. return nil, err
  12225. }
  12226. ret := &AccountUserProfile{
  12227. ServerResponse: googleapi.ServerResponse{
  12228. Header: res.Header,
  12229. HTTPStatusCode: res.StatusCode,
  12230. },
  12231. }
  12232. target := &ret
  12233. if err := gensupport.DecodeResponse(target, res); err != nil {
  12234. return nil, err
  12235. }
  12236. return ret, nil
  12237. // {
  12238. // "description": "Gets one account user profile by ID.",
  12239. // "httpMethod": "GET",
  12240. // "id": "dfareporting.accountUserProfiles.get",
  12241. // "parameterOrder": [
  12242. // "profileId",
  12243. // "id"
  12244. // ],
  12245. // "parameters": {
  12246. // "id": {
  12247. // "description": "User profile ID.",
  12248. // "format": "int64",
  12249. // "location": "path",
  12250. // "required": true,
  12251. // "type": "string"
  12252. // },
  12253. // "profileId": {
  12254. // "description": "User profile ID associated with this request.",
  12255. // "format": "int64",
  12256. // "location": "path",
  12257. // "required": true,
  12258. // "type": "string"
  12259. // }
  12260. // },
  12261. // "path": "userprofiles/{profileId}/accountUserProfiles/{id}",
  12262. // "response": {
  12263. // "$ref": "AccountUserProfile"
  12264. // },
  12265. // "scopes": [
  12266. // "https://www.googleapis.com/auth/dfatrafficking"
  12267. // ]
  12268. // }
  12269. }
  12270. // method id "dfareporting.accountUserProfiles.insert":
  12271. type AccountUserProfilesInsertCall struct {
  12272. s *Service
  12273. profileId int64
  12274. accountuserprofile *AccountUserProfile
  12275. urlParams_ gensupport.URLParams
  12276. ctx_ context.Context
  12277. header_ http.Header
  12278. }
  12279. // Insert: Inserts a new account user profile.
  12280. func (r *AccountUserProfilesService) Insert(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesInsertCall {
  12281. c := &AccountUserProfilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12282. c.profileId = profileId
  12283. c.accountuserprofile = accountuserprofile
  12284. return c
  12285. }
  12286. // Fields allows partial responses to be retrieved. See
  12287. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12288. // for more information.
  12289. func (c *AccountUserProfilesInsertCall) Fields(s ...googleapi.Field) *AccountUserProfilesInsertCall {
  12290. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12291. return c
  12292. }
  12293. // Context sets the context to be used in this call's Do method. Any
  12294. // pending HTTP request will be aborted if the provided context is
  12295. // canceled.
  12296. func (c *AccountUserProfilesInsertCall) Context(ctx context.Context) *AccountUserProfilesInsertCall {
  12297. c.ctx_ = ctx
  12298. return c
  12299. }
  12300. // Header returns an http.Header that can be modified by the caller to
  12301. // add HTTP headers to the request.
  12302. func (c *AccountUserProfilesInsertCall) Header() http.Header {
  12303. if c.header_ == nil {
  12304. c.header_ = make(http.Header)
  12305. }
  12306. return c.header_
  12307. }
  12308. func (c *AccountUserProfilesInsertCall) doRequest(alt string) (*http.Response, error) {
  12309. reqHeaders := make(http.Header)
  12310. for k, v := range c.header_ {
  12311. reqHeaders[k] = v
  12312. }
  12313. reqHeaders.Set("User-Agent", c.s.userAgent())
  12314. var body io.Reader = nil
  12315. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12316. if err != nil {
  12317. return nil, err
  12318. }
  12319. reqHeaders.Set("Content-Type", "application/json")
  12320. c.urlParams_.Set("alt", alt)
  12321. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12322. urls += "?" + c.urlParams_.Encode()
  12323. req, _ := http.NewRequest("POST", urls, body)
  12324. req.Header = reqHeaders
  12325. googleapi.Expand(req.URL, map[string]string{
  12326. "profileId": strconv.FormatInt(c.profileId, 10),
  12327. })
  12328. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12329. }
  12330. // Do executes the "dfareporting.accountUserProfiles.insert" call.
  12331. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12332. // non-2xx status code is an error. Response headers are in either
  12333. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12334. // returned at all) in error.(*googleapi.Error).Header. Use
  12335. // googleapi.IsNotModified to check whether the returned error was
  12336. // because http.StatusNotModified was returned.
  12337. func (c *AccountUserProfilesInsertCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12338. gensupport.SetOptions(c.urlParams_, opts...)
  12339. res, err := c.doRequest("json")
  12340. if res != nil && res.StatusCode == http.StatusNotModified {
  12341. if res.Body != nil {
  12342. res.Body.Close()
  12343. }
  12344. return nil, &googleapi.Error{
  12345. Code: res.StatusCode,
  12346. Header: res.Header,
  12347. }
  12348. }
  12349. if err != nil {
  12350. return nil, err
  12351. }
  12352. defer googleapi.CloseBody(res)
  12353. if err := googleapi.CheckResponse(res); err != nil {
  12354. return nil, err
  12355. }
  12356. ret := &AccountUserProfile{
  12357. ServerResponse: googleapi.ServerResponse{
  12358. Header: res.Header,
  12359. HTTPStatusCode: res.StatusCode,
  12360. },
  12361. }
  12362. target := &ret
  12363. if err := gensupport.DecodeResponse(target, res); err != nil {
  12364. return nil, err
  12365. }
  12366. return ret, nil
  12367. // {
  12368. // "description": "Inserts a new account user profile.",
  12369. // "httpMethod": "POST",
  12370. // "id": "dfareporting.accountUserProfiles.insert",
  12371. // "parameterOrder": [
  12372. // "profileId"
  12373. // ],
  12374. // "parameters": {
  12375. // "profileId": {
  12376. // "description": "User profile ID associated with this request.",
  12377. // "format": "int64",
  12378. // "location": "path",
  12379. // "required": true,
  12380. // "type": "string"
  12381. // }
  12382. // },
  12383. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12384. // "request": {
  12385. // "$ref": "AccountUserProfile"
  12386. // },
  12387. // "response": {
  12388. // "$ref": "AccountUserProfile"
  12389. // },
  12390. // "scopes": [
  12391. // "https://www.googleapis.com/auth/dfatrafficking"
  12392. // ]
  12393. // }
  12394. }
  12395. // method id "dfareporting.accountUserProfiles.list":
  12396. type AccountUserProfilesListCall struct {
  12397. s *Service
  12398. profileId int64
  12399. urlParams_ gensupport.URLParams
  12400. ifNoneMatch_ string
  12401. ctx_ context.Context
  12402. header_ http.Header
  12403. }
  12404. // List: Retrieves a list of account user profiles, possibly filtered.
  12405. // This method supports paging.
  12406. func (r *AccountUserProfilesService) List(profileId int64) *AccountUserProfilesListCall {
  12407. c := &AccountUserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12408. c.profileId = profileId
  12409. return c
  12410. }
  12411. // Active sets the optional parameter "active": Select only active user
  12412. // profiles.
  12413. func (c *AccountUserProfilesListCall) Active(active bool) *AccountUserProfilesListCall {
  12414. c.urlParams_.Set("active", fmt.Sprint(active))
  12415. return c
  12416. }
  12417. // Ids sets the optional parameter "ids": Select only user profiles with
  12418. // these IDs.
  12419. func (c *AccountUserProfilesListCall) Ids(ids ...int64) *AccountUserProfilesListCall {
  12420. var ids_ []string
  12421. for _, v := range ids {
  12422. ids_ = append(ids_, fmt.Sprint(v))
  12423. }
  12424. c.urlParams_.SetMulti("ids", ids_)
  12425. return c
  12426. }
  12427. // MaxResults sets the optional parameter "maxResults": Maximum number
  12428. // of results to return.
  12429. func (c *AccountUserProfilesListCall) MaxResults(maxResults int64) *AccountUserProfilesListCall {
  12430. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  12431. return c
  12432. }
  12433. // PageToken sets the optional parameter "pageToken": Value of the
  12434. // nextPageToken from the previous result page.
  12435. func (c *AccountUserProfilesListCall) PageToken(pageToken string) *AccountUserProfilesListCall {
  12436. c.urlParams_.Set("pageToken", pageToken)
  12437. return c
  12438. }
  12439. // SearchString sets the optional parameter "searchString": Allows
  12440. // searching for objects by name, ID or email. Wildcards (*) are
  12441. // allowed. For example, "user profile*2015" will return objects with
  12442. // names like "user profile June 2015", "user profile April 2015", or
  12443. // simply "user profile 2015". Most of the searches also add wildcards
  12444. // implicitly at the start and the end of the search string. For
  12445. // example, a search string of "user profile" will match objects with
  12446. // name "my user profile", "user profile 2015", or simply "user
  12447. // profile".
  12448. func (c *AccountUserProfilesListCall) SearchString(searchString string) *AccountUserProfilesListCall {
  12449. c.urlParams_.Set("searchString", searchString)
  12450. return c
  12451. }
  12452. // SortField sets the optional parameter "sortField": Field by which to
  12453. // sort the list.
  12454. //
  12455. // Possible values:
  12456. // "ID" (default)
  12457. // "NAME"
  12458. func (c *AccountUserProfilesListCall) SortField(sortField string) *AccountUserProfilesListCall {
  12459. c.urlParams_.Set("sortField", sortField)
  12460. return c
  12461. }
  12462. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  12463. // results.
  12464. //
  12465. // Possible values:
  12466. // "ASCENDING" (default)
  12467. // "DESCENDING"
  12468. func (c *AccountUserProfilesListCall) SortOrder(sortOrder string) *AccountUserProfilesListCall {
  12469. c.urlParams_.Set("sortOrder", sortOrder)
  12470. return c
  12471. }
  12472. // SubaccountId sets the optional parameter "subaccountId": Select only
  12473. // user profiles with the specified subaccount ID.
  12474. func (c *AccountUserProfilesListCall) SubaccountId(subaccountId int64) *AccountUserProfilesListCall {
  12475. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  12476. return c
  12477. }
  12478. // UserRoleId sets the optional parameter "userRoleId": Select only user
  12479. // profiles with the specified user role ID.
  12480. func (c *AccountUserProfilesListCall) UserRoleId(userRoleId int64) *AccountUserProfilesListCall {
  12481. c.urlParams_.Set("userRoleId", fmt.Sprint(userRoleId))
  12482. return c
  12483. }
  12484. // Fields allows partial responses to be retrieved. See
  12485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12486. // for more information.
  12487. func (c *AccountUserProfilesListCall) Fields(s ...googleapi.Field) *AccountUserProfilesListCall {
  12488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12489. return c
  12490. }
  12491. // IfNoneMatch sets the optional parameter which makes the operation
  12492. // fail if the object's ETag matches the given value. This is useful for
  12493. // getting updates only after the object has changed since the last
  12494. // request. Use googleapi.IsNotModified to check whether the response
  12495. // error from Do is the result of In-None-Match.
  12496. func (c *AccountUserProfilesListCall) IfNoneMatch(entityTag string) *AccountUserProfilesListCall {
  12497. c.ifNoneMatch_ = entityTag
  12498. return c
  12499. }
  12500. // Context sets the context to be used in this call's Do method. Any
  12501. // pending HTTP request will be aborted if the provided context is
  12502. // canceled.
  12503. func (c *AccountUserProfilesListCall) Context(ctx context.Context) *AccountUserProfilesListCall {
  12504. c.ctx_ = ctx
  12505. return c
  12506. }
  12507. // Header returns an http.Header that can be modified by the caller to
  12508. // add HTTP headers to the request.
  12509. func (c *AccountUserProfilesListCall) Header() http.Header {
  12510. if c.header_ == nil {
  12511. c.header_ = make(http.Header)
  12512. }
  12513. return c.header_
  12514. }
  12515. func (c *AccountUserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  12516. reqHeaders := make(http.Header)
  12517. for k, v := range c.header_ {
  12518. reqHeaders[k] = v
  12519. }
  12520. reqHeaders.Set("User-Agent", c.s.userAgent())
  12521. if c.ifNoneMatch_ != "" {
  12522. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  12523. }
  12524. var body io.Reader = nil
  12525. c.urlParams_.Set("alt", alt)
  12526. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12527. urls += "?" + c.urlParams_.Encode()
  12528. req, _ := http.NewRequest("GET", urls, body)
  12529. req.Header = reqHeaders
  12530. googleapi.Expand(req.URL, map[string]string{
  12531. "profileId": strconv.FormatInt(c.profileId, 10),
  12532. })
  12533. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12534. }
  12535. // Do executes the "dfareporting.accountUserProfiles.list" call.
  12536. // Exactly one of *AccountUserProfilesListResponse or error will be
  12537. // non-nil. Any non-2xx status code is an error. Response headers are in
  12538. // either *AccountUserProfilesListResponse.ServerResponse.Header or (if
  12539. // a response was returned at all) in error.(*googleapi.Error).Header.
  12540. // Use googleapi.IsNotModified to check whether the returned error was
  12541. // because http.StatusNotModified was returned.
  12542. func (c *AccountUserProfilesListCall) Do(opts ...googleapi.CallOption) (*AccountUserProfilesListResponse, error) {
  12543. gensupport.SetOptions(c.urlParams_, opts...)
  12544. res, err := c.doRequest("json")
  12545. if res != nil && res.StatusCode == http.StatusNotModified {
  12546. if res.Body != nil {
  12547. res.Body.Close()
  12548. }
  12549. return nil, &googleapi.Error{
  12550. Code: res.StatusCode,
  12551. Header: res.Header,
  12552. }
  12553. }
  12554. if err != nil {
  12555. return nil, err
  12556. }
  12557. defer googleapi.CloseBody(res)
  12558. if err := googleapi.CheckResponse(res); err != nil {
  12559. return nil, err
  12560. }
  12561. ret := &AccountUserProfilesListResponse{
  12562. ServerResponse: googleapi.ServerResponse{
  12563. Header: res.Header,
  12564. HTTPStatusCode: res.StatusCode,
  12565. },
  12566. }
  12567. target := &ret
  12568. if err := gensupport.DecodeResponse(target, res); err != nil {
  12569. return nil, err
  12570. }
  12571. return ret, nil
  12572. // {
  12573. // "description": "Retrieves a list of account user profiles, possibly filtered. This method supports paging.",
  12574. // "httpMethod": "GET",
  12575. // "id": "dfareporting.accountUserProfiles.list",
  12576. // "parameterOrder": [
  12577. // "profileId"
  12578. // ],
  12579. // "parameters": {
  12580. // "active": {
  12581. // "description": "Select only active user profiles.",
  12582. // "location": "query",
  12583. // "type": "boolean"
  12584. // },
  12585. // "ids": {
  12586. // "description": "Select only user profiles with these IDs.",
  12587. // "format": "int64",
  12588. // "location": "query",
  12589. // "repeated": true,
  12590. // "type": "string"
  12591. // },
  12592. // "maxResults": {
  12593. // "default": "1000",
  12594. // "description": "Maximum number of results to return.",
  12595. // "format": "int32",
  12596. // "location": "query",
  12597. // "maximum": "1000",
  12598. // "minimum": "0",
  12599. // "type": "integer"
  12600. // },
  12601. // "pageToken": {
  12602. // "description": "Value of the nextPageToken from the previous result page.",
  12603. // "location": "query",
  12604. // "type": "string"
  12605. // },
  12606. // "profileId": {
  12607. // "description": "User profile ID associated with this request.",
  12608. // "format": "int64",
  12609. // "location": "path",
  12610. // "required": true,
  12611. // "type": "string"
  12612. // },
  12613. // "searchString": {
  12614. // "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\".",
  12615. // "location": "query",
  12616. // "type": "string"
  12617. // },
  12618. // "sortField": {
  12619. // "default": "ID",
  12620. // "description": "Field by which to sort the list.",
  12621. // "enum": [
  12622. // "ID",
  12623. // "NAME"
  12624. // ],
  12625. // "enumDescriptions": [
  12626. // "",
  12627. // ""
  12628. // ],
  12629. // "location": "query",
  12630. // "type": "string"
  12631. // },
  12632. // "sortOrder": {
  12633. // "default": "ASCENDING",
  12634. // "description": "Order of sorted results.",
  12635. // "enum": [
  12636. // "ASCENDING",
  12637. // "DESCENDING"
  12638. // ],
  12639. // "enumDescriptions": [
  12640. // "",
  12641. // ""
  12642. // ],
  12643. // "location": "query",
  12644. // "type": "string"
  12645. // },
  12646. // "subaccountId": {
  12647. // "description": "Select only user profiles with the specified subaccount ID.",
  12648. // "format": "int64",
  12649. // "location": "query",
  12650. // "type": "string"
  12651. // },
  12652. // "userRoleId": {
  12653. // "description": "Select only user profiles with the specified user role ID.",
  12654. // "format": "int64",
  12655. // "location": "query",
  12656. // "type": "string"
  12657. // }
  12658. // },
  12659. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12660. // "response": {
  12661. // "$ref": "AccountUserProfilesListResponse"
  12662. // },
  12663. // "scopes": [
  12664. // "https://www.googleapis.com/auth/dfatrafficking"
  12665. // ]
  12666. // }
  12667. }
  12668. // Pages invokes f for each page of results.
  12669. // A non-nil error returned from f will halt the iteration.
  12670. // The provided context supersedes any context provided to the Context method.
  12671. func (c *AccountUserProfilesListCall) Pages(ctx context.Context, f func(*AccountUserProfilesListResponse) error) error {
  12672. c.ctx_ = ctx
  12673. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  12674. for {
  12675. x, err := c.Do()
  12676. if err != nil {
  12677. return err
  12678. }
  12679. if err := f(x); err != nil {
  12680. return err
  12681. }
  12682. if x.NextPageToken == "" {
  12683. return nil
  12684. }
  12685. c.PageToken(x.NextPageToken)
  12686. }
  12687. }
  12688. // method id "dfareporting.accountUserProfiles.patch":
  12689. type AccountUserProfilesPatchCall struct {
  12690. s *Service
  12691. profileId int64
  12692. accountuserprofile *AccountUserProfile
  12693. urlParams_ gensupport.URLParams
  12694. ctx_ context.Context
  12695. header_ http.Header
  12696. }
  12697. // Patch: Updates an existing account user profile. This method supports
  12698. // patch semantics.
  12699. func (r *AccountUserProfilesService) Patch(profileId int64, id int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesPatchCall {
  12700. c := &AccountUserProfilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12701. c.profileId = profileId
  12702. c.urlParams_.Set("id", fmt.Sprint(id))
  12703. c.accountuserprofile = accountuserprofile
  12704. return c
  12705. }
  12706. // Fields allows partial responses to be retrieved. See
  12707. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12708. // for more information.
  12709. func (c *AccountUserProfilesPatchCall) Fields(s ...googleapi.Field) *AccountUserProfilesPatchCall {
  12710. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12711. return c
  12712. }
  12713. // Context sets the context to be used in this call's Do method. Any
  12714. // pending HTTP request will be aborted if the provided context is
  12715. // canceled.
  12716. func (c *AccountUserProfilesPatchCall) Context(ctx context.Context) *AccountUserProfilesPatchCall {
  12717. c.ctx_ = ctx
  12718. return c
  12719. }
  12720. // Header returns an http.Header that can be modified by the caller to
  12721. // add HTTP headers to the request.
  12722. func (c *AccountUserProfilesPatchCall) Header() http.Header {
  12723. if c.header_ == nil {
  12724. c.header_ = make(http.Header)
  12725. }
  12726. return c.header_
  12727. }
  12728. func (c *AccountUserProfilesPatchCall) doRequest(alt string) (*http.Response, error) {
  12729. reqHeaders := make(http.Header)
  12730. for k, v := range c.header_ {
  12731. reqHeaders[k] = v
  12732. }
  12733. reqHeaders.Set("User-Agent", c.s.userAgent())
  12734. var body io.Reader = nil
  12735. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12736. if err != nil {
  12737. return nil, err
  12738. }
  12739. reqHeaders.Set("Content-Type", "application/json")
  12740. c.urlParams_.Set("alt", alt)
  12741. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12742. urls += "?" + c.urlParams_.Encode()
  12743. req, _ := http.NewRequest("PATCH", urls, body)
  12744. req.Header = reqHeaders
  12745. googleapi.Expand(req.URL, map[string]string{
  12746. "profileId": strconv.FormatInt(c.profileId, 10),
  12747. })
  12748. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12749. }
  12750. // Do executes the "dfareporting.accountUserProfiles.patch" call.
  12751. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12752. // non-2xx status code is an error. Response headers are in either
  12753. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12754. // returned at all) in error.(*googleapi.Error).Header. Use
  12755. // googleapi.IsNotModified to check whether the returned error was
  12756. // because http.StatusNotModified was returned.
  12757. func (c *AccountUserProfilesPatchCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12758. gensupport.SetOptions(c.urlParams_, opts...)
  12759. res, err := c.doRequest("json")
  12760. if res != nil && res.StatusCode == http.StatusNotModified {
  12761. if res.Body != nil {
  12762. res.Body.Close()
  12763. }
  12764. return nil, &googleapi.Error{
  12765. Code: res.StatusCode,
  12766. Header: res.Header,
  12767. }
  12768. }
  12769. if err != nil {
  12770. return nil, err
  12771. }
  12772. defer googleapi.CloseBody(res)
  12773. if err := googleapi.CheckResponse(res); err != nil {
  12774. return nil, err
  12775. }
  12776. ret := &AccountUserProfile{
  12777. ServerResponse: googleapi.ServerResponse{
  12778. Header: res.Header,
  12779. HTTPStatusCode: res.StatusCode,
  12780. },
  12781. }
  12782. target := &ret
  12783. if err := gensupport.DecodeResponse(target, res); err != nil {
  12784. return nil, err
  12785. }
  12786. return ret, nil
  12787. // {
  12788. // "description": "Updates an existing account user profile. This method supports patch semantics.",
  12789. // "httpMethod": "PATCH",
  12790. // "id": "dfareporting.accountUserProfiles.patch",
  12791. // "parameterOrder": [
  12792. // "profileId",
  12793. // "id"
  12794. // ],
  12795. // "parameters": {
  12796. // "id": {
  12797. // "description": "User profile ID.",
  12798. // "format": "int64",
  12799. // "location": "query",
  12800. // "required": true,
  12801. // "type": "string"
  12802. // },
  12803. // "profileId": {
  12804. // "description": "User profile ID associated with this request.",
  12805. // "format": "int64",
  12806. // "location": "path",
  12807. // "required": true,
  12808. // "type": "string"
  12809. // }
  12810. // },
  12811. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12812. // "request": {
  12813. // "$ref": "AccountUserProfile"
  12814. // },
  12815. // "response": {
  12816. // "$ref": "AccountUserProfile"
  12817. // },
  12818. // "scopes": [
  12819. // "https://www.googleapis.com/auth/dfatrafficking"
  12820. // ]
  12821. // }
  12822. }
  12823. // method id "dfareporting.accountUserProfiles.update":
  12824. type AccountUserProfilesUpdateCall struct {
  12825. s *Service
  12826. profileId int64
  12827. accountuserprofile *AccountUserProfile
  12828. urlParams_ gensupport.URLParams
  12829. ctx_ context.Context
  12830. header_ http.Header
  12831. }
  12832. // Update: Updates an existing account user profile.
  12833. func (r *AccountUserProfilesService) Update(profileId int64, accountuserprofile *AccountUserProfile) *AccountUserProfilesUpdateCall {
  12834. c := &AccountUserProfilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12835. c.profileId = profileId
  12836. c.accountuserprofile = accountuserprofile
  12837. return c
  12838. }
  12839. // Fields allows partial responses to be retrieved. See
  12840. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12841. // for more information.
  12842. func (c *AccountUserProfilesUpdateCall) Fields(s ...googleapi.Field) *AccountUserProfilesUpdateCall {
  12843. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12844. return c
  12845. }
  12846. // Context sets the context to be used in this call's Do method. Any
  12847. // pending HTTP request will be aborted if the provided context is
  12848. // canceled.
  12849. func (c *AccountUserProfilesUpdateCall) Context(ctx context.Context) *AccountUserProfilesUpdateCall {
  12850. c.ctx_ = ctx
  12851. return c
  12852. }
  12853. // Header returns an http.Header that can be modified by the caller to
  12854. // add HTTP headers to the request.
  12855. func (c *AccountUserProfilesUpdateCall) Header() http.Header {
  12856. if c.header_ == nil {
  12857. c.header_ = make(http.Header)
  12858. }
  12859. return c.header_
  12860. }
  12861. func (c *AccountUserProfilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  12862. reqHeaders := make(http.Header)
  12863. for k, v := range c.header_ {
  12864. reqHeaders[k] = v
  12865. }
  12866. reqHeaders.Set("User-Agent", c.s.userAgent())
  12867. var body io.Reader = nil
  12868. body, err := googleapi.WithoutDataWrapper.JSONReader(c.accountuserprofile)
  12869. if err != nil {
  12870. return nil, err
  12871. }
  12872. reqHeaders.Set("Content-Type", "application/json")
  12873. c.urlParams_.Set("alt", alt)
  12874. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accountUserProfiles")
  12875. urls += "?" + c.urlParams_.Encode()
  12876. req, _ := http.NewRequest("PUT", urls, body)
  12877. req.Header = reqHeaders
  12878. googleapi.Expand(req.URL, map[string]string{
  12879. "profileId": strconv.FormatInt(c.profileId, 10),
  12880. })
  12881. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12882. }
  12883. // Do executes the "dfareporting.accountUserProfiles.update" call.
  12884. // Exactly one of *AccountUserProfile or error will be non-nil. Any
  12885. // non-2xx status code is an error. Response headers are in either
  12886. // *AccountUserProfile.ServerResponse.Header or (if a response was
  12887. // returned at all) in error.(*googleapi.Error).Header. Use
  12888. // googleapi.IsNotModified to check whether the returned error was
  12889. // because http.StatusNotModified was returned.
  12890. func (c *AccountUserProfilesUpdateCall) Do(opts ...googleapi.CallOption) (*AccountUserProfile, error) {
  12891. gensupport.SetOptions(c.urlParams_, opts...)
  12892. res, err := c.doRequest("json")
  12893. if res != nil && res.StatusCode == http.StatusNotModified {
  12894. if res.Body != nil {
  12895. res.Body.Close()
  12896. }
  12897. return nil, &googleapi.Error{
  12898. Code: res.StatusCode,
  12899. Header: res.Header,
  12900. }
  12901. }
  12902. if err != nil {
  12903. return nil, err
  12904. }
  12905. defer googleapi.CloseBody(res)
  12906. if err := googleapi.CheckResponse(res); err != nil {
  12907. return nil, err
  12908. }
  12909. ret := &AccountUserProfile{
  12910. ServerResponse: googleapi.ServerResponse{
  12911. Header: res.Header,
  12912. HTTPStatusCode: res.StatusCode,
  12913. },
  12914. }
  12915. target := &ret
  12916. if err := gensupport.DecodeResponse(target, res); err != nil {
  12917. return nil, err
  12918. }
  12919. return ret, nil
  12920. // {
  12921. // "description": "Updates an existing account user profile.",
  12922. // "httpMethod": "PUT",
  12923. // "id": "dfareporting.accountUserProfiles.update",
  12924. // "parameterOrder": [
  12925. // "profileId"
  12926. // ],
  12927. // "parameters": {
  12928. // "profileId": {
  12929. // "description": "User profile ID associated with this request.",
  12930. // "format": "int64",
  12931. // "location": "path",
  12932. // "required": true,
  12933. // "type": "string"
  12934. // }
  12935. // },
  12936. // "path": "userprofiles/{profileId}/accountUserProfiles",
  12937. // "request": {
  12938. // "$ref": "AccountUserProfile"
  12939. // },
  12940. // "response": {
  12941. // "$ref": "AccountUserProfile"
  12942. // },
  12943. // "scopes": [
  12944. // "https://www.googleapis.com/auth/dfatrafficking"
  12945. // ]
  12946. // }
  12947. }
  12948. // method id "dfareporting.accounts.get":
  12949. type AccountsGetCall struct {
  12950. s *Service
  12951. profileId int64
  12952. id int64
  12953. urlParams_ gensupport.URLParams
  12954. ifNoneMatch_ string
  12955. ctx_ context.Context
  12956. header_ http.Header
  12957. }
  12958. // Get: Gets one account by ID.
  12959. func (r *AccountsService) Get(profileId int64, id int64) *AccountsGetCall {
  12960. c := &AccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12961. c.profileId = profileId
  12962. c.id = id
  12963. return c
  12964. }
  12965. // Fields allows partial responses to be retrieved. See
  12966. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12967. // for more information.
  12968. func (c *AccountsGetCall) Fields(s ...googleapi.Field) *AccountsGetCall {
  12969. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12970. return c
  12971. }
  12972. // IfNoneMatch sets the optional parameter which makes the operation
  12973. // fail if the object's ETag matches the given value. This is useful for
  12974. // getting updates only after the object has changed since the last
  12975. // request. Use googleapi.IsNotModified to check whether the response
  12976. // error from Do is the result of In-None-Match.
  12977. func (c *AccountsGetCall) IfNoneMatch(entityTag string) *AccountsGetCall {
  12978. c.ifNoneMatch_ = entityTag
  12979. return c
  12980. }
  12981. // Context sets the context to be used in this call's Do method. Any
  12982. // pending HTTP request will be aborted if the provided context is
  12983. // canceled.
  12984. func (c *AccountsGetCall) Context(ctx context.Context) *AccountsGetCall {
  12985. c.ctx_ = ctx
  12986. return c
  12987. }
  12988. // Header returns an http.Header that can be modified by the caller to
  12989. // add HTTP headers to the request.
  12990. func (c *AccountsGetCall) Header() http.Header {
  12991. if c.header_ == nil {
  12992. c.header_ = make(http.Header)
  12993. }
  12994. return c.header_
  12995. }
  12996. func (c *AccountsGetCall) doRequest(alt string) (*http.Response, error) {
  12997. reqHeaders := make(http.Header)
  12998. for k, v := range c.header_ {
  12999. reqHeaders[k] = v
  13000. }
  13001. reqHeaders.Set("User-Agent", c.s.userAgent())
  13002. if c.ifNoneMatch_ != "" {
  13003. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13004. }
  13005. var body io.Reader = nil
  13006. c.urlParams_.Set("alt", alt)
  13007. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts/{id}")
  13008. urls += "?" + c.urlParams_.Encode()
  13009. req, _ := http.NewRequest("GET", urls, body)
  13010. req.Header = reqHeaders
  13011. googleapi.Expand(req.URL, map[string]string{
  13012. "profileId": strconv.FormatInt(c.profileId, 10),
  13013. "id": strconv.FormatInt(c.id, 10),
  13014. })
  13015. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13016. }
  13017. // Do executes the "dfareporting.accounts.get" call.
  13018. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13019. // code is an error. Response headers are in either
  13020. // *Account.ServerResponse.Header or (if a response was returned at all)
  13021. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13022. // check whether the returned error was because http.StatusNotModified
  13023. // was returned.
  13024. func (c *AccountsGetCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13025. gensupport.SetOptions(c.urlParams_, opts...)
  13026. res, err := c.doRequest("json")
  13027. if res != nil && res.StatusCode == http.StatusNotModified {
  13028. if res.Body != nil {
  13029. res.Body.Close()
  13030. }
  13031. return nil, &googleapi.Error{
  13032. Code: res.StatusCode,
  13033. Header: res.Header,
  13034. }
  13035. }
  13036. if err != nil {
  13037. return nil, err
  13038. }
  13039. defer googleapi.CloseBody(res)
  13040. if err := googleapi.CheckResponse(res); err != nil {
  13041. return nil, err
  13042. }
  13043. ret := &Account{
  13044. ServerResponse: googleapi.ServerResponse{
  13045. Header: res.Header,
  13046. HTTPStatusCode: res.StatusCode,
  13047. },
  13048. }
  13049. target := &ret
  13050. if err := gensupport.DecodeResponse(target, res); err != nil {
  13051. return nil, err
  13052. }
  13053. return ret, nil
  13054. // {
  13055. // "description": "Gets one account by ID.",
  13056. // "httpMethod": "GET",
  13057. // "id": "dfareporting.accounts.get",
  13058. // "parameterOrder": [
  13059. // "profileId",
  13060. // "id"
  13061. // ],
  13062. // "parameters": {
  13063. // "id": {
  13064. // "description": "Account ID.",
  13065. // "format": "int64",
  13066. // "location": "path",
  13067. // "required": true,
  13068. // "type": "string"
  13069. // },
  13070. // "profileId": {
  13071. // "description": "User profile ID associated with this request.",
  13072. // "format": "int64",
  13073. // "location": "path",
  13074. // "required": true,
  13075. // "type": "string"
  13076. // }
  13077. // },
  13078. // "path": "userprofiles/{profileId}/accounts/{id}",
  13079. // "response": {
  13080. // "$ref": "Account"
  13081. // },
  13082. // "scopes": [
  13083. // "https://www.googleapis.com/auth/dfatrafficking"
  13084. // ]
  13085. // }
  13086. }
  13087. // method id "dfareporting.accounts.list":
  13088. type AccountsListCall struct {
  13089. s *Service
  13090. profileId int64
  13091. urlParams_ gensupport.URLParams
  13092. ifNoneMatch_ string
  13093. ctx_ context.Context
  13094. header_ http.Header
  13095. }
  13096. // List: Retrieves the list of accounts, possibly filtered. This method
  13097. // supports paging.
  13098. func (r *AccountsService) List(profileId int64) *AccountsListCall {
  13099. c := &AccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13100. c.profileId = profileId
  13101. return c
  13102. }
  13103. // Active sets the optional parameter "active": Select only active
  13104. // accounts. Don't set this field to select both active and non-active
  13105. // accounts.
  13106. func (c *AccountsListCall) Active(active bool) *AccountsListCall {
  13107. c.urlParams_.Set("active", fmt.Sprint(active))
  13108. return c
  13109. }
  13110. // Ids sets the optional parameter "ids": Select only accounts with
  13111. // these IDs.
  13112. func (c *AccountsListCall) Ids(ids ...int64) *AccountsListCall {
  13113. var ids_ []string
  13114. for _, v := range ids {
  13115. ids_ = append(ids_, fmt.Sprint(v))
  13116. }
  13117. c.urlParams_.SetMulti("ids", ids_)
  13118. return c
  13119. }
  13120. // MaxResults sets the optional parameter "maxResults": Maximum number
  13121. // of results to return.
  13122. func (c *AccountsListCall) MaxResults(maxResults int64) *AccountsListCall {
  13123. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  13124. return c
  13125. }
  13126. // PageToken sets the optional parameter "pageToken": Value of the
  13127. // nextPageToken from the previous result page.
  13128. func (c *AccountsListCall) PageToken(pageToken string) *AccountsListCall {
  13129. c.urlParams_.Set("pageToken", pageToken)
  13130. return c
  13131. }
  13132. // SearchString sets the optional parameter "searchString": Allows
  13133. // searching for objects by name or ID. Wildcards (*) are allowed. For
  13134. // example, "account*2015" will return objects with names like "account
  13135. // June 2015", "account April 2015", or simply "account 2015". Most of
  13136. // the searches also add wildcards implicitly at the start and the end
  13137. // of the search string. For example, a search string of "account" will
  13138. // match objects with name "my account", "account 2015", or simply
  13139. // "account".
  13140. func (c *AccountsListCall) SearchString(searchString string) *AccountsListCall {
  13141. c.urlParams_.Set("searchString", searchString)
  13142. return c
  13143. }
  13144. // SortField sets the optional parameter "sortField": Field by which to
  13145. // sort the list.
  13146. //
  13147. // Possible values:
  13148. // "ID" (default)
  13149. // "NAME"
  13150. func (c *AccountsListCall) SortField(sortField string) *AccountsListCall {
  13151. c.urlParams_.Set("sortField", sortField)
  13152. return c
  13153. }
  13154. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  13155. // results.
  13156. //
  13157. // Possible values:
  13158. // "ASCENDING" (default)
  13159. // "DESCENDING"
  13160. func (c *AccountsListCall) SortOrder(sortOrder string) *AccountsListCall {
  13161. c.urlParams_.Set("sortOrder", sortOrder)
  13162. return c
  13163. }
  13164. // Fields allows partial responses to be retrieved. See
  13165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13166. // for more information.
  13167. func (c *AccountsListCall) Fields(s ...googleapi.Field) *AccountsListCall {
  13168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13169. return c
  13170. }
  13171. // IfNoneMatch sets the optional parameter which makes the operation
  13172. // fail if the object's ETag matches the given value. This is useful for
  13173. // getting updates only after the object has changed since the last
  13174. // request. Use googleapi.IsNotModified to check whether the response
  13175. // error from Do is the result of In-None-Match.
  13176. func (c *AccountsListCall) IfNoneMatch(entityTag string) *AccountsListCall {
  13177. c.ifNoneMatch_ = entityTag
  13178. return c
  13179. }
  13180. // Context sets the context to be used in this call's Do method. Any
  13181. // pending HTTP request will be aborted if the provided context is
  13182. // canceled.
  13183. func (c *AccountsListCall) Context(ctx context.Context) *AccountsListCall {
  13184. c.ctx_ = ctx
  13185. return c
  13186. }
  13187. // Header returns an http.Header that can be modified by the caller to
  13188. // add HTTP headers to the request.
  13189. func (c *AccountsListCall) Header() http.Header {
  13190. if c.header_ == nil {
  13191. c.header_ = make(http.Header)
  13192. }
  13193. return c.header_
  13194. }
  13195. func (c *AccountsListCall) doRequest(alt string) (*http.Response, error) {
  13196. reqHeaders := make(http.Header)
  13197. for k, v := range c.header_ {
  13198. reqHeaders[k] = v
  13199. }
  13200. reqHeaders.Set("User-Agent", c.s.userAgent())
  13201. if c.ifNoneMatch_ != "" {
  13202. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13203. }
  13204. var body io.Reader = nil
  13205. c.urlParams_.Set("alt", alt)
  13206. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13207. urls += "?" + c.urlParams_.Encode()
  13208. req, _ := http.NewRequest("GET", urls, body)
  13209. req.Header = reqHeaders
  13210. googleapi.Expand(req.URL, map[string]string{
  13211. "profileId": strconv.FormatInt(c.profileId, 10),
  13212. })
  13213. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13214. }
  13215. // Do executes the "dfareporting.accounts.list" call.
  13216. // Exactly one of *AccountsListResponse or error will be non-nil. Any
  13217. // non-2xx status code is an error. Response headers are in either
  13218. // *AccountsListResponse.ServerResponse.Header or (if a response was
  13219. // returned at all) in error.(*googleapi.Error).Header. Use
  13220. // googleapi.IsNotModified to check whether the returned error was
  13221. // because http.StatusNotModified was returned.
  13222. func (c *AccountsListCall) Do(opts ...googleapi.CallOption) (*AccountsListResponse, error) {
  13223. gensupport.SetOptions(c.urlParams_, opts...)
  13224. res, err := c.doRequest("json")
  13225. if res != nil && res.StatusCode == http.StatusNotModified {
  13226. if res.Body != nil {
  13227. res.Body.Close()
  13228. }
  13229. return nil, &googleapi.Error{
  13230. Code: res.StatusCode,
  13231. Header: res.Header,
  13232. }
  13233. }
  13234. if err != nil {
  13235. return nil, err
  13236. }
  13237. defer googleapi.CloseBody(res)
  13238. if err := googleapi.CheckResponse(res); err != nil {
  13239. return nil, err
  13240. }
  13241. ret := &AccountsListResponse{
  13242. ServerResponse: googleapi.ServerResponse{
  13243. Header: res.Header,
  13244. HTTPStatusCode: res.StatusCode,
  13245. },
  13246. }
  13247. target := &ret
  13248. if err := gensupport.DecodeResponse(target, res); err != nil {
  13249. return nil, err
  13250. }
  13251. return ret, nil
  13252. // {
  13253. // "description": "Retrieves the list of accounts, possibly filtered. This method supports paging.",
  13254. // "httpMethod": "GET",
  13255. // "id": "dfareporting.accounts.list",
  13256. // "parameterOrder": [
  13257. // "profileId"
  13258. // ],
  13259. // "parameters": {
  13260. // "active": {
  13261. // "description": "Select only active accounts. Don't set this field to select both active and non-active accounts.",
  13262. // "location": "query",
  13263. // "type": "boolean"
  13264. // },
  13265. // "ids": {
  13266. // "description": "Select only accounts with these IDs.",
  13267. // "format": "int64",
  13268. // "location": "query",
  13269. // "repeated": true,
  13270. // "type": "string"
  13271. // },
  13272. // "maxResults": {
  13273. // "default": "1000",
  13274. // "description": "Maximum number of results to return.",
  13275. // "format": "int32",
  13276. // "location": "query",
  13277. // "maximum": "1000",
  13278. // "minimum": "0",
  13279. // "type": "integer"
  13280. // },
  13281. // "pageToken": {
  13282. // "description": "Value of the nextPageToken from the previous result page.",
  13283. // "location": "query",
  13284. // "type": "string"
  13285. // },
  13286. // "profileId": {
  13287. // "description": "User profile ID associated with this request.",
  13288. // "format": "int64",
  13289. // "location": "path",
  13290. // "required": true,
  13291. // "type": "string"
  13292. // },
  13293. // "searchString": {
  13294. // "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\".",
  13295. // "location": "query",
  13296. // "type": "string"
  13297. // },
  13298. // "sortField": {
  13299. // "default": "ID",
  13300. // "description": "Field by which to sort the list.",
  13301. // "enum": [
  13302. // "ID",
  13303. // "NAME"
  13304. // ],
  13305. // "enumDescriptions": [
  13306. // "",
  13307. // ""
  13308. // ],
  13309. // "location": "query",
  13310. // "type": "string"
  13311. // },
  13312. // "sortOrder": {
  13313. // "default": "ASCENDING",
  13314. // "description": "Order of sorted results.",
  13315. // "enum": [
  13316. // "ASCENDING",
  13317. // "DESCENDING"
  13318. // ],
  13319. // "enumDescriptions": [
  13320. // "",
  13321. // ""
  13322. // ],
  13323. // "location": "query",
  13324. // "type": "string"
  13325. // }
  13326. // },
  13327. // "path": "userprofiles/{profileId}/accounts",
  13328. // "response": {
  13329. // "$ref": "AccountsListResponse"
  13330. // },
  13331. // "scopes": [
  13332. // "https://www.googleapis.com/auth/dfatrafficking"
  13333. // ]
  13334. // }
  13335. }
  13336. // Pages invokes f for each page of results.
  13337. // A non-nil error returned from f will halt the iteration.
  13338. // The provided context supersedes any context provided to the Context method.
  13339. func (c *AccountsListCall) Pages(ctx context.Context, f func(*AccountsListResponse) error) error {
  13340. c.ctx_ = ctx
  13341. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  13342. for {
  13343. x, err := c.Do()
  13344. if err != nil {
  13345. return err
  13346. }
  13347. if err := f(x); err != nil {
  13348. return err
  13349. }
  13350. if x.NextPageToken == "" {
  13351. return nil
  13352. }
  13353. c.PageToken(x.NextPageToken)
  13354. }
  13355. }
  13356. // method id "dfareporting.accounts.patch":
  13357. type AccountsPatchCall struct {
  13358. s *Service
  13359. profileId int64
  13360. account *Account
  13361. urlParams_ gensupport.URLParams
  13362. ctx_ context.Context
  13363. header_ http.Header
  13364. }
  13365. // Patch: Updates an existing account. This method supports patch
  13366. // semantics.
  13367. func (r *AccountsService) Patch(profileId int64, id int64, account *Account) *AccountsPatchCall {
  13368. c := &AccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13369. c.profileId = profileId
  13370. c.urlParams_.Set("id", fmt.Sprint(id))
  13371. c.account = account
  13372. return c
  13373. }
  13374. // Fields allows partial responses to be retrieved. See
  13375. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13376. // for more information.
  13377. func (c *AccountsPatchCall) Fields(s ...googleapi.Field) *AccountsPatchCall {
  13378. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13379. return c
  13380. }
  13381. // Context sets the context to be used in this call's Do method. Any
  13382. // pending HTTP request will be aborted if the provided context is
  13383. // canceled.
  13384. func (c *AccountsPatchCall) Context(ctx context.Context) *AccountsPatchCall {
  13385. c.ctx_ = ctx
  13386. return c
  13387. }
  13388. // Header returns an http.Header that can be modified by the caller to
  13389. // add HTTP headers to the request.
  13390. func (c *AccountsPatchCall) Header() http.Header {
  13391. if c.header_ == nil {
  13392. c.header_ = make(http.Header)
  13393. }
  13394. return c.header_
  13395. }
  13396. func (c *AccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  13397. reqHeaders := make(http.Header)
  13398. for k, v := range c.header_ {
  13399. reqHeaders[k] = v
  13400. }
  13401. reqHeaders.Set("User-Agent", c.s.userAgent())
  13402. var body io.Reader = nil
  13403. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13404. if err != nil {
  13405. return nil, err
  13406. }
  13407. reqHeaders.Set("Content-Type", "application/json")
  13408. c.urlParams_.Set("alt", alt)
  13409. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13410. urls += "?" + c.urlParams_.Encode()
  13411. req, _ := http.NewRequest("PATCH", urls, body)
  13412. req.Header = reqHeaders
  13413. googleapi.Expand(req.URL, map[string]string{
  13414. "profileId": strconv.FormatInt(c.profileId, 10),
  13415. })
  13416. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13417. }
  13418. // Do executes the "dfareporting.accounts.patch" call.
  13419. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13420. // code is an error. Response headers are in either
  13421. // *Account.ServerResponse.Header or (if a response was returned at all)
  13422. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13423. // check whether the returned error was because http.StatusNotModified
  13424. // was returned.
  13425. func (c *AccountsPatchCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13426. gensupport.SetOptions(c.urlParams_, opts...)
  13427. res, err := c.doRequest("json")
  13428. if res != nil && res.StatusCode == http.StatusNotModified {
  13429. if res.Body != nil {
  13430. res.Body.Close()
  13431. }
  13432. return nil, &googleapi.Error{
  13433. Code: res.StatusCode,
  13434. Header: res.Header,
  13435. }
  13436. }
  13437. if err != nil {
  13438. return nil, err
  13439. }
  13440. defer googleapi.CloseBody(res)
  13441. if err := googleapi.CheckResponse(res); err != nil {
  13442. return nil, err
  13443. }
  13444. ret := &Account{
  13445. ServerResponse: googleapi.ServerResponse{
  13446. Header: res.Header,
  13447. HTTPStatusCode: res.StatusCode,
  13448. },
  13449. }
  13450. target := &ret
  13451. if err := gensupport.DecodeResponse(target, res); err != nil {
  13452. return nil, err
  13453. }
  13454. return ret, nil
  13455. // {
  13456. // "description": "Updates an existing account. This method supports patch semantics.",
  13457. // "httpMethod": "PATCH",
  13458. // "id": "dfareporting.accounts.patch",
  13459. // "parameterOrder": [
  13460. // "profileId",
  13461. // "id"
  13462. // ],
  13463. // "parameters": {
  13464. // "id": {
  13465. // "description": "Account ID.",
  13466. // "format": "int64",
  13467. // "location": "query",
  13468. // "required": true,
  13469. // "type": "string"
  13470. // },
  13471. // "profileId": {
  13472. // "description": "User profile ID associated with this request.",
  13473. // "format": "int64",
  13474. // "location": "path",
  13475. // "required": true,
  13476. // "type": "string"
  13477. // }
  13478. // },
  13479. // "path": "userprofiles/{profileId}/accounts",
  13480. // "request": {
  13481. // "$ref": "Account"
  13482. // },
  13483. // "response": {
  13484. // "$ref": "Account"
  13485. // },
  13486. // "scopes": [
  13487. // "https://www.googleapis.com/auth/dfatrafficking"
  13488. // ]
  13489. // }
  13490. }
  13491. // method id "dfareporting.accounts.update":
  13492. type AccountsUpdateCall struct {
  13493. s *Service
  13494. profileId int64
  13495. account *Account
  13496. urlParams_ gensupport.URLParams
  13497. ctx_ context.Context
  13498. header_ http.Header
  13499. }
  13500. // Update: Updates an existing account.
  13501. func (r *AccountsService) Update(profileId int64, account *Account) *AccountsUpdateCall {
  13502. c := &AccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13503. c.profileId = profileId
  13504. c.account = account
  13505. return c
  13506. }
  13507. // Fields allows partial responses to be retrieved. See
  13508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13509. // for more information.
  13510. func (c *AccountsUpdateCall) Fields(s ...googleapi.Field) *AccountsUpdateCall {
  13511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13512. return c
  13513. }
  13514. // Context sets the context to be used in this call's Do method. Any
  13515. // pending HTTP request will be aborted if the provided context is
  13516. // canceled.
  13517. func (c *AccountsUpdateCall) Context(ctx context.Context) *AccountsUpdateCall {
  13518. c.ctx_ = ctx
  13519. return c
  13520. }
  13521. // Header returns an http.Header that can be modified by the caller to
  13522. // add HTTP headers to the request.
  13523. func (c *AccountsUpdateCall) Header() http.Header {
  13524. if c.header_ == nil {
  13525. c.header_ = make(http.Header)
  13526. }
  13527. return c.header_
  13528. }
  13529. func (c *AccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  13530. reqHeaders := make(http.Header)
  13531. for k, v := range c.header_ {
  13532. reqHeaders[k] = v
  13533. }
  13534. reqHeaders.Set("User-Agent", c.s.userAgent())
  13535. var body io.Reader = nil
  13536. body, err := googleapi.WithoutDataWrapper.JSONReader(c.account)
  13537. if err != nil {
  13538. return nil, err
  13539. }
  13540. reqHeaders.Set("Content-Type", "application/json")
  13541. c.urlParams_.Set("alt", alt)
  13542. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/accounts")
  13543. urls += "?" + c.urlParams_.Encode()
  13544. req, _ := http.NewRequest("PUT", urls, body)
  13545. req.Header = reqHeaders
  13546. googleapi.Expand(req.URL, map[string]string{
  13547. "profileId": strconv.FormatInt(c.profileId, 10),
  13548. })
  13549. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13550. }
  13551. // Do executes the "dfareporting.accounts.update" call.
  13552. // Exactly one of *Account or error will be non-nil. Any non-2xx status
  13553. // code is an error. Response headers are in either
  13554. // *Account.ServerResponse.Header or (if a response was returned at all)
  13555. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  13556. // check whether the returned error was because http.StatusNotModified
  13557. // was returned.
  13558. func (c *AccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Account, error) {
  13559. gensupport.SetOptions(c.urlParams_, opts...)
  13560. res, err := c.doRequest("json")
  13561. if res != nil && res.StatusCode == http.StatusNotModified {
  13562. if res.Body != nil {
  13563. res.Body.Close()
  13564. }
  13565. return nil, &googleapi.Error{
  13566. Code: res.StatusCode,
  13567. Header: res.Header,
  13568. }
  13569. }
  13570. if err != nil {
  13571. return nil, err
  13572. }
  13573. defer googleapi.CloseBody(res)
  13574. if err := googleapi.CheckResponse(res); err != nil {
  13575. return nil, err
  13576. }
  13577. ret := &Account{
  13578. ServerResponse: googleapi.ServerResponse{
  13579. Header: res.Header,
  13580. HTTPStatusCode: res.StatusCode,
  13581. },
  13582. }
  13583. target := &ret
  13584. if err := gensupport.DecodeResponse(target, res); err != nil {
  13585. return nil, err
  13586. }
  13587. return ret, nil
  13588. // {
  13589. // "description": "Updates an existing account.",
  13590. // "httpMethod": "PUT",
  13591. // "id": "dfareporting.accounts.update",
  13592. // "parameterOrder": [
  13593. // "profileId"
  13594. // ],
  13595. // "parameters": {
  13596. // "profileId": {
  13597. // "description": "User profile ID associated with this request.",
  13598. // "format": "int64",
  13599. // "location": "path",
  13600. // "required": true,
  13601. // "type": "string"
  13602. // }
  13603. // },
  13604. // "path": "userprofiles/{profileId}/accounts",
  13605. // "request": {
  13606. // "$ref": "Account"
  13607. // },
  13608. // "response": {
  13609. // "$ref": "Account"
  13610. // },
  13611. // "scopes": [
  13612. // "https://www.googleapis.com/auth/dfatrafficking"
  13613. // ]
  13614. // }
  13615. }
  13616. // method id "dfareporting.ads.get":
  13617. type AdsGetCall struct {
  13618. s *Service
  13619. profileId int64
  13620. id int64
  13621. urlParams_ gensupport.URLParams
  13622. ifNoneMatch_ string
  13623. ctx_ context.Context
  13624. header_ http.Header
  13625. }
  13626. // Get: Gets one ad by ID.
  13627. func (r *AdsService) Get(profileId int64, id int64) *AdsGetCall {
  13628. c := &AdsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13629. c.profileId = profileId
  13630. c.id = id
  13631. return c
  13632. }
  13633. // Fields allows partial responses to be retrieved. See
  13634. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13635. // for more information.
  13636. func (c *AdsGetCall) Fields(s ...googleapi.Field) *AdsGetCall {
  13637. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13638. return c
  13639. }
  13640. // IfNoneMatch sets the optional parameter which makes the operation
  13641. // fail if the object's ETag matches the given value. This is useful for
  13642. // getting updates only after the object has changed since the last
  13643. // request. Use googleapi.IsNotModified to check whether the response
  13644. // error from Do is the result of In-None-Match.
  13645. func (c *AdsGetCall) IfNoneMatch(entityTag string) *AdsGetCall {
  13646. c.ifNoneMatch_ = entityTag
  13647. return c
  13648. }
  13649. // Context sets the context to be used in this call's Do method. Any
  13650. // pending HTTP request will be aborted if the provided context is
  13651. // canceled.
  13652. func (c *AdsGetCall) Context(ctx context.Context) *AdsGetCall {
  13653. c.ctx_ = ctx
  13654. return c
  13655. }
  13656. // Header returns an http.Header that can be modified by the caller to
  13657. // add HTTP headers to the request.
  13658. func (c *AdsGetCall) Header() http.Header {
  13659. if c.header_ == nil {
  13660. c.header_ = make(http.Header)
  13661. }
  13662. return c.header_
  13663. }
  13664. func (c *AdsGetCall) doRequest(alt string) (*http.Response, error) {
  13665. reqHeaders := make(http.Header)
  13666. for k, v := range c.header_ {
  13667. reqHeaders[k] = v
  13668. }
  13669. reqHeaders.Set("User-Agent", c.s.userAgent())
  13670. if c.ifNoneMatch_ != "" {
  13671. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  13672. }
  13673. var body io.Reader = nil
  13674. c.urlParams_.Set("alt", alt)
  13675. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads/{id}")
  13676. urls += "?" + c.urlParams_.Encode()
  13677. req, _ := http.NewRequest("GET", urls, body)
  13678. req.Header = reqHeaders
  13679. googleapi.Expand(req.URL, map[string]string{
  13680. "profileId": strconv.FormatInt(c.profileId, 10),
  13681. "id": strconv.FormatInt(c.id, 10),
  13682. })
  13683. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13684. }
  13685. // Do executes the "dfareporting.ads.get" call.
  13686. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  13687. // is an error. Response headers are in either *Ad.ServerResponse.Header
  13688. // or (if a response was returned at all) in
  13689. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13690. // whether the returned error was because http.StatusNotModified was
  13691. // returned.
  13692. func (c *AdsGetCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  13693. gensupport.SetOptions(c.urlParams_, opts...)
  13694. res, err := c.doRequest("json")
  13695. if res != nil && res.StatusCode == http.StatusNotModified {
  13696. if res.Body != nil {
  13697. res.Body.Close()
  13698. }
  13699. return nil, &googleapi.Error{
  13700. Code: res.StatusCode,
  13701. Header: res.Header,
  13702. }
  13703. }
  13704. if err != nil {
  13705. return nil, err
  13706. }
  13707. defer googleapi.CloseBody(res)
  13708. if err := googleapi.CheckResponse(res); err != nil {
  13709. return nil, err
  13710. }
  13711. ret := &Ad{
  13712. ServerResponse: googleapi.ServerResponse{
  13713. Header: res.Header,
  13714. HTTPStatusCode: res.StatusCode,
  13715. },
  13716. }
  13717. target := &ret
  13718. if err := gensupport.DecodeResponse(target, res); err != nil {
  13719. return nil, err
  13720. }
  13721. return ret, nil
  13722. // {
  13723. // "description": "Gets one ad by ID.",
  13724. // "httpMethod": "GET",
  13725. // "id": "dfareporting.ads.get",
  13726. // "parameterOrder": [
  13727. // "profileId",
  13728. // "id"
  13729. // ],
  13730. // "parameters": {
  13731. // "id": {
  13732. // "description": "Ad ID.",
  13733. // "format": "int64",
  13734. // "location": "path",
  13735. // "required": true,
  13736. // "type": "string"
  13737. // },
  13738. // "profileId": {
  13739. // "description": "User profile ID associated with this request.",
  13740. // "format": "int64",
  13741. // "location": "path",
  13742. // "required": true,
  13743. // "type": "string"
  13744. // }
  13745. // },
  13746. // "path": "userprofiles/{profileId}/ads/{id}",
  13747. // "response": {
  13748. // "$ref": "Ad"
  13749. // },
  13750. // "scopes": [
  13751. // "https://www.googleapis.com/auth/dfatrafficking"
  13752. // ]
  13753. // }
  13754. }
  13755. // method id "dfareporting.ads.insert":
  13756. type AdsInsertCall struct {
  13757. s *Service
  13758. profileId int64
  13759. ad *Ad
  13760. urlParams_ gensupport.URLParams
  13761. ctx_ context.Context
  13762. header_ http.Header
  13763. }
  13764. // Insert: Inserts a new ad.
  13765. func (r *AdsService) Insert(profileId int64, ad *Ad) *AdsInsertCall {
  13766. c := &AdsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13767. c.profileId = profileId
  13768. c.ad = ad
  13769. return c
  13770. }
  13771. // Fields allows partial responses to be retrieved. See
  13772. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  13773. // for more information.
  13774. func (c *AdsInsertCall) Fields(s ...googleapi.Field) *AdsInsertCall {
  13775. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  13776. return c
  13777. }
  13778. // Context sets the context to be used in this call's Do method. Any
  13779. // pending HTTP request will be aborted if the provided context is
  13780. // canceled.
  13781. func (c *AdsInsertCall) Context(ctx context.Context) *AdsInsertCall {
  13782. c.ctx_ = ctx
  13783. return c
  13784. }
  13785. // Header returns an http.Header that can be modified by the caller to
  13786. // add HTTP headers to the request.
  13787. func (c *AdsInsertCall) Header() http.Header {
  13788. if c.header_ == nil {
  13789. c.header_ = make(http.Header)
  13790. }
  13791. return c.header_
  13792. }
  13793. func (c *AdsInsertCall) doRequest(alt string) (*http.Response, error) {
  13794. reqHeaders := make(http.Header)
  13795. for k, v := range c.header_ {
  13796. reqHeaders[k] = v
  13797. }
  13798. reqHeaders.Set("User-Agent", c.s.userAgent())
  13799. var body io.Reader = nil
  13800. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  13801. if err != nil {
  13802. return nil, err
  13803. }
  13804. reqHeaders.Set("Content-Type", "application/json")
  13805. c.urlParams_.Set("alt", alt)
  13806. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  13807. urls += "?" + c.urlParams_.Encode()
  13808. req, _ := http.NewRequest("POST", urls, body)
  13809. req.Header = reqHeaders
  13810. googleapi.Expand(req.URL, map[string]string{
  13811. "profileId": strconv.FormatInt(c.profileId, 10),
  13812. })
  13813. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  13814. }
  13815. // Do executes the "dfareporting.ads.insert" call.
  13816. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  13817. // is an error. Response headers are in either *Ad.ServerResponse.Header
  13818. // or (if a response was returned at all) in
  13819. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  13820. // whether the returned error was because http.StatusNotModified was
  13821. // returned.
  13822. func (c *AdsInsertCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  13823. gensupport.SetOptions(c.urlParams_, opts...)
  13824. res, err := c.doRequest("json")
  13825. if res != nil && res.StatusCode == http.StatusNotModified {
  13826. if res.Body != nil {
  13827. res.Body.Close()
  13828. }
  13829. return nil, &googleapi.Error{
  13830. Code: res.StatusCode,
  13831. Header: res.Header,
  13832. }
  13833. }
  13834. if err != nil {
  13835. return nil, err
  13836. }
  13837. defer googleapi.CloseBody(res)
  13838. if err := googleapi.CheckResponse(res); err != nil {
  13839. return nil, err
  13840. }
  13841. ret := &Ad{
  13842. ServerResponse: googleapi.ServerResponse{
  13843. Header: res.Header,
  13844. HTTPStatusCode: res.StatusCode,
  13845. },
  13846. }
  13847. target := &ret
  13848. if err := gensupport.DecodeResponse(target, res); err != nil {
  13849. return nil, err
  13850. }
  13851. return ret, nil
  13852. // {
  13853. // "description": "Inserts a new ad.",
  13854. // "httpMethod": "POST",
  13855. // "id": "dfareporting.ads.insert",
  13856. // "parameterOrder": [
  13857. // "profileId"
  13858. // ],
  13859. // "parameters": {
  13860. // "profileId": {
  13861. // "description": "User profile ID associated with this request.",
  13862. // "format": "int64",
  13863. // "location": "path",
  13864. // "required": true,
  13865. // "type": "string"
  13866. // }
  13867. // },
  13868. // "path": "userprofiles/{profileId}/ads",
  13869. // "request": {
  13870. // "$ref": "Ad"
  13871. // },
  13872. // "response": {
  13873. // "$ref": "Ad"
  13874. // },
  13875. // "scopes": [
  13876. // "https://www.googleapis.com/auth/dfatrafficking"
  13877. // ]
  13878. // }
  13879. }
  13880. // method id "dfareporting.ads.list":
  13881. type AdsListCall struct {
  13882. s *Service
  13883. profileId int64
  13884. urlParams_ gensupport.URLParams
  13885. ifNoneMatch_ string
  13886. ctx_ context.Context
  13887. header_ http.Header
  13888. }
  13889. // List: Retrieves a list of ads, possibly filtered. This method
  13890. // supports paging.
  13891. func (r *AdsService) List(profileId int64) *AdsListCall {
  13892. c := &AdsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  13893. c.profileId = profileId
  13894. return c
  13895. }
  13896. // Active sets the optional parameter "active": Select only active ads.
  13897. func (c *AdsListCall) Active(active bool) *AdsListCall {
  13898. c.urlParams_.Set("active", fmt.Sprint(active))
  13899. return c
  13900. }
  13901. // AdvertiserId sets the optional parameter "advertiserId": Select only
  13902. // ads with this advertiser ID.
  13903. func (c *AdsListCall) AdvertiserId(advertiserId int64) *AdsListCall {
  13904. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  13905. return c
  13906. }
  13907. // Archived sets the optional parameter "archived": Select only archived
  13908. // ads.
  13909. func (c *AdsListCall) Archived(archived bool) *AdsListCall {
  13910. c.urlParams_.Set("archived", fmt.Sprint(archived))
  13911. return c
  13912. }
  13913. // AudienceSegmentIds sets the optional parameter "audienceSegmentIds":
  13914. // Select only ads with these audience segment IDs.
  13915. func (c *AdsListCall) AudienceSegmentIds(audienceSegmentIds ...int64) *AdsListCall {
  13916. var audienceSegmentIds_ []string
  13917. for _, v := range audienceSegmentIds {
  13918. audienceSegmentIds_ = append(audienceSegmentIds_, fmt.Sprint(v))
  13919. }
  13920. c.urlParams_.SetMulti("audienceSegmentIds", audienceSegmentIds_)
  13921. return c
  13922. }
  13923. // CampaignIds sets the optional parameter "campaignIds": Select only
  13924. // ads with these campaign IDs.
  13925. func (c *AdsListCall) CampaignIds(campaignIds ...int64) *AdsListCall {
  13926. var campaignIds_ []string
  13927. for _, v := range campaignIds {
  13928. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  13929. }
  13930. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  13931. return c
  13932. }
  13933. // Compatibility sets the optional parameter "compatibility": Select
  13934. // default ads with the specified compatibility. Applicable when type is
  13935. // AD_SERVING_DEFAULT_AD. DISPLAY and DISPLAY_INTERSTITIAL refer to
  13936. // rendering either on desktop or on mobile devices for regular or
  13937. // interstitial ads, respectively. APP and APP_INTERSTITIAL are for
  13938. // rendering in mobile apps. IN_STREAM_VIDEO refers to rendering an
  13939. // in-stream video ads developed with the VAST standard.
  13940. //
  13941. // Possible values:
  13942. // "APP"
  13943. // "APP_INTERSTITIAL"
  13944. // "DISPLAY"
  13945. // "DISPLAY_INTERSTITIAL"
  13946. // "IN_STREAM_VIDEO"
  13947. func (c *AdsListCall) Compatibility(compatibility string) *AdsListCall {
  13948. c.urlParams_.Set("compatibility", compatibility)
  13949. return c
  13950. }
  13951. // CreativeIds sets the optional parameter "creativeIds": Select only
  13952. // ads with these creative IDs assigned.
  13953. func (c *AdsListCall) CreativeIds(creativeIds ...int64) *AdsListCall {
  13954. var creativeIds_ []string
  13955. for _, v := range creativeIds {
  13956. creativeIds_ = append(creativeIds_, fmt.Sprint(v))
  13957. }
  13958. c.urlParams_.SetMulti("creativeIds", creativeIds_)
  13959. return c
  13960. }
  13961. // CreativeOptimizationConfigurationIds sets the optional parameter
  13962. // "creativeOptimizationConfigurationIds": Select only ads with these
  13963. // creative optimization configuration IDs.
  13964. func (c *AdsListCall) CreativeOptimizationConfigurationIds(creativeOptimizationConfigurationIds ...int64) *AdsListCall {
  13965. var creativeOptimizationConfigurationIds_ []string
  13966. for _, v := range creativeOptimizationConfigurationIds {
  13967. creativeOptimizationConfigurationIds_ = append(creativeOptimizationConfigurationIds_, fmt.Sprint(v))
  13968. }
  13969. c.urlParams_.SetMulti("creativeOptimizationConfigurationIds", creativeOptimizationConfigurationIds_)
  13970. return c
  13971. }
  13972. // DynamicClickTracker sets the optional parameter
  13973. // "dynamicClickTracker": Select only dynamic click trackers. Applicable
  13974. // when type is AD_SERVING_CLICK_TRACKER. If true, select dynamic click
  13975. // trackers. If false, select static click trackers. Leave unset to
  13976. // select both.
  13977. func (c *AdsListCall) DynamicClickTracker(dynamicClickTracker bool) *AdsListCall {
  13978. c.urlParams_.Set("dynamicClickTracker", fmt.Sprint(dynamicClickTracker))
  13979. return c
  13980. }
  13981. // Ids sets the optional parameter "ids": Select only ads with these
  13982. // IDs.
  13983. func (c *AdsListCall) Ids(ids ...int64) *AdsListCall {
  13984. var ids_ []string
  13985. for _, v := range ids {
  13986. ids_ = append(ids_, fmt.Sprint(v))
  13987. }
  13988. c.urlParams_.SetMulti("ids", ids_)
  13989. return c
  13990. }
  13991. // LandingPageIds sets the optional parameter "landingPageIds": Select
  13992. // only ads with these landing page IDs.
  13993. func (c *AdsListCall) LandingPageIds(landingPageIds ...int64) *AdsListCall {
  13994. var landingPageIds_ []string
  13995. for _, v := range landingPageIds {
  13996. landingPageIds_ = append(landingPageIds_, fmt.Sprint(v))
  13997. }
  13998. c.urlParams_.SetMulti("landingPageIds", landingPageIds_)
  13999. return c
  14000. }
  14001. // MaxResults sets the optional parameter "maxResults": Maximum number
  14002. // of results to return.
  14003. func (c *AdsListCall) MaxResults(maxResults int64) *AdsListCall {
  14004. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  14005. return c
  14006. }
  14007. // OverriddenEventTagId sets the optional parameter
  14008. // "overriddenEventTagId": Select only ads with this event tag override
  14009. // ID.
  14010. func (c *AdsListCall) OverriddenEventTagId(overriddenEventTagId int64) *AdsListCall {
  14011. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  14012. return c
  14013. }
  14014. // PageToken sets the optional parameter "pageToken": Value of the
  14015. // nextPageToken from the previous result page.
  14016. func (c *AdsListCall) PageToken(pageToken string) *AdsListCall {
  14017. c.urlParams_.Set("pageToken", pageToken)
  14018. return c
  14019. }
  14020. // PlacementIds sets the optional parameter "placementIds": Select only
  14021. // ads with these placement IDs assigned.
  14022. func (c *AdsListCall) PlacementIds(placementIds ...int64) *AdsListCall {
  14023. var placementIds_ []string
  14024. for _, v := range placementIds {
  14025. placementIds_ = append(placementIds_, fmt.Sprint(v))
  14026. }
  14027. c.urlParams_.SetMulti("placementIds", placementIds_)
  14028. return c
  14029. }
  14030. // RemarketingListIds sets the optional parameter "remarketingListIds":
  14031. // Select only ads whose list targeting expression use these remarketing
  14032. // list IDs.
  14033. func (c *AdsListCall) RemarketingListIds(remarketingListIds ...int64) *AdsListCall {
  14034. var remarketingListIds_ []string
  14035. for _, v := range remarketingListIds {
  14036. remarketingListIds_ = append(remarketingListIds_, fmt.Sprint(v))
  14037. }
  14038. c.urlParams_.SetMulti("remarketingListIds", remarketingListIds_)
  14039. return c
  14040. }
  14041. // SearchString sets the optional parameter "searchString": Allows
  14042. // searching for objects by name or ID. Wildcards (*) are allowed. For
  14043. // example, "ad*2015" will return objects with names like "ad June
  14044. // 2015", "ad April 2015", or simply "ad 2015". Most of the searches
  14045. // also add wildcards implicitly at the start and the end of the search
  14046. // string. For example, a search string of "ad" will match objects with
  14047. // name "my ad", "ad 2015", or simply "ad".
  14048. func (c *AdsListCall) SearchString(searchString string) *AdsListCall {
  14049. c.urlParams_.Set("searchString", searchString)
  14050. return c
  14051. }
  14052. // SizeIds sets the optional parameter "sizeIds": Select only ads with
  14053. // these size IDs.
  14054. func (c *AdsListCall) SizeIds(sizeIds ...int64) *AdsListCall {
  14055. var sizeIds_ []string
  14056. for _, v := range sizeIds {
  14057. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  14058. }
  14059. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  14060. return c
  14061. }
  14062. // SortField sets the optional parameter "sortField": Field by which to
  14063. // sort the list.
  14064. //
  14065. // Possible values:
  14066. // "ID" (default)
  14067. // "NAME"
  14068. func (c *AdsListCall) SortField(sortField string) *AdsListCall {
  14069. c.urlParams_.Set("sortField", sortField)
  14070. return c
  14071. }
  14072. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  14073. // results.
  14074. //
  14075. // Possible values:
  14076. // "ASCENDING" (default)
  14077. // "DESCENDING"
  14078. func (c *AdsListCall) SortOrder(sortOrder string) *AdsListCall {
  14079. c.urlParams_.Set("sortOrder", sortOrder)
  14080. return c
  14081. }
  14082. // SslCompliant sets the optional parameter "sslCompliant": Select only
  14083. // ads that are SSL-compliant.
  14084. func (c *AdsListCall) SslCompliant(sslCompliant bool) *AdsListCall {
  14085. c.urlParams_.Set("sslCompliant", fmt.Sprint(sslCompliant))
  14086. return c
  14087. }
  14088. // SslRequired sets the optional parameter "sslRequired": Select only
  14089. // ads that require SSL.
  14090. func (c *AdsListCall) SslRequired(sslRequired bool) *AdsListCall {
  14091. c.urlParams_.Set("sslRequired", fmt.Sprint(sslRequired))
  14092. return c
  14093. }
  14094. // Type sets the optional parameter "type": Select only ads with these
  14095. // types.
  14096. //
  14097. // Possible values:
  14098. // "AD_SERVING_CLICK_TRACKER"
  14099. // "AD_SERVING_DEFAULT_AD"
  14100. // "AD_SERVING_STANDARD_AD"
  14101. // "AD_SERVING_TRACKING"
  14102. func (c *AdsListCall) Type(type_ ...string) *AdsListCall {
  14103. c.urlParams_.SetMulti("type", append([]string{}, type_...))
  14104. return c
  14105. }
  14106. // Fields allows partial responses to be retrieved. See
  14107. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14108. // for more information.
  14109. func (c *AdsListCall) Fields(s ...googleapi.Field) *AdsListCall {
  14110. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14111. return c
  14112. }
  14113. // IfNoneMatch sets the optional parameter which makes the operation
  14114. // fail if the object's ETag matches the given value. This is useful for
  14115. // getting updates only after the object has changed since the last
  14116. // request. Use googleapi.IsNotModified to check whether the response
  14117. // error from Do is the result of In-None-Match.
  14118. func (c *AdsListCall) IfNoneMatch(entityTag string) *AdsListCall {
  14119. c.ifNoneMatch_ = entityTag
  14120. return c
  14121. }
  14122. // Context sets the context to be used in this call's Do method. Any
  14123. // pending HTTP request will be aborted if the provided context is
  14124. // canceled.
  14125. func (c *AdsListCall) Context(ctx context.Context) *AdsListCall {
  14126. c.ctx_ = ctx
  14127. return c
  14128. }
  14129. // Header returns an http.Header that can be modified by the caller to
  14130. // add HTTP headers to the request.
  14131. func (c *AdsListCall) Header() http.Header {
  14132. if c.header_ == nil {
  14133. c.header_ = make(http.Header)
  14134. }
  14135. return c.header_
  14136. }
  14137. func (c *AdsListCall) doRequest(alt string) (*http.Response, error) {
  14138. reqHeaders := make(http.Header)
  14139. for k, v := range c.header_ {
  14140. reqHeaders[k] = v
  14141. }
  14142. reqHeaders.Set("User-Agent", c.s.userAgent())
  14143. if c.ifNoneMatch_ != "" {
  14144. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14145. }
  14146. var body io.Reader = nil
  14147. c.urlParams_.Set("alt", alt)
  14148. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14149. urls += "?" + c.urlParams_.Encode()
  14150. req, _ := http.NewRequest("GET", urls, body)
  14151. req.Header = reqHeaders
  14152. googleapi.Expand(req.URL, map[string]string{
  14153. "profileId": strconv.FormatInt(c.profileId, 10),
  14154. })
  14155. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14156. }
  14157. // Do executes the "dfareporting.ads.list" call.
  14158. // Exactly one of *AdsListResponse or error will be non-nil. Any non-2xx
  14159. // status code is an error. Response headers are in either
  14160. // *AdsListResponse.ServerResponse.Header or (if a response was returned
  14161. // at all) in error.(*googleapi.Error).Header. Use
  14162. // googleapi.IsNotModified to check whether the returned error was
  14163. // because http.StatusNotModified was returned.
  14164. func (c *AdsListCall) Do(opts ...googleapi.CallOption) (*AdsListResponse, error) {
  14165. gensupport.SetOptions(c.urlParams_, opts...)
  14166. res, err := c.doRequest("json")
  14167. if res != nil && res.StatusCode == http.StatusNotModified {
  14168. if res.Body != nil {
  14169. res.Body.Close()
  14170. }
  14171. return nil, &googleapi.Error{
  14172. Code: res.StatusCode,
  14173. Header: res.Header,
  14174. }
  14175. }
  14176. if err != nil {
  14177. return nil, err
  14178. }
  14179. defer googleapi.CloseBody(res)
  14180. if err := googleapi.CheckResponse(res); err != nil {
  14181. return nil, err
  14182. }
  14183. ret := &AdsListResponse{
  14184. ServerResponse: googleapi.ServerResponse{
  14185. Header: res.Header,
  14186. HTTPStatusCode: res.StatusCode,
  14187. },
  14188. }
  14189. target := &ret
  14190. if err := gensupport.DecodeResponse(target, res); err != nil {
  14191. return nil, err
  14192. }
  14193. return ret, nil
  14194. // {
  14195. // "description": "Retrieves a list of ads, possibly filtered. This method supports paging.",
  14196. // "httpMethod": "GET",
  14197. // "id": "dfareporting.ads.list",
  14198. // "parameterOrder": [
  14199. // "profileId"
  14200. // ],
  14201. // "parameters": {
  14202. // "active": {
  14203. // "description": "Select only active ads.",
  14204. // "location": "query",
  14205. // "type": "boolean"
  14206. // },
  14207. // "advertiserId": {
  14208. // "description": "Select only ads with this advertiser ID.",
  14209. // "format": "int64",
  14210. // "location": "query",
  14211. // "type": "string"
  14212. // },
  14213. // "archived": {
  14214. // "description": "Select only archived ads.",
  14215. // "location": "query",
  14216. // "type": "boolean"
  14217. // },
  14218. // "audienceSegmentIds": {
  14219. // "description": "Select only ads with these audience segment IDs.",
  14220. // "format": "int64",
  14221. // "location": "query",
  14222. // "repeated": true,
  14223. // "type": "string"
  14224. // },
  14225. // "campaignIds": {
  14226. // "description": "Select only ads with these campaign IDs.",
  14227. // "format": "int64",
  14228. // "location": "query",
  14229. // "repeated": true,
  14230. // "type": "string"
  14231. // },
  14232. // "compatibility": {
  14233. // "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.",
  14234. // "enum": [
  14235. // "APP",
  14236. // "APP_INTERSTITIAL",
  14237. // "DISPLAY",
  14238. // "DISPLAY_INTERSTITIAL",
  14239. // "IN_STREAM_VIDEO"
  14240. // ],
  14241. // "enumDescriptions": [
  14242. // "",
  14243. // "",
  14244. // "",
  14245. // "",
  14246. // ""
  14247. // ],
  14248. // "location": "query",
  14249. // "type": "string"
  14250. // },
  14251. // "creativeIds": {
  14252. // "description": "Select only ads with these creative IDs assigned.",
  14253. // "format": "int64",
  14254. // "location": "query",
  14255. // "repeated": true,
  14256. // "type": "string"
  14257. // },
  14258. // "creativeOptimizationConfigurationIds": {
  14259. // "description": "Select only ads with these creative optimization configuration IDs.",
  14260. // "format": "int64",
  14261. // "location": "query",
  14262. // "repeated": true,
  14263. // "type": "string"
  14264. // },
  14265. // "dynamicClickTracker": {
  14266. // "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.",
  14267. // "location": "query",
  14268. // "type": "boolean"
  14269. // },
  14270. // "ids": {
  14271. // "description": "Select only ads with these IDs.",
  14272. // "format": "int64",
  14273. // "location": "query",
  14274. // "repeated": true,
  14275. // "type": "string"
  14276. // },
  14277. // "landingPageIds": {
  14278. // "description": "Select only ads with these landing page IDs.",
  14279. // "format": "int64",
  14280. // "location": "query",
  14281. // "repeated": true,
  14282. // "type": "string"
  14283. // },
  14284. // "maxResults": {
  14285. // "default": "1000",
  14286. // "description": "Maximum number of results to return.",
  14287. // "format": "int32",
  14288. // "location": "query",
  14289. // "maximum": "1000",
  14290. // "minimum": "0",
  14291. // "type": "integer"
  14292. // },
  14293. // "overriddenEventTagId": {
  14294. // "description": "Select only ads with this event tag override ID.",
  14295. // "format": "int64",
  14296. // "location": "query",
  14297. // "type": "string"
  14298. // },
  14299. // "pageToken": {
  14300. // "description": "Value of the nextPageToken from the previous result page.",
  14301. // "location": "query",
  14302. // "type": "string"
  14303. // },
  14304. // "placementIds": {
  14305. // "description": "Select only ads with these placement IDs assigned.",
  14306. // "format": "int64",
  14307. // "location": "query",
  14308. // "repeated": true,
  14309. // "type": "string"
  14310. // },
  14311. // "profileId": {
  14312. // "description": "User profile ID associated with this request.",
  14313. // "format": "int64",
  14314. // "location": "path",
  14315. // "required": true,
  14316. // "type": "string"
  14317. // },
  14318. // "remarketingListIds": {
  14319. // "description": "Select only ads whose list targeting expression use these remarketing list IDs.",
  14320. // "format": "int64",
  14321. // "location": "query",
  14322. // "repeated": true,
  14323. // "type": "string"
  14324. // },
  14325. // "searchString": {
  14326. // "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\".",
  14327. // "location": "query",
  14328. // "type": "string"
  14329. // },
  14330. // "sizeIds": {
  14331. // "description": "Select only ads with these size IDs.",
  14332. // "format": "int64",
  14333. // "location": "query",
  14334. // "repeated": true,
  14335. // "type": "string"
  14336. // },
  14337. // "sortField": {
  14338. // "default": "ID",
  14339. // "description": "Field by which to sort the list.",
  14340. // "enum": [
  14341. // "ID",
  14342. // "NAME"
  14343. // ],
  14344. // "enumDescriptions": [
  14345. // "",
  14346. // ""
  14347. // ],
  14348. // "location": "query",
  14349. // "type": "string"
  14350. // },
  14351. // "sortOrder": {
  14352. // "default": "ASCENDING",
  14353. // "description": "Order of sorted results.",
  14354. // "enum": [
  14355. // "ASCENDING",
  14356. // "DESCENDING"
  14357. // ],
  14358. // "enumDescriptions": [
  14359. // "",
  14360. // ""
  14361. // ],
  14362. // "location": "query",
  14363. // "type": "string"
  14364. // },
  14365. // "sslCompliant": {
  14366. // "description": "Select only ads that are SSL-compliant.",
  14367. // "location": "query",
  14368. // "type": "boolean"
  14369. // },
  14370. // "sslRequired": {
  14371. // "description": "Select only ads that require SSL.",
  14372. // "location": "query",
  14373. // "type": "boolean"
  14374. // },
  14375. // "type": {
  14376. // "description": "Select only ads with these types.",
  14377. // "enum": [
  14378. // "AD_SERVING_CLICK_TRACKER",
  14379. // "AD_SERVING_DEFAULT_AD",
  14380. // "AD_SERVING_STANDARD_AD",
  14381. // "AD_SERVING_TRACKING"
  14382. // ],
  14383. // "enumDescriptions": [
  14384. // "",
  14385. // "",
  14386. // "",
  14387. // ""
  14388. // ],
  14389. // "location": "query",
  14390. // "repeated": true,
  14391. // "type": "string"
  14392. // }
  14393. // },
  14394. // "path": "userprofiles/{profileId}/ads",
  14395. // "response": {
  14396. // "$ref": "AdsListResponse"
  14397. // },
  14398. // "scopes": [
  14399. // "https://www.googleapis.com/auth/dfatrafficking"
  14400. // ]
  14401. // }
  14402. }
  14403. // Pages invokes f for each page of results.
  14404. // A non-nil error returned from f will halt the iteration.
  14405. // The provided context supersedes any context provided to the Context method.
  14406. func (c *AdsListCall) Pages(ctx context.Context, f func(*AdsListResponse) error) error {
  14407. c.ctx_ = ctx
  14408. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  14409. for {
  14410. x, err := c.Do()
  14411. if err != nil {
  14412. return err
  14413. }
  14414. if err := f(x); err != nil {
  14415. return err
  14416. }
  14417. if x.NextPageToken == "" {
  14418. return nil
  14419. }
  14420. c.PageToken(x.NextPageToken)
  14421. }
  14422. }
  14423. // method id "dfareporting.ads.patch":
  14424. type AdsPatchCall struct {
  14425. s *Service
  14426. profileId int64
  14427. ad *Ad
  14428. urlParams_ gensupport.URLParams
  14429. ctx_ context.Context
  14430. header_ http.Header
  14431. }
  14432. // Patch: Updates an existing ad. This method supports patch semantics.
  14433. func (r *AdsService) Patch(profileId int64, id int64, ad *Ad) *AdsPatchCall {
  14434. c := &AdsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14435. c.profileId = profileId
  14436. c.urlParams_.Set("id", fmt.Sprint(id))
  14437. c.ad = ad
  14438. return c
  14439. }
  14440. // Fields allows partial responses to be retrieved. See
  14441. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14442. // for more information.
  14443. func (c *AdsPatchCall) Fields(s ...googleapi.Field) *AdsPatchCall {
  14444. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14445. return c
  14446. }
  14447. // Context sets the context to be used in this call's Do method. Any
  14448. // pending HTTP request will be aborted if the provided context is
  14449. // canceled.
  14450. func (c *AdsPatchCall) Context(ctx context.Context) *AdsPatchCall {
  14451. c.ctx_ = ctx
  14452. return c
  14453. }
  14454. // Header returns an http.Header that can be modified by the caller to
  14455. // add HTTP headers to the request.
  14456. func (c *AdsPatchCall) Header() http.Header {
  14457. if c.header_ == nil {
  14458. c.header_ = make(http.Header)
  14459. }
  14460. return c.header_
  14461. }
  14462. func (c *AdsPatchCall) doRequest(alt string) (*http.Response, error) {
  14463. reqHeaders := make(http.Header)
  14464. for k, v := range c.header_ {
  14465. reqHeaders[k] = v
  14466. }
  14467. reqHeaders.Set("User-Agent", c.s.userAgent())
  14468. var body io.Reader = nil
  14469. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14470. if err != nil {
  14471. return nil, err
  14472. }
  14473. reqHeaders.Set("Content-Type", "application/json")
  14474. c.urlParams_.Set("alt", alt)
  14475. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14476. urls += "?" + c.urlParams_.Encode()
  14477. req, _ := http.NewRequest("PATCH", urls, body)
  14478. req.Header = reqHeaders
  14479. googleapi.Expand(req.URL, map[string]string{
  14480. "profileId": strconv.FormatInt(c.profileId, 10),
  14481. })
  14482. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14483. }
  14484. // Do executes the "dfareporting.ads.patch" call.
  14485. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14486. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14487. // or (if a response was returned at all) in
  14488. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14489. // whether the returned error was because http.StatusNotModified was
  14490. // returned.
  14491. func (c *AdsPatchCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14492. gensupport.SetOptions(c.urlParams_, opts...)
  14493. res, err := c.doRequest("json")
  14494. if res != nil && res.StatusCode == http.StatusNotModified {
  14495. if res.Body != nil {
  14496. res.Body.Close()
  14497. }
  14498. return nil, &googleapi.Error{
  14499. Code: res.StatusCode,
  14500. Header: res.Header,
  14501. }
  14502. }
  14503. if err != nil {
  14504. return nil, err
  14505. }
  14506. defer googleapi.CloseBody(res)
  14507. if err := googleapi.CheckResponse(res); err != nil {
  14508. return nil, err
  14509. }
  14510. ret := &Ad{
  14511. ServerResponse: googleapi.ServerResponse{
  14512. Header: res.Header,
  14513. HTTPStatusCode: res.StatusCode,
  14514. },
  14515. }
  14516. target := &ret
  14517. if err := gensupport.DecodeResponse(target, res); err != nil {
  14518. return nil, err
  14519. }
  14520. return ret, nil
  14521. // {
  14522. // "description": "Updates an existing ad. This method supports patch semantics.",
  14523. // "httpMethod": "PATCH",
  14524. // "id": "dfareporting.ads.patch",
  14525. // "parameterOrder": [
  14526. // "profileId",
  14527. // "id"
  14528. // ],
  14529. // "parameters": {
  14530. // "id": {
  14531. // "description": "Ad ID.",
  14532. // "format": "int64",
  14533. // "location": "query",
  14534. // "required": true,
  14535. // "type": "string"
  14536. // },
  14537. // "profileId": {
  14538. // "description": "User profile ID associated with this request.",
  14539. // "format": "int64",
  14540. // "location": "path",
  14541. // "required": true,
  14542. // "type": "string"
  14543. // }
  14544. // },
  14545. // "path": "userprofiles/{profileId}/ads",
  14546. // "request": {
  14547. // "$ref": "Ad"
  14548. // },
  14549. // "response": {
  14550. // "$ref": "Ad"
  14551. // },
  14552. // "scopes": [
  14553. // "https://www.googleapis.com/auth/dfatrafficking"
  14554. // ]
  14555. // }
  14556. }
  14557. // method id "dfareporting.ads.update":
  14558. type AdsUpdateCall struct {
  14559. s *Service
  14560. profileId int64
  14561. ad *Ad
  14562. urlParams_ gensupport.URLParams
  14563. ctx_ context.Context
  14564. header_ http.Header
  14565. }
  14566. // Update: Updates an existing ad.
  14567. func (r *AdsService) Update(profileId int64, ad *Ad) *AdsUpdateCall {
  14568. c := &AdsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14569. c.profileId = profileId
  14570. c.ad = ad
  14571. return c
  14572. }
  14573. // Fields allows partial responses to be retrieved. See
  14574. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14575. // for more information.
  14576. func (c *AdsUpdateCall) Fields(s ...googleapi.Field) *AdsUpdateCall {
  14577. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14578. return c
  14579. }
  14580. // Context sets the context to be used in this call's Do method. Any
  14581. // pending HTTP request will be aborted if the provided context is
  14582. // canceled.
  14583. func (c *AdsUpdateCall) Context(ctx context.Context) *AdsUpdateCall {
  14584. c.ctx_ = ctx
  14585. return c
  14586. }
  14587. // Header returns an http.Header that can be modified by the caller to
  14588. // add HTTP headers to the request.
  14589. func (c *AdsUpdateCall) Header() http.Header {
  14590. if c.header_ == nil {
  14591. c.header_ = make(http.Header)
  14592. }
  14593. return c.header_
  14594. }
  14595. func (c *AdsUpdateCall) doRequest(alt string) (*http.Response, error) {
  14596. reqHeaders := make(http.Header)
  14597. for k, v := range c.header_ {
  14598. reqHeaders[k] = v
  14599. }
  14600. reqHeaders.Set("User-Agent", c.s.userAgent())
  14601. var body io.Reader = nil
  14602. body, err := googleapi.WithoutDataWrapper.JSONReader(c.ad)
  14603. if err != nil {
  14604. return nil, err
  14605. }
  14606. reqHeaders.Set("Content-Type", "application/json")
  14607. c.urlParams_.Set("alt", alt)
  14608. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/ads")
  14609. urls += "?" + c.urlParams_.Encode()
  14610. req, _ := http.NewRequest("PUT", urls, body)
  14611. req.Header = reqHeaders
  14612. googleapi.Expand(req.URL, map[string]string{
  14613. "profileId": strconv.FormatInt(c.profileId, 10),
  14614. })
  14615. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14616. }
  14617. // Do executes the "dfareporting.ads.update" call.
  14618. // Exactly one of *Ad or error will be non-nil. Any non-2xx status code
  14619. // is an error. Response headers are in either *Ad.ServerResponse.Header
  14620. // or (if a response was returned at all) in
  14621. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  14622. // whether the returned error was because http.StatusNotModified was
  14623. // returned.
  14624. func (c *AdsUpdateCall) Do(opts ...googleapi.CallOption) (*Ad, error) {
  14625. gensupport.SetOptions(c.urlParams_, opts...)
  14626. res, err := c.doRequest("json")
  14627. if res != nil && res.StatusCode == http.StatusNotModified {
  14628. if res.Body != nil {
  14629. res.Body.Close()
  14630. }
  14631. return nil, &googleapi.Error{
  14632. Code: res.StatusCode,
  14633. Header: res.Header,
  14634. }
  14635. }
  14636. if err != nil {
  14637. return nil, err
  14638. }
  14639. defer googleapi.CloseBody(res)
  14640. if err := googleapi.CheckResponse(res); err != nil {
  14641. return nil, err
  14642. }
  14643. ret := &Ad{
  14644. ServerResponse: googleapi.ServerResponse{
  14645. Header: res.Header,
  14646. HTTPStatusCode: res.StatusCode,
  14647. },
  14648. }
  14649. target := &ret
  14650. if err := gensupport.DecodeResponse(target, res); err != nil {
  14651. return nil, err
  14652. }
  14653. return ret, nil
  14654. // {
  14655. // "description": "Updates an existing ad.",
  14656. // "httpMethod": "PUT",
  14657. // "id": "dfareporting.ads.update",
  14658. // "parameterOrder": [
  14659. // "profileId"
  14660. // ],
  14661. // "parameters": {
  14662. // "profileId": {
  14663. // "description": "User profile ID associated with this request.",
  14664. // "format": "int64",
  14665. // "location": "path",
  14666. // "required": true,
  14667. // "type": "string"
  14668. // }
  14669. // },
  14670. // "path": "userprofiles/{profileId}/ads",
  14671. // "request": {
  14672. // "$ref": "Ad"
  14673. // },
  14674. // "response": {
  14675. // "$ref": "Ad"
  14676. // },
  14677. // "scopes": [
  14678. // "https://www.googleapis.com/auth/dfatrafficking"
  14679. // ]
  14680. // }
  14681. }
  14682. // method id "dfareporting.advertiserGroups.delete":
  14683. type AdvertiserGroupsDeleteCall struct {
  14684. s *Service
  14685. profileId int64
  14686. id int64
  14687. urlParams_ gensupport.URLParams
  14688. ctx_ context.Context
  14689. header_ http.Header
  14690. }
  14691. // Delete: Deletes an existing advertiser group.
  14692. func (r *AdvertiserGroupsService) Delete(profileId int64, id int64) *AdvertiserGroupsDeleteCall {
  14693. c := &AdvertiserGroupsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14694. c.profileId = profileId
  14695. c.id = id
  14696. return c
  14697. }
  14698. // Fields allows partial responses to be retrieved. See
  14699. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14700. // for more information.
  14701. func (c *AdvertiserGroupsDeleteCall) Fields(s ...googleapi.Field) *AdvertiserGroupsDeleteCall {
  14702. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14703. return c
  14704. }
  14705. // Context sets the context to be used in this call's Do method. Any
  14706. // pending HTTP request will be aborted if the provided context is
  14707. // canceled.
  14708. func (c *AdvertiserGroupsDeleteCall) Context(ctx context.Context) *AdvertiserGroupsDeleteCall {
  14709. c.ctx_ = ctx
  14710. return c
  14711. }
  14712. // Header returns an http.Header that can be modified by the caller to
  14713. // add HTTP headers to the request.
  14714. func (c *AdvertiserGroupsDeleteCall) Header() http.Header {
  14715. if c.header_ == nil {
  14716. c.header_ = make(http.Header)
  14717. }
  14718. return c.header_
  14719. }
  14720. func (c *AdvertiserGroupsDeleteCall) doRequest(alt string) (*http.Response, error) {
  14721. reqHeaders := make(http.Header)
  14722. for k, v := range c.header_ {
  14723. reqHeaders[k] = v
  14724. }
  14725. reqHeaders.Set("User-Agent", c.s.userAgent())
  14726. var body io.Reader = nil
  14727. c.urlParams_.Set("alt", alt)
  14728. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  14729. urls += "?" + c.urlParams_.Encode()
  14730. req, _ := http.NewRequest("DELETE", urls, body)
  14731. req.Header = reqHeaders
  14732. googleapi.Expand(req.URL, map[string]string{
  14733. "profileId": strconv.FormatInt(c.profileId, 10),
  14734. "id": strconv.FormatInt(c.id, 10),
  14735. })
  14736. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14737. }
  14738. // Do executes the "dfareporting.advertiserGroups.delete" call.
  14739. func (c *AdvertiserGroupsDeleteCall) Do(opts ...googleapi.CallOption) error {
  14740. gensupport.SetOptions(c.urlParams_, opts...)
  14741. res, err := c.doRequest("json")
  14742. if err != nil {
  14743. return err
  14744. }
  14745. defer googleapi.CloseBody(res)
  14746. if err := googleapi.CheckResponse(res); err != nil {
  14747. return err
  14748. }
  14749. return nil
  14750. // {
  14751. // "description": "Deletes an existing advertiser group.",
  14752. // "httpMethod": "DELETE",
  14753. // "id": "dfareporting.advertiserGroups.delete",
  14754. // "parameterOrder": [
  14755. // "profileId",
  14756. // "id"
  14757. // ],
  14758. // "parameters": {
  14759. // "id": {
  14760. // "description": "Advertiser group ID.",
  14761. // "format": "int64",
  14762. // "location": "path",
  14763. // "required": true,
  14764. // "type": "string"
  14765. // },
  14766. // "profileId": {
  14767. // "description": "User profile ID associated with this request.",
  14768. // "format": "int64",
  14769. // "location": "path",
  14770. // "required": true,
  14771. // "type": "string"
  14772. // }
  14773. // },
  14774. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  14775. // "scopes": [
  14776. // "https://www.googleapis.com/auth/dfatrafficking"
  14777. // ]
  14778. // }
  14779. }
  14780. // method id "dfareporting.advertiserGroups.get":
  14781. type AdvertiserGroupsGetCall struct {
  14782. s *Service
  14783. profileId int64
  14784. id int64
  14785. urlParams_ gensupport.URLParams
  14786. ifNoneMatch_ string
  14787. ctx_ context.Context
  14788. header_ http.Header
  14789. }
  14790. // Get: Gets one advertiser group by ID.
  14791. func (r *AdvertiserGroupsService) Get(profileId int64, id int64) *AdvertiserGroupsGetCall {
  14792. c := &AdvertiserGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14793. c.profileId = profileId
  14794. c.id = id
  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 *AdvertiserGroupsGetCall) Fields(s ...googleapi.Field) *AdvertiserGroupsGetCall {
  14801. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14802. return c
  14803. }
  14804. // IfNoneMatch sets the optional parameter which makes the operation
  14805. // fail if the object's ETag matches the given value. This is useful for
  14806. // getting updates only after the object has changed since the last
  14807. // request. Use googleapi.IsNotModified to check whether the response
  14808. // error from Do is the result of In-None-Match.
  14809. func (c *AdvertiserGroupsGetCall) IfNoneMatch(entityTag string) *AdvertiserGroupsGetCall {
  14810. c.ifNoneMatch_ = entityTag
  14811. return c
  14812. }
  14813. // Context sets the context to be used in this call's Do method. Any
  14814. // pending HTTP request will be aborted if the provided context is
  14815. // canceled.
  14816. func (c *AdvertiserGroupsGetCall) Context(ctx context.Context) *AdvertiserGroupsGetCall {
  14817. c.ctx_ = ctx
  14818. return c
  14819. }
  14820. // Header returns an http.Header that can be modified by the caller to
  14821. // add HTTP headers to the request.
  14822. func (c *AdvertiserGroupsGetCall) Header() http.Header {
  14823. if c.header_ == nil {
  14824. c.header_ = make(http.Header)
  14825. }
  14826. return c.header_
  14827. }
  14828. func (c *AdvertiserGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  14829. reqHeaders := make(http.Header)
  14830. for k, v := range c.header_ {
  14831. reqHeaders[k] = v
  14832. }
  14833. reqHeaders.Set("User-Agent", c.s.userAgent())
  14834. if c.ifNoneMatch_ != "" {
  14835. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  14836. }
  14837. var body io.Reader = nil
  14838. c.urlParams_.Set("alt", alt)
  14839. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups/{id}")
  14840. urls += "?" + c.urlParams_.Encode()
  14841. req, _ := http.NewRequest("GET", urls, body)
  14842. req.Header = reqHeaders
  14843. googleapi.Expand(req.URL, map[string]string{
  14844. "profileId": strconv.FormatInt(c.profileId, 10),
  14845. "id": strconv.FormatInt(c.id, 10),
  14846. })
  14847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14848. }
  14849. // Do executes the "dfareporting.advertiserGroups.get" call.
  14850. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  14851. // status code is an error. Response headers are in either
  14852. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  14853. // at all) in error.(*googleapi.Error).Header. Use
  14854. // googleapi.IsNotModified to check whether the returned error was
  14855. // because http.StatusNotModified was returned.
  14856. func (c *AdvertiserGroupsGetCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  14857. gensupport.SetOptions(c.urlParams_, opts...)
  14858. res, err := c.doRequest("json")
  14859. if res != nil && res.StatusCode == http.StatusNotModified {
  14860. if res.Body != nil {
  14861. res.Body.Close()
  14862. }
  14863. return nil, &googleapi.Error{
  14864. Code: res.StatusCode,
  14865. Header: res.Header,
  14866. }
  14867. }
  14868. if err != nil {
  14869. return nil, err
  14870. }
  14871. defer googleapi.CloseBody(res)
  14872. if err := googleapi.CheckResponse(res); err != nil {
  14873. return nil, err
  14874. }
  14875. ret := &AdvertiserGroup{
  14876. ServerResponse: googleapi.ServerResponse{
  14877. Header: res.Header,
  14878. HTTPStatusCode: res.StatusCode,
  14879. },
  14880. }
  14881. target := &ret
  14882. if err := gensupport.DecodeResponse(target, res); err != nil {
  14883. return nil, err
  14884. }
  14885. return ret, nil
  14886. // {
  14887. // "description": "Gets one advertiser group by ID.",
  14888. // "httpMethod": "GET",
  14889. // "id": "dfareporting.advertiserGroups.get",
  14890. // "parameterOrder": [
  14891. // "profileId",
  14892. // "id"
  14893. // ],
  14894. // "parameters": {
  14895. // "id": {
  14896. // "description": "Advertiser group ID.",
  14897. // "format": "int64",
  14898. // "location": "path",
  14899. // "required": true,
  14900. // "type": "string"
  14901. // },
  14902. // "profileId": {
  14903. // "description": "User profile ID associated with this request.",
  14904. // "format": "int64",
  14905. // "location": "path",
  14906. // "required": true,
  14907. // "type": "string"
  14908. // }
  14909. // },
  14910. // "path": "userprofiles/{profileId}/advertiserGroups/{id}",
  14911. // "response": {
  14912. // "$ref": "AdvertiserGroup"
  14913. // },
  14914. // "scopes": [
  14915. // "https://www.googleapis.com/auth/dfatrafficking"
  14916. // ]
  14917. // }
  14918. }
  14919. // method id "dfareporting.advertiserGroups.insert":
  14920. type AdvertiserGroupsInsertCall struct {
  14921. s *Service
  14922. profileId int64
  14923. advertisergroup *AdvertiserGroup
  14924. urlParams_ gensupport.URLParams
  14925. ctx_ context.Context
  14926. header_ http.Header
  14927. }
  14928. // Insert: Inserts a new advertiser group.
  14929. func (r *AdvertiserGroupsService) Insert(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsInsertCall {
  14930. c := &AdvertiserGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  14931. c.profileId = profileId
  14932. c.advertisergroup = advertisergroup
  14933. return c
  14934. }
  14935. // Fields allows partial responses to be retrieved. See
  14936. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  14937. // for more information.
  14938. func (c *AdvertiserGroupsInsertCall) Fields(s ...googleapi.Field) *AdvertiserGroupsInsertCall {
  14939. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  14940. return c
  14941. }
  14942. // Context sets the context to be used in this call's Do method. Any
  14943. // pending HTTP request will be aborted if the provided context is
  14944. // canceled.
  14945. func (c *AdvertiserGroupsInsertCall) Context(ctx context.Context) *AdvertiserGroupsInsertCall {
  14946. c.ctx_ = ctx
  14947. return c
  14948. }
  14949. // Header returns an http.Header that can be modified by the caller to
  14950. // add HTTP headers to the request.
  14951. func (c *AdvertiserGroupsInsertCall) Header() http.Header {
  14952. if c.header_ == nil {
  14953. c.header_ = make(http.Header)
  14954. }
  14955. return c.header_
  14956. }
  14957. func (c *AdvertiserGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  14958. reqHeaders := make(http.Header)
  14959. for k, v := range c.header_ {
  14960. reqHeaders[k] = v
  14961. }
  14962. reqHeaders.Set("User-Agent", c.s.userAgent())
  14963. var body io.Reader = nil
  14964. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  14965. if err != nil {
  14966. return nil, err
  14967. }
  14968. reqHeaders.Set("Content-Type", "application/json")
  14969. c.urlParams_.Set("alt", alt)
  14970. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  14971. urls += "?" + c.urlParams_.Encode()
  14972. req, _ := http.NewRequest("POST", urls, body)
  14973. req.Header = reqHeaders
  14974. googleapi.Expand(req.URL, map[string]string{
  14975. "profileId": strconv.FormatInt(c.profileId, 10),
  14976. })
  14977. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  14978. }
  14979. // Do executes the "dfareporting.advertiserGroups.insert" call.
  14980. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  14981. // status code is an error. Response headers are in either
  14982. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  14983. // at all) in error.(*googleapi.Error).Header. Use
  14984. // googleapi.IsNotModified to check whether the returned error was
  14985. // because http.StatusNotModified was returned.
  14986. func (c *AdvertiserGroupsInsertCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  14987. gensupport.SetOptions(c.urlParams_, opts...)
  14988. res, err := c.doRequest("json")
  14989. if res != nil && res.StatusCode == http.StatusNotModified {
  14990. if res.Body != nil {
  14991. res.Body.Close()
  14992. }
  14993. return nil, &googleapi.Error{
  14994. Code: res.StatusCode,
  14995. Header: res.Header,
  14996. }
  14997. }
  14998. if err != nil {
  14999. return nil, err
  15000. }
  15001. defer googleapi.CloseBody(res)
  15002. if err := googleapi.CheckResponse(res); err != nil {
  15003. return nil, err
  15004. }
  15005. ret := &AdvertiserGroup{
  15006. ServerResponse: googleapi.ServerResponse{
  15007. Header: res.Header,
  15008. HTTPStatusCode: res.StatusCode,
  15009. },
  15010. }
  15011. target := &ret
  15012. if err := gensupport.DecodeResponse(target, res); err != nil {
  15013. return nil, err
  15014. }
  15015. return ret, nil
  15016. // {
  15017. // "description": "Inserts a new advertiser group.",
  15018. // "httpMethod": "POST",
  15019. // "id": "dfareporting.advertiserGroups.insert",
  15020. // "parameterOrder": [
  15021. // "profileId"
  15022. // ],
  15023. // "parameters": {
  15024. // "profileId": {
  15025. // "description": "User profile ID associated with this request.",
  15026. // "format": "int64",
  15027. // "location": "path",
  15028. // "required": true,
  15029. // "type": "string"
  15030. // }
  15031. // },
  15032. // "path": "userprofiles/{profileId}/advertiserGroups",
  15033. // "request": {
  15034. // "$ref": "AdvertiserGroup"
  15035. // },
  15036. // "response": {
  15037. // "$ref": "AdvertiserGroup"
  15038. // },
  15039. // "scopes": [
  15040. // "https://www.googleapis.com/auth/dfatrafficking"
  15041. // ]
  15042. // }
  15043. }
  15044. // method id "dfareporting.advertiserGroups.list":
  15045. type AdvertiserGroupsListCall struct {
  15046. s *Service
  15047. profileId int64
  15048. urlParams_ gensupport.URLParams
  15049. ifNoneMatch_ string
  15050. ctx_ context.Context
  15051. header_ http.Header
  15052. }
  15053. // List: Retrieves a list of advertiser groups, possibly filtered. This
  15054. // method supports paging.
  15055. func (r *AdvertiserGroupsService) List(profileId int64) *AdvertiserGroupsListCall {
  15056. c := &AdvertiserGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15057. c.profileId = profileId
  15058. return c
  15059. }
  15060. // Ids sets the optional parameter "ids": Select only advertiser groups
  15061. // with these IDs.
  15062. func (c *AdvertiserGroupsListCall) Ids(ids ...int64) *AdvertiserGroupsListCall {
  15063. var ids_ []string
  15064. for _, v := range ids {
  15065. ids_ = append(ids_, fmt.Sprint(v))
  15066. }
  15067. c.urlParams_.SetMulti("ids", ids_)
  15068. return c
  15069. }
  15070. // MaxResults sets the optional parameter "maxResults": Maximum number
  15071. // of results to return.
  15072. func (c *AdvertiserGroupsListCall) MaxResults(maxResults int64) *AdvertiserGroupsListCall {
  15073. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15074. return c
  15075. }
  15076. // PageToken sets the optional parameter "pageToken": Value of the
  15077. // nextPageToken from the previous result page.
  15078. func (c *AdvertiserGroupsListCall) PageToken(pageToken string) *AdvertiserGroupsListCall {
  15079. c.urlParams_.Set("pageToken", pageToken)
  15080. return c
  15081. }
  15082. // SearchString sets the optional parameter "searchString": Allows
  15083. // searching for objects by name or ID. Wildcards (*) are allowed. For
  15084. // example, "advertiser*2015" will return objects with names like
  15085. // "advertiser group June 2015", "advertiser group April 2015", or
  15086. // simply "advertiser group 2015". Most of the searches also add
  15087. // wildcards implicitly at the start and the end of the search string.
  15088. // For example, a search string of "advertisergroup" will match objects
  15089. // with name "my advertisergroup", "advertisergroup 2015", or simply
  15090. // "advertisergroup".
  15091. func (c *AdvertiserGroupsListCall) SearchString(searchString string) *AdvertiserGroupsListCall {
  15092. c.urlParams_.Set("searchString", searchString)
  15093. return c
  15094. }
  15095. // SortField sets the optional parameter "sortField": Field by which to
  15096. // sort the list.
  15097. //
  15098. // Possible values:
  15099. // "ID" (default)
  15100. // "NAME"
  15101. func (c *AdvertiserGroupsListCall) SortField(sortField string) *AdvertiserGroupsListCall {
  15102. c.urlParams_.Set("sortField", sortField)
  15103. return c
  15104. }
  15105. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  15106. // results.
  15107. //
  15108. // Possible values:
  15109. // "ASCENDING" (default)
  15110. // "DESCENDING"
  15111. func (c *AdvertiserGroupsListCall) SortOrder(sortOrder string) *AdvertiserGroupsListCall {
  15112. c.urlParams_.Set("sortOrder", sortOrder)
  15113. return c
  15114. }
  15115. // Fields allows partial responses to be retrieved. See
  15116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15117. // for more information.
  15118. func (c *AdvertiserGroupsListCall) Fields(s ...googleapi.Field) *AdvertiserGroupsListCall {
  15119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15120. return c
  15121. }
  15122. // IfNoneMatch sets the optional parameter which makes the operation
  15123. // fail if the object's ETag matches the given value. This is useful for
  15124. // getting updates only after the object has changed since the last
  15125. // request. Use googleapi.IsNotModified to check whether the response
  15126. // error from Do is the result of In-None-Match.
  15127. func (c *AdvertiserGroupsListCall) IfNoneMatch(entityTag string) *AdvertiserGroupsListCall {
  15128. c.ifNoneMatch_ = entityTag
  15129. return c
  15130. }
  15131. // Context sets the context to be used in this call's Do method. Any
  15132. // pending HTTP request will be aborted if the provided context is
  15133. // canceled.
  15134. func (c *AdvertiserGroupsListCall) Context(ctx context.Context) *AdvertiserGroupsListCall {
  15135. c.ctx_ = ctx
  15136. return c
  15137. }
  15138. // Header returns an http.Header that can be modified by the caller to
  15139. // add HTTP headers to the request.
  15140. func (c *AdvertiserGroupsListCall) Header() http.Header {
  15141. if c.header_ == nil {
  15142. c.header_ = make(http.Header)
  15143. }
  15144. return c.header_
  15145. }
  15146. func (c *AdvertiserGroupsListCall) doRequest(alt string) (*http.Response, error) {
  15147. reqHeaders := make(http.Header)
  15148. for k, v := range c.header_ {
  15149. reqHeaders[k] = v
  15150. }
  15151. reqHeaders.Set("User-Agent", c.s.userAgent())
  15152. if c.ifNoneMatch_ != "" {
  15153. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15154. }
  15155. var body io.Reader = nil
  15156. c.urlParams_.Set("alt", alt)
  15157. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15158. urls += "?" + c.urlParams_.Encode()
  15159. req, _ := http.NewRequest("GET", urls, body)
  15160. req.Header = reqHeaders
  15161. googleapi.Expand(req.URL, map[string]string{
  15162. "profileId": strconv.FormatInt(c.profileId, 10),
  15163. })
  15164. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15165. }
  15166. // Do executes the "dfareporting.advertiserGroups.list" call.
  15167. // Exactly one of *AdvertiserGroupsListResponse or error will be
  15168. // non-nil. Any non-2xx status code is an error. Response headers are in
  15169. // either *AdvertiserGroupsListResponse.ServerResponse.Header or (if a
  15170. // response was returned at all) in error.(*googleapi.Error).Header. Use
  15171. // googleapi.IsNotModified to check whether the returned error was
  15172. // because http.StatusNotModified was returned.
  15173. func (c *AdvertiserGroupsListCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroupsListResponse, error) {
  15174. gensupport.SetOptions(c.urlParams_, opts...)
  15175. res, err := c.doRequest("json")
  15176. if res != nil && res.StatusCode == http.StatusNotModified {
  15177. if res.Body != nil {
  15178. res.Body.Close()
  15179. }
  15180. return nil, &googleapi.Error{
  15181. Code: res.StatusCode,
  15182. Header: res.Header,
  15183. }
  15184. }
  15185. if err != nil {
  15186. return nil, err
  15187. }
  15188. defer googleapi.CloseBody(res)
  15189. if err := googleapi.CheckResponse(res); err != nil {
  15190. return nil, err
  15191. }
  15192. ret := &AdvertiserGroupsListResponse{
  15193. ServerResponse: googleapi.ServerResponse{
  15194. Header: res.Header,
  15195. HTTPStatusCode: res.StatusCode,
  15196. },
  15197. }
  15198. target := &ret
  15199. if err := gensupport.DecodeResponse(target, res); err != nil {
  15200. return nil, err
  15201. }
  15202. return ret, nil
  15203. // {
  15204. // "description": "Retrieves a list of advertiser groups, possibly filtered. This method supports paging.",
  15205. // "httpMethod": "GET",
  15206. // "id": "dfareporting.advertiserGroups.list",
  15207. // "parameterOrder": [
  15208. // "profileId"
  15209. // ],
  15210. // "parameters": {
  15211. // "ids": {
  15212. // "description": "Select only advertiser groups with these IDs.",
  15213. // "format": "int64",
  15214. // "location": "query",
  15215. // "repeated": true,
  15216. // "type": "string"
  15217. // },
  15218. // "maxResults": {
  15219. // "default": "1000",
  15220. // "description": "Maximum number of results to return.",
  15221. // "format": "int32",
  15222. // "location": "query",
  15223. // "maximum": "1000",
  15224. // "minimum": "0",
  15225. // "type": "integer"
  15226. // },
  15227. // "pageToken": {
  15228. // "description": "Value of the nextPageToken from the previous result page.",
  15229. // "location": "query",
  15230. // "type": "string"
  15231. // },
  15232. // "profileId": {
  15233. // "description": "User profile ID associated with this request.",
  15234. // "format": "int64",
  15235. // "location": "path",
  15236. // "required": true,
  15237. // "type": "string"
  15238. // },
  15239. // "searchString": {
  15240. // "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\".",
  15241. // "location": "query",
  15242. // "type": "string"
  15243. // },
  15244. // "sortField": {
  15245. // "default": "ID",
  15246. // "description": "Field by which to sort the list.",
  15247. // "enum": [
  15248. // "ID",
  15249. // "NAME"
  15250. // ],
  15251. // "enumDescriptions": [
  15252. // "",
  15253. // ""
  15254. // ],
  15255. // "location": "query",
  15256. // "type": "string"
  15257. // },
  15258. // "sortOrder": {
  15259. // "default": "ASCENDING",
  15260. // "description": "Order of sorted results.",
  15261. // "enum": [
  15262. // "ASCENDING",
  15263. // "DESCENDING"
  15264. // ],
  15265. // "enumDescriptions": [
  15266. // "",
  15267. // ""
  15268. // ],
  15269. // "location": "query",
  15270. // "type": "string"
  15271. // }
  15272. // },
  15273. // "path": "userprofiles/{profileId}/advertiserGroups",
  15274. // "response": {
  15275. // "$ref": "AdvertiserGroupsListResponse"
  15276. // },
  15277. // "scopes": [
  15278. // "https://www.googleapis.com/auth/dfatrafficking"
  15279. // ]
  15280. // }
  15281. }
  15282. // Pages invokes f for each page of results.
  15283. // A non-nil error returned from f will halt the iteration.
  15284. // The provided context supersedes any context provided to the Context method.
  15285. func (c *AdvertiserGroupsListCall) Pages(ctx context.Context, f func(*AdvertiserGroupsListResponse) error) error {
  15286. c.ctx_ = ctx
  15287. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  15288. for {
  15289. x, err := c.Do()
  15290. if err != nil {
  15291. return err
  15292. }
  15293. if err := f(x); err != nil {
  15294. return err
  15295. }
  15296. if x.NextPageToken == "" {
  15297. return nil
  15298. }
  15299. c.PageToken(x.NextPageToken)
  15300. }
  15301. }
  15302. // method id "dfareporting.advertiserGroups.patch":
  15303. type AdvertiserGroupsPatchCall struct {
  15304. s *Service
  15305. profileId int64
  15306. advertisergroup *AdvertiserGroup
  15307. urlParams_ gensupport.URLParams
  15308. ctx_ context.Context
  15309. header_ http.Header
  15310. }
  15311. // Patch: Updates an existing advertiser group. This method supports
  15312. // patch semantics.
  15313. func (r *AdvertiserGroupsService) Patch(profileId int64, id int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsPatchCall {
  15314. c := &AdvertiserGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15315. c.profileId = profileId
  15316. c.urlParams_.Set("id", fmt.Sprint(id))
  15317. c.advertisergroup = advertisergroup
  15318. return c
  15319. }
  15320. // Fields allows partial responses to be retrieved. See
  15321. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15322. // for more information.
  15323. func (c *AdvertiserGroupsPatchCall) Fields(s ...googleapi.Field) *AdvertiserGroupsPatchCall {
  15324. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15325. return c
  15326. }
  15327. // Context sets the context to be used in this call's Do method. Any
  15328. // pending HTTP request will be aborted if the provided context is
  15329. // canceled.
  15330. func (c *AdvertiserGroupsPatchCall) Context(ctx context.Context) *AdvertiserGroupsPatchCall {
  15331. c.ctx_ = ctx
  15332. return c
  15333. }
  15334. // Header returns an http.Header that can be modified by the caller to
  15335. // add HTTP headers to the request.
  15336. func (c *AdvertiserGroupsPatchCall) Header() http.Header {
  15337. if c.header_ == nil {
  15338. c.header_ = make(http.Header)
  15339. }
  15340. return c.header_
  15341. }
  15342. func (c *AdvertiserGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  15343. reqHeaders := make(http.Header)
  15344. for k, v := range c.header_ {
  15345. reqHeaders[k] = v
  15346. }
  15347. reqHeaders.Set("User-Agent", c.s.userAgent())
  15348. var body io.Reader = nil
  15349. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15350. if err != nil {
  15351. return nil, err
  15352. }
  15353. reqHeaders.Set("Content-Type", "application/json")
  15354. c.urlParams_.Set("alt", alt)
  15355. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15356. urls += "?" + c.urlParams_.Encode()
  15357. req, _ := http.NewRequest("PATCH", urls, body)
  15358. req.Header = reqHeaders
  15359. googleapi.Expand(req.URL, map[string]string{
  15360. "profileId": strconv.FormatInt(c.profileId, 10),
  15361. })
  15362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15363. }
  15364. // Do executes the "dfareporting.advertiserGroups.patch" call.
  15365. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15366. // status code is an error. Response headers are in either
  15367. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15368. // at all) in error.(*googleapi.Error).Header. Use
  15369. // googleapi.IsNotModified to check whether the returned error was
  15370. // because http.StatusNotModified was returned.
  15371. func (c *AdvertiserGroupsPatchCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15372. gensupport.SetOptions(c.urlParams_, opts...)
  15373. res, err := c.doRequest("json")
  15374. if res != nil && res.StatusCode == http.StatusNotModified {
  15375. if res.Body != nil {
  15376. res.Body.Close()
  15377. }
  15378. return nil, &googleapi.Error{
  15379. Code: res.StatusCode,
  15380. Header: res.Header,
  15381. }
  15382. }
  15383. if err != nil {
  15384. return nil, err
  15385. }
  15386. defer googleapi.CloseBody(res)
  15387. if err := googleapi.CheckResponse(res); err != nil {
  15388. return nil, err
  15389. }
  15390. ret := &AdvertiserGroup{
  15391. ServerResponse: googleapi.ServerResponse{
  15392. Header: res.Header,
  15393. HTTPStatusCode: res.StatusCode,
  15394. },
  15395. }
  15396. target := &ret
  15397. if err := gensupport.DecodeResponse(target, res); err != nil {
  15398. return nil, err
  15399. }
  15400. return ret, nil
  15401. // {
  15402. // "description": "Updates an existing advertiser group. This method supports patch semantics.",
  15403. // "httpMethod": "PATCH",
  15404. // "id": "dfareporting.advertiserGroups.patch",
  15405. // "parameterOrder": [
  15406. // "profileId",
  15407. // "id"
  15408. // ],
  15409. // "parameters": {
  15410. // "id": {
  15411. // "description": "Advertiser group ID.",
  15412. // "format": "int64",
  15413. // "location": "query",
  15414. // "required": true,
  15415. // "type": "string"
  15416. // },
  15417. // "profileId": {
  15418. // "description": "User profile ID associated with this request.",
  15419. // "format": "int64",
  15420. // "location": "path",
  15421. // "required": true,
  15422. // "type": "string"
  15423. // }
  15424. // },
  15425. // "path": "userprofiles/{profileId}/advertiserGroups",
  15426. // "request": {
  15427. // "$ref": "AdvertiserGroup"
  15428. // },
  15429. // "response": {
  15430. // "$ref": "AdvertiserGroup"
  15431. // },
  15432. // "scopes": [
  15433. // "https://www.googleapis.com/auth/dfatrafficking"
  15434. // ]
  15435. // }
  15436. }
  15437. // method id "dfareporting.advertiserGroups.update":
  15438. type AdvertiserGroupsUpdateCall struct {
  15439. s *Service
  15440. profileId int64
  15441. advertisergroup *AdvertiserGroup
  15442. urlParams_ gensupport.URLParams
  15443. ctx_ context.Context
  15444. header_ http.Header
  15445. }
  15446. // Update: Updates an existing advertiser group.
  15447. func (r *AdvertiserGroupsService) Update(profileId int64, advertisergroup *AdvertiserGroup) *AdvertiserGroupsUpdateCall {
  15448. c := &AdvertiserGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15449. c.profileId = profileId
  15450. c.advertisergroup = advertisergroup
  15451. return c
  15452. }
  15453. // Fields allows partial responses to be retrieved. See
  15454. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15455. // for more information.
  15456. func (c *AdvertiserGroupsUpdateCall) Fields(s ...googleapi.Field) *AdvertiserGroupsUpdateCall {
  15457. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15458. return c
  15459. }
  15460. // Context sets the context to be used in this call's Do method. Any
  15461. // pending HTTP request will be aborted if the provided context is
  15462. // canceled.
  15463. func (c *AdvertiserGroupsUpdateCall) Context(ctx context.Context) *AdvertiserGroupsUpdateCall {
  15464. c.ctx_ = ctx
  15465. return c
  15466. }
  15467. // Header returns an http.Header that can be modified by the caller to
  15468. // add HTTP headers to the request.
  15469. func (c *AdvertiserGroupsUpdateCall) Header() http.Header {
  15470. if c.header_ == nil {
  15471. c.header_ = make(http.Header)
  15472. }
  15473. return c.header_
  15474. }
  15475. func (c *AdvertiserGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  15476. reqHeaders := make(http.Header)
  15477. for k, v := range c.header_ {
  15478. reqHeaders[k] = v
  15479. }
  15480. reqHeaders.Set("User-Agent", c.s.userAgent())
  15481. var body io.Reader = nil
  15482. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertisergroup)
  15483. if err != nil {
  15484. return nil, err
  15485. }
  15486. reqHeaders.Set("Content-Type", "application/json")
  15487. c.urlParams_.Set("alt", alt)
  15488. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertiserGroups")
  15489. urls += "?" + c.urlParams_.Encode()
  15490. req, _ := http.NewRequest("PUT", urls, body)
  15491. req.Header = reqHeaders
  15492. googleapi.Expand(req.URL, map[string]string{
  15493. "profileId": strconv.FormatInt(c.profileId, 10),
  15494. })
  15495. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15496. }
  15497. // Do executes the "dfareporting.advertiserGroups.update" call.
  15498. // Exactly one of *AdvertiserGroup or error will be non-nil. Any non-2xx
  15499. // status code is an error. Response headers are in either
  15500. // *AdvertiserGroup.ServerResponse.Header or (if a response was returned
  15501. // at all) in error.(*googleapi.Error).Header. Use
  15502. // googleapi.IsNotModified to check whether the returned error was
  15503. // because http.StatusNotModified was returned.
  15504. func (c *AdvertiserGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*AdvertiserGroup, error) {
  15505. gensupport.SetOptions(c.urlParams_, opts...)
  15506. res, err := c.doRequest("json")
  15507. if res != nil && res.StatusCode == http.StatusNotModified {
  15508. if res.Body != nil {
  15509. res.Body.Close()
  15510. }
  15511. return nil, &googleapi.Error{
  15512. Code: res.StatusCode,
  15513. Header: res.Header,
  15514. }
  15515. }
  15516. if err != nil {
  15517. return nil, err
  15518. }
  15519. defer googleapi.CloseBody(res)
  15520. if err := googleapi.CheckResponse(res); err != nil {
  15521. return nil, err
  15522. }
  15523. ret := &AdvertiserGroup{
  15524. ServerResponse: googleapi.ServerResponse{
  15525. Header: res.Header,
  15526. HTTPStatusCode: res.StatusCode,
  15527. },
  15528. }
  15529. target := &ret
  15530. if err := gensupport.DecodeResponse(target, res); err != nil {
  15531. return nil, err
  15532. }
  15533. return ret, nil
  15534. // {
  15535. // "description": "Updates an existing advertiser group.",
  15536. // "httpMethod": "PUT",
  15537. // "id": "dfareporting.advertiserGroups.update",
  15538. // "parameterOrder": [
  15539. // "profileId"
  15540. // ],
  15541. // "parameters": {
  15542. // "profileId": {
  15543. // "description": "User profile ID associated with this request.",
  15544. // "format": "int64",
  15545. // "location": "path",
  15546. // "required": true,
  15547. // "type": "string"
  15548. // }
  15549. // },
  15550. // "path": "userprofiles/{profileId}/advertiserGroups",
  15551. // "request": {
  15552. // "$ref": "AdvertiserGroup"
  15553. // },
  15554. // "response": {
  15555. // "$ref": "AdvertiserGroup"
  15556. // },
  15557. // "scopes": [
  15558. // "https://www.googleapis.com/auth/dfatrafficking"
  15559. // ]
  15560. // }
  15561. }
  15562. // method id "dfareporting.advertisers.get":
  15563. type AdvertisersGetCall struct {
  15564. s *Service
  15565. profileId int64
  15566. id int64
  15567. urlParams_ gensupport.URLParams
  15568. ifNoneMatch_ string
  15569. ctx_ context.Context
  15570. header_ http.Header
  15571. }
  15572. // Get: Gets one advertiser by ID.
  15573. func (r *AdvertisersService) Get(profileId int64, id int64) *AdvertisersGetCall {
  15574. c := &AdvertisersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15575. c.profileId = profileId
  15576. c.id = id
  15577. return c
  15578. }
  15579. // Fields allows partial responses to be retrieved. See
  15580. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15581. // for more information.
  15582. func (c *AdvertisersGetCall) Fields(s ...googleapi.Field) *AdvertisersGetCall {
  15583. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15584. return c
  15585. }
  15586. // IfNoneMatch sets the optional parameter which makes the operation
  15587. // fail if the object's ETag matches the given value. This is useful for
  15588. // getting updates only after the object has changed since the last
  15589. // request. Use googleapi.IsNotModified to check whether the response
  15590. // error from Do is the result of In-None-Match.
  15591. func (c *AdvertisersGetCall) IfNoneMatch(entityTag string) *AdvertisersGetCall {
  15592. c.ifNoneMatch_ = entityTag
  15593. return c
  15594. }
  15595. // Context sets the context to be used in this call's Do method. Any
  15596. // pending HTTP request will be aborted if the provided context is
  15597. // canceled.
  15598. func (c *AdvertisersGetCall) Context(ctx context.Context) *AdvertisersGetCall {
  15599. c.ctx_ = ctx
  15600. return c
  15601. }
  15602. // Header returns an http.Header that can be modified by the caller to
  15603. // add HTTP headers to the request.
  15604. func (c *AdvertisersGetCall) Header() http.Header {
  15605. if c.header_ == nil {
  15606. c.header_ = make(http.Header)
  15607. }
  15608. return c.header_
  15609. }
  15610. func (c *AdvertisersGetCall) doRequest(alt string) (*http.Response, error) {
  15611. reqHeaders := make(http.Header)
  15612. for k, v := range c.header_ {
  15613. reqHeaders[k] = v
  15614. }
  15615. reqHeaders.Set("User-Agent", c.s.userAgent())
  15616. if c.ifNoneMatch_ != "" {
  15617. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15618. }
  15619. var body io.Reader = nil
  15620. c.urlParams_.Set("alt", alt)
  15621. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers/{id}")
  15622. urls += "?" + c.urlParams_.Encode()
  15623. req, _ := http.NewRequest("GET", urls, body)
  15624. req.Header = reqHeaders
  15625. googleapi.Expand(req.URL, map[string]string{
  15626. "profileId": strconv.FormatInt(c.profileId, 10),
  15627. "id": strconv.FormatInt(c.id, 10),
  15628. })
  15629. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15630. }
  15631. // Do executes the "dfareporting.advertisers.get" call.
  15632. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  15633. // status code is an error. Response headers are in either
  15634. // *Advertiser.ServerResponse.Header or (if a response was returned at
  15635. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15636. // to check whether the returned error was because
  15637. // http.StatusNotModified was returned.
  15638. func (c *AdvertisersGetCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  15639. gensupport.SetOptions(c.urlParams_, opts...)
  15640. res, err := c.doRequest("json")
  15641. if res != nil && res.StatusCode == http.StatusNotModified {
  15642. if res.Body != nil {
  15643. res.Body.Close()
  15644. }
  15645. return nil, &googleapi.Error{
  15646. Code: res.StatusCode,
  15647. Header: res.Header,
  15648. }
  15649. }
  15650. if err != nil {
  15651. return nil, err
  15652. }
  15653. defer googleapi.CloseBody(res)
  15654. if err := googleapi.CheckResponse(res); err != nil {
  15655. return nil, err
  15656. }
  15657. ret := &Advertiser{
  15658. ServerResponse: googleapi.ServerResponse{
  15659. Header: res.Header,
  15660. HTTPStatusCode: res.StatusCode,
  15661. },
  15662. }
  15663. target := &ret
  15664. if err := gensupport.DecodeResponse(target, res); err != nil {
  15665. return nil, err
  15666. }
  15667. return ret, nil
  15668. // {
  15669. // "description": "Gets one advertiser by ID.",
  15670. // "httpMethod": "GET",
  15671. // "id": "dfareporting.advertisers.get",
  15672. // "parameterOrder": [
  15673. // "profileId",
  15674. // "id"
  15675. // ],
  15676. // "parameters": {
  15677. // "id": {
  15678. // "description": "Advertiser ID.",
  15679. // "format": "int64",
  15680. // "location": "path",
  15681. // "required": true,
  15682. // "type": "string"
  15683. // },
  15684. // "profileId": {
  15685. // "description": "User profile ID associated with this request.",
  15686. // "format": "int64",
  15687. // "location": "path",
  15688. // "required": true,
  15689. // "type": "string"
  15690. // }
  15691. // },
  15692. // "path": "userprofiles/{profileId}/advertisers/{id}",
  15693. // "response": {
  15694. // "$ref": "Advertiser"
  15695. // },
  15696. // "scopes": [
  15697. // "https://www.googleapis.com/auth/dfatrafficking"
  15698. // ]
  15699. // }
  15700. }
  15701. // method id "dfareporting.advertisers.insert":
  15702. type AdvertisersInsertCall struct {
  15703. s *Service
  15704. profileId int64
  15705. advertiser *Advertiser
  15706. urlParams_ gensupport.URLParams
  15707. ctx_ context.Context
  15708. header_ http.Header
  15709. }
  15710. // Insert: Inserts a new advertiser.
  15711. func (r *AdvertisersService) Insert(profileId int64, advertiser *Advertiser) *AdvertisersInsertCall {
  15712. c := &AdvertisersInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15713. c.profileId = profileId
  15714. c.advertiser = advertiser
  15715. return c
  15716. }
  15717. // Fields allows partial responses to be retrieved. See
  15718. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15719. // for more information.
  15720. func (c *AdvertisersInsertCall) Fields(s ...googleapi.Field) *AdvertisersInsertCall {
  15721. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15722. return c
  15723. }
  15724. // Context sets the context to be used in this call's Do method. Any
  15725. // pending HTTP request will be aborted if the provided context is
  15726. // canceled.
  15727. func (c *AdvertisersInsertCall) Context(ctx context.Context) *AdvertisersInsertCall {
  15728. c.ctx_ = ctx
  15729. return c
  15730. }
  15731. // Header returns an http.Header that can be modified by the caller to
  15732. // add HTTP headers to the request.
  15733. func (c *AdvertisersInsertCall) Header() http.Header {
  15734. if c.header_ == nil {
  15735. c.header_ = make(http.Header)
  15736. }
  15737. return c.header_
  15738. }
  15739. func (c *AdvertisersInsertCall) doRequest(alt string) (*http.Response, error) {
  15740. reqHeaders := make(http.Header)
  15741. for k, v := range c.header_ {
  15742. reqHeaders[k] = v
  15743. }
  15744. reqHeaders.Set("User-Agent", c.s.userAgent())
  15745. var body io.Reader = nil
  15746. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  15747. if err != nil {
  15748. return nil, err
  15749. }
  15750. reqHeaders.Set("Content-Type", "application/json")
  15751. c.urlParams_.Set("alt", alt)
  15752. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  15753. urls += "?" + c.urlParams_.Encode()
  15754. req, _ := http.NewRequest("POST", urls, body)
  15755. req.Header = reqHeaders
  15756. googleapi.Expand(req.URL, map[string]string{
  15757. "profileId": strconv.FormatInt(c.profileId, 10),
  15758. })
  15759. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15760. }
  15761. // Do executes the "dfareporting.advertisers.insert" call.
  15762. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  15763. // status code is an error. Response headers are in either
  15764. // *Advertiser.ServerResponse.Header or (if a response was returned at
  15765. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  15766. // to check whether the returned error was because
  15767. // http.StatusNotModified was returned.
  15768. func (c *AdvertisersInsertCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  15769. gensupport.SetOptions(c.urlParams_, opts...)
  15770. res, err := c.doRequest("json")
  15771. if res != nil && res.StatusCode == http.StatusNotModified {
  15772. if res.Body != nil {
  15773. res.Body.Close()
  15774. }
  15775. return nil, &googleapi.Error{
  15776. Code: res.StatusCode,
  15777. Header: res.Header,
  15778. }
  15779. }
  15780. if err != nil {
  15781. return nil, err
  15782. }
  15783. defer googleapi.CloseBody(res)
  15784. if err := googleapi.CheckResponse(res); err != nil {
  15785. return nil, err
  15786. }
  15787. ret := &Advertiser{
  15788. ServerResponse: googleapi.ServerResponse{
  15789. Header: res.Header,
  15790. HTTPStatusCode: res.StatusCode,
  15791. },
  15792. }
  15793. target := &ret
  15794. if err := gensupport.DecodeResponse(target, res); err != nil {
  15795. return nil, err
  15796. }
  15797. return ret, nil
  15798. // {
  15799. // "description": "Inserts a new advertiser.",
  15800. // "httpMethod": "POST",
  15801. // "id": "dfareporting.advertisers.insert",
  15802. // "parameterOrder": [
  15803. // "profileId"
  15804. // ],
  15805. // "parameters": {
  15806. // "profileId": {
  15807. // "description": "User profile ID associated with this request.",
  15808. // "format": "int64",
  15809. // "location": "path",
  15810. // "required": true,
  15811. // "type": "string"
  15812. // }
  15813. // },
  15814. // "path": "userprofiles/{profileId}/advertisers",
  15815. // "request": {
  15816. // "$ref": "Advertiser"
  15817. // },
  15818. // "response": {
  15819. // "$ref": "Advertiser"
  15820. // },
  15821. // "scopes": [
  15822. // "https://www.googleapis.com/auth/dfatrafficking"
  15823. // ]
  15824. // }
  15825. }
  15826. // method id "dfareporting.advertisers.list":
  15827. type AdvertisersListCall struct {
  15828. s *Service
  15829. profileId int64
  15830. urlParams_ gensupport.URLParams
  15831. ifNoneMatch_ string
  15832. ctx_ context.Context
  15833. header_ http.Header
  15834. }
  15835. // List: Retrieves a list of advertisers, possibly filtered. This method
  15836. // supports paging.
  15837. func (r *AdvertisersService) List(profileId int64) *AdvertisersListCall {
  15838. c := &AdvertisersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  15839. c.profileId = profileId
  15840. return c
  15841. }
  15842. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  15843. // Select only advertisers with these advertiser group IDs.
  15844. func (c *AdvertisersListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *AdvertisersListCall {
  15845. var advertiserGroupIds_ []string
  15846. for _, v := range advertiserGroupIds {
  15847. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  15848. }
  15849. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  15850. return c
  15851. }
  15852. // FloodlightConfigurationIds sets the optional parameter
  15853. // "floodlightConfigurationIds": Select only advertisers with these
  15854. // floodlight configuration IDs.
  15855. func (c *AdvertisersListCall) FloodlightConfigurationIds(floodlightConfigurationIds ...int64) *AdvertisersListCall {
  15856. var floodlightConfigurationIds_ []string
  15857. for _, v := range floodlightConfigurationIds {
  15858. floodlightConfigurationIds_ = append(floodlightConfigurationIds_, fmt.Sprint(v))
  15859. }
  15860. c.urlParams_.SetMulti("floodlightConfigurationIds", floodlightConfigurationIds_)
  15861. return c
  15862. }
  15863. // Ids sets the optional parameter "ids": Select only advertisers with
  15864. // these IDs.
  15865. func (c *AdvertisersListCall) Ids(ids ...int64) *AdvertisersListCall {
  15866. var ids_ []string
  15867. for _, v := range ids {
  15868. ids_ = append(ids_, fmt.Sprint(v))
  15869. }
  15870. c.urlParams_.SetMulti("ids", ids_)
  15871. return c
  15872. }
  15873. // IncludeAdvertisersWithoutGroupsOnly sets the optional parameter
  15874. // "includeAdvertisersWithoutGroupsOnly": Select only advertisers which
  15875. // do not belong to any advertiser group.
  15876. func (c *AdvertisersListCall) IncludeAdvertisersWithoutGroupsOnly(includeAdvertisersWithoutGroupsOnly bool) *AdvertisersListCall {
  15877. c.urlParams_.Set("includeAdvertisersWithoutGroupsOnly", fmt.Sprint(includeAdvertisersWithoutGroupsOnly))
  15878. return c
  15879. }
  15880. // MaxResults sets the optional parameter "maxResults": Maximum number
  15881. // of results to return.
  15882. func (c *AdvertisersListCall) MaxResults(maxResults int64) *AdvertisersListCall {
  15883. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  15884. return c
  15885. }
  15886. // OnlyParent sets the optional parameter "onlyParent": Select only
  15887. // advertisers which use another advertiser's floodlight configuration.
  15888. func (c *AdvertisersListCall) OnlyParent(onlyParent bool) *AdvertisersListCall {
  15889. c.urlParams_.Set("onlyParent", fmt.Sprint(onlyParent))
  15890. return c
  15891. }
  15892. // PageToken sets the optional parameter "pageToken": Value of the
  15893. // nextPageToken from the previous result page.
  15894. func (c *AdvertisersListCall) PageToken(pageToken string) *AdvertisersListCall {
  15895. c.urlParams_.Set("pageToken", pageToken)
  15896. return c
  15897. }
  15898. // SearchString sets the optional parameter "searchString": Allows
  15899. // searching for objects by name or ID. Wildcards (*) are allowed. For
  15900. // example, "advertiser*2015" will return objects with names like
  15901. // "advertiser June 2015", "advertiser April 2015", or simply
  15902. // "advertiser 2015". Most of the searches also add wildcards implicitly
  15903. // at the start and the end of the search string. For example, a search
  15904. // string of "advertiser" will match objects with name "my advertiser",
  15905. // "advertiser 2015", or simply "advertiser".
  15906. func (c *AdvertisersListCall) SearchString(searchString string) *AdvertisersListCall {
  15907. c.urlParams_.Set("searchString", searchString)
  15908. return c
  15909. }
  15910. // SortField sets the optional parameter "sortField": Field by which to
  15911. // sort the list.
  15912. //
  15913. // Possible values:
  15914. // "ID" (default)
  15915. // "NAME"
  15916. func (c *AdvertisersListCall) SortField(sortField string) *AdvertisersListCall {
  15917. c.urlParams_.Set("sortField", sortField)
  15918. return c
  15919. }
  15920. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  15921. // results.
  15922. //
  15923. // Possible values:
  15924. // "ASCENDING" (default)
  15925. // "DESCENDING"
  15926. func (c *AdvertisersListCall) SortOrder(sortOrder string) *AdvertisersListCall {
  15927. c.urlParams_.Set("sortOrder", sortOrder)
  15928. return c
  15929. }
  15930. // Status sets the optional parameter "status": Select only advertisers
  15931. // with the specified status.
  15932. //
  15933. // Possible values:
  15934. // "APPROVED"
  15935. // "ON_HOLD"
  15936. func (c *AdvertisersListCall) Status(status string) *AdvertisersListCall {
  15937. c.urlParams_.Set("status", status)
  15938. return c
  15939. }
  15940. // SubaccountId sets the optional parameter "subaccountId": Select only
  15941. // advertisers with these subaccount IDs.
  15942. func (c *AdvertisersListCall) SubaccountId(subaccountId int64) *AdvertisersListCall {
  15943. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  15944. return c
  15945. }
  15946. // Fields allows partial responses to be retrieved. See
  15947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  15948. // for more information.
  15949. func (c *AdvertisersListCall) Fields(s ...googleapi.Field) *AdvertisersListCall {
  15950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  15951. return c
  15952. }
  15953. // IfNoneMatch sets the optional parameter which makes the operation
  15954. // fail if the object's ETag matches the given value. This is useful for
  15955. // getting updates only after the object has changed since the last
  15956. // request. Use googleapi.IsNotModified to check whether the response
  15957. // error from Do is the result of In-None-Match.
  15958. func (c *AdvertisersListCall) IfNoneMatch(entityTag string) *AdvertisersListCall {
  15959. c.ifNoneMatch_ = entityTag
  15960. return c
  15961. }
  15962. // Context sets the context to be used in this call's Do method. Any
  15963. // pending HTTP request will be aborted if the provided context is
  15964. // canceled.
  15965. func (c *AdvertisersListCall) Context(ctx context.Context) *AdvertisersListCall {
  15966. c.ctx_ = ctx
  15967. return c
  15968. }
  15969. // Header returns an http.Header that can be modified by the caller to
  15970. // add HTTP headers to the request.
  15971. func (c *AdvertisersListCall) Header() http.Header {
  15972. if c.header_ == nil {
  15973. c.header_ = make(http.Header)
  15974. }
  15975. return c.header_
  15976. }
  15977. func (c *AdvertisersListCall) doRequest(alt string) (*http.Response, error) {
  15978. reqHeaders := make(http.Header)
  15979. for k, v := range c.header_ {
  15980. reqHeaders[k] = v
  15981. }
  15982. reqHeaders.Set("User-Agent", c.s.userAgent())
  15983. if c.ifNoneMatch_ != "" {
  15984. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  15985. }
  15986. var body io.Reader = nil
  15987. c.urlParams_.Set("alt", alt)
  15988. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  15989. urls += "?" + c.urlParams_.Encode()
  15990. req, _ := http.NewRequest("GET", urls, body)
  15991. req.Header = reqHeaders
  15992. googleapi.Expand(req.URL, map[string]string{
  15993. "profileId": strconv.FormatInt(c.profileId, 10),
  15994. })
  15995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  15996. }
  15997. // Do executes the "dfareporting.advertisers.list" call.
  15998. // Exactly one of *AdvertisersListResponse or error will be non-nil. Any
  15999. // non-2xx status code is an error. Response headers are in either
  16000. // *AdvertisersListResponse.ServerResponse.Header or (if a response was
  16001. // returned at all) in error.(*googleapi.Error).Header. Use
  16002. // googleapi.IsNotModified to check whether the returned error was
  16003. // because http.StatusNotModified was returned.
  16004. func (c *AdvertisersListCall) Do(opts ...googleapi.CallOption) (*AdvertisersListResponse, error) {
  16005. gensupport.SetOptions(c.urlParams_, opts...)
  16006. res, err := c.doRequest("json")
  16007. if res != nil && res.StatusCode == http.StatusNotModified {
  16008. if res.Body != nil {
  16009. res.Body.Close()
  16010. }
  16011. return nil, &googleapi.Error{
  16012. Code: res.StatusCode,
  16013. Header: res.Header,
  16014. }
  16015. }
  16016. if err != nil {
  16017. return nil, err
  16018. }
  16019. defer googleapi.CloseBody(res)
  16020. if err := googleapi.CheckResponse(res); err != nil {
  16021. return nil, err
  16022. }
  16023. ret := &AdvertisersListResponse{
  16024. ServerResponse: googleapi.ServerResponse{
  16025. Header: res.Header,
  16026. HTTPStatusCode: res.StatusCode,
  16027. },
  16028. }
  16029. target := &ret
  16030. if err := gensupport.DecodeResponse(target, res); err != nil {
  16031. return nil, err
  16032. }
  16033. return ret, nil
  16034. // {
  16035. // "description": "Retrieves a list of advertisers, possibly filtered. This method supports paging.",
  16036. // "httpMethod": "GET",
  16037. // "id": "dfareporting.advertisers.list",
  16038. // "parameterOrder": [
  16039. // "profileId"
  16040. // ],
  16041. // "parameters": {
  16042. // "advertiserGroupIds": {
  16043. // "description": "Select only advertisers with these advertiser group IDs.",
  16044. // "format": "int64",
  16045. // "location": "query",
  16046. // "repeated": true,
  16047. // "type": "string"
  16048. // },
  16049. // "floodlightConfigurationIds": {
  16050. // "description": "Select only advertisers with these floodlight configuration IDs.",
  16051. // "format": "int64",
  16052. // "location": "query",
  16053. // "repeated": true,
  16054. // "type": "string"
  16055. // },
  16056. // "ids": {
  16057. // "description": "Select only advertisers with these IDs.",
  16058. // "format": "int64",
  16059. // "location": "query",
  16060. // "repeated": true,
  16061. // "type": "string"
  16062. // },
  16063. // "includeAdvertisersWithoutGroupsOnly": {
  16064. // "description": "Select only advertisers which do not belong to any advertiser group.",
  16065. // "location": "query",
  16066. // "type": "boolean"
  16067. // },
  16068. // "maxResults": {
  16069. // "default": "1000",
  16070. // "description": "Maximum number of results to return.",
  16071. // "format": "int32",
  16072. // "location": "query",
  16073. // "maximum": "1000",
  16074. // "minimum": "0",
  16075. // "type": "integer"
  16076. // },
  16077. // "onlyParent": {
  16078. // "description": "Select only advertisers which use another advertiser's floodlight configuration.",
  16079. // "location": "query",
  16080. // "type": "boolean"
  16081. // },
  16082. // "pageToken": {
  16083. // "description": "Value of the nextPageToken from the previous result page.",
  16084. // "location": "query",
  16085. // "type": "string"
  16086. // },
  16087. // "profileId": {
  16088. // "description": "User profile ID associated with this request.",
  16089. // "format": "int64",
  16090. // "location": "path",
  16091. // "required": true,
  16092. // "type": "string"
  16093. // },
  16094. // "searchString": {
  16095. // "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\".",
  16096. // "location": "query",
  16097. // "type": "string"
  16098. // },
  16099. // "sortField": {
  16100. // "default": "ID",
  16101. // "description": "Field by which to sort the list.",
  16102. // "enum": [
  16103. // "ID",
  16104. // "NAME"
  16105. // ],
  16106. // "enumDescriptions": [
  16107. // "",
  16108. // ""
  16109. // ],
  16110. // "location": "query",
  16111. // "type": "string"
  16112. // },
  16113. // "sortOrder": {
  16114. // "default": "ASCENDING",
  16115. // "description": "Order of sorted results.",
  16116. // "enum": [
  16117. // "ASCENDING",
  16118. // "DESCENDING"
  16119. // ],
  16120. // "enumDescriptions": [
  16121. // "",
  16122. // ""
  16123. // ],
  16124. // "location": "query",
  16125. // "type": "string"
  16126. // },
  16127. // "status": {
  16128. // "description": "Select only advertisers with the specified status.",
  16129. // "enum": [
  16130. // "APPROVED",
  16131. // "ON_HOLD"
  16132. // ],
  16133. // "enumDescriptions": [
  16134. // "",
  16135. // ""
  16136. // ],
  16137. // "location": "query",
  16138. // "type": "string"
  16139. // },
  16140. // "subaccountId": {
  16141. // "description": "Select only advertisers with these subaccount IDs.",
  16142. // "format": "int64",
  16143. // "location": "query",
  16144. // "type": "string"
  16145. // }
  16146. // },
  16147. // "path": "userprofiles/{profileId}/advertisers",
  16148. // "response": {
  16149. // "$ref": "AdvertisersListResponse"
  16150. // },
  16151. // "scopes": [
  16152. // "https://www.googleapis.com/auth/dfatrafficking"
  16153. // ]
  16154. // }
  16155. }
  16156. // Pages invokes f for each page of results.
  16157. // A non-nil error returned from f will halt the iteration.
  16158. // The provided context supersedes any context provided to the Context method.
  16159. func (c *AdvertisersListCall) Pages(ctx context.Context, f func(*AdvertisersListResponse) error) error {
  16160. c.ctx_ = ctx
  16161. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16162. for {
  16163. x, err := c.Do()
  16164. if err != nil {
  16165. return err
  16166. }
  16167. if err := f(x); err != nil {
  16168. return err
  16169. }
  16170. if x.NextPageToken == "" {
  16171. return nil
  16172. }
  16173. c.PageToken(x.NextPageToken)
  16174. }
  16175. }
  16176. // method id "dfareporting.advertisers.patch":
  16177. type AdvertisersPatchCall struct {
  16178. s *Service
  16179. profileId int64
  16180. advertiser *Advertiser
  16181. urlParams_ gensupport.URLParams
  16182. ctx_ context.Context
  16183. header_ http.Header
  16184. }
  16185. // Patch: Updates an existing advertiser. This method supports patch
  16186. // semantics.
  16187. func (r *AdvertisersService) Patch(profileId int64, id int64, advertiser *Advertiser) *AdvertisersPatchCall {
  16188. c := &AdvertisersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16189. c.profileId = profileId
  16190. c.urlParams_.Set("id", fmt.Sprint(id))
  16191. c.advertiser = advertiser
  16192. return c
  16193. }
  16194. // Fields allows partial responses to be retrieved. See
  16195. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16196. // for more information.
  16197. func (c *AdvertisersPatchCall) Fields(s ...googleapi.Field) *AdvertisersPatchCall {
  16198. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16199. return c
  16200. }
  16201. // Context sets the context to be used in this call's Do method. Any
  16202. // pending HTTP request will be aborted if the provided context is
  16203. // canceled.
  16204. func (c *AdvertisersPatchCall) Context(ctx context.Context) *AdvertisersPatchCall {
  16205. c.ctx_ = ctx
  16206. return c
  16207. }
  16208. // Header returns an http.Header that can be modified by the caller to
  16209. // add HTTP headers to the request.
  16210. func (c *AdvertisersPatchCall) Header() http.Header {
  16211. if c.header_ == nil {
  16212. c.header_ = make(http.Header)
  16213. }
  16214. return c.header_
  16215. }
  16216. func (c *AdvertisersPatchCall) doRequest(alt string) (*http.Response, error) {
  16217. reqHeaders := make(http.Header)
  16218. for k, v := range c.header_ {
  16219. reqHeaders[k] = v
  16220. }
  16221. reqHeaders.Set("User-Agent", c.s.userAgent())
  16222. var body io.Reader = nil
  16223. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  16224. if err != nil {
  16225. return nil, err
  16226. }
  16227. reqHeaders.Set("Content-Type", "application/json")
  16228. c.urlParams_.Set("alt", alt)
  16229. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  16230. urls += "?" + c.urlParams_.Encode()
  16231. req, _ := http.NewRequest("PATCH", urls, body)
  16232. req.Header = reqHeaders
  16233. googleapi.Expand(req.URL, map[string]string{
  16234. "profileId": strconv.FormatInt(c.profileId, 10),
  16235. })
  16236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16237. }
  16238. // Do executes the "dfareporting.advertisers.patch" call.
  16239. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  16240. // status code is an error. Response headers are in either
  16241. // *Advertiser.ServerResponse.Header or (if a response was returned at
  16242. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16243. // to check whether the returned error was because
  16244. // http.StatusNotModified was returned.
  16245. func (c *AdvertisersPatchCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  16246. gensupport.SetOptions(c.urlParams_, opts...)
  16247. res, err := c.doRequest("json")
  16248. if res != nil && res.StatusCode == http.StatusNotModified {
  16249. if res.Body != nil {
  16250. res.Body.Close()
  16251. }
  16252. return nil, &googleapi.Error{
  16253. Code: res.StatusCode,
  16254. Header: res.Header,
  16255. }
  16256. }
  16257. if err != nil {
  16258. return nil, err
  16259. }
  16260. defer googleapi.CloseBody(res)
  16261. if err := googleapi.CheckResponse(res); err != nil {
  16262. return nil, err
  16263. }
  16264. ret := &Advertiser{
  16265. ServerResponse: googleapi.ServerResponse{
  16266. Header: res.Header,
  16267. HTTPStatusCode: res.StatusCode,
  16268. },
  16269. }
  16270. target := &ret
  16271. if err := gensupport.DecodeResponse(target, res); err != nil {
  16272. return nil, err
  16273. }
  16274. return ret, nil
  16275. // {
  16276. // "description": "Updates an existing advertiser. This method supports patch semantics.",
  16277. // "httpMethod": "PATCH",
  16278. // "id": "dfareporting.advertisers.patch",
  16279. // "parameterOrder": [
  16280. // "profileId",
  16281. // "id"
  16282. // ],
  16283. // "parameters": {
  16284. // "id": {
  16285. // "description": "Advertiser ID.",
  16286. // "format": "int64",
  16287. // "location": "query",
  16288. // "required": true,
  16289. // "type": "string"
  16290. // },
  16291. // "profileId": {
  16292. // "description": "User profile ID associated with this request.",
  16293. // "format": "int64",
  16294. // "location": "path",
  16295. // "required": true,
  16296. // "type": "string"
  16297. // }
  16298. // },
  16299. // "path": "userprofiles/{profileId}/advertisers",
  16300. // "request": {
  16301. // "$ref": "Advertiser"
  16302. // },
  16303. // "response": {
  16304. // "$ref": "Advertiser"
  16305. // },
  16306. // "scopes": [
  16307. // "https://www.googleapis.com/auth/dfatrafficking"
  16308. // ]
  16309. // }
  16310. }
  16311. // method id "dfareporting.advertisers.update":
  16312. type AdvertisersUpdateCall struct {
  16313. s *Service
  16314. profileId int64
  16315. advertiser *Advertiser
  16316. urlParams_ gensupport.URLParams
  16317. ctx_ context.Context
  16318. header_ http.Header
  16319. }
  16320. // Update: Updates an existing advertiser.
  16321. func (r *AdvertisersService) Update(profileId int64, advertiser *Advertiser) *AdvertisersUpdateCall {
  16322. c := &AdvertisersUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16323. c.profileId = profileId
  16324. c.advertiser = advertiser
  16325. return c
  16326. }
  16327. // Fields allows partial responses to be retrieved. See
  16328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16329. // for more information.
  16330. func (c *AdvertisersUpdateCall) Fields(s ...googleapi.Field) *AdvertisersUpdateCall {
  16331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16332. return c
  16333. }
  16334. // Context sets the context to be used in this call's Do method. Any
  16335. // pending HTTP request will be aborted if the provided context is
  16336. // canceled.
  16337. func (c *AdvertisersUpdateCall) Context(ctx context.Context) *AdvertisersUpdateCall {
  16338. c.ctx_ = ctx
  16339. return c
  16340. }
  16341. // Header returns an http.Header that can be modified by the caller to
  16342. // add HTTP headers to the request.
  16343. func (c *AdvertisersUpdateCall) Header() http.Header {
  16344. if c.header_ == nil {
  16345. c.header_ = make(http.Header)
  16346. }
  16347. return c.header_
  16348. }
  16349. func (c *AdvertisersUpdateCall) doRequest(alt string) (*http.Response, error) {
  16350. reqHeaders := make(http.Header)
  16351. for k, v := range c.header_ {
  16352. reqHeaders[k] = v
  16353. }
  16354. reqHeaders.Set("User-Agent", c.s.userAgent())
  16355. var body io.Reader = nil
  16356. body, err := googleapi.WithoutDataWrapper.JSONReader(c.advertiser)
  16357. if err != nil {
  16358. return nil, err
  16359. }
  16360. reqHeaders.Set("Content-Type", "application/json")
  16361. c.urlParams_.Set("alt", alt)
  16362. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/advertisers")
  16363. urls += "?" + c.urlParams_.Encode()
  16364. req, _ := http.NewRequest("PUT", urls, body)
  16365. req.Header = reqHeaders
  16366. googleapi.Expand(req.URL, map[string]string{
  16367. "profileId": strconv.FormatInt(c.profileId, 10),
  16368. })
  16369. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16370. }
  16371. // Do executes the "dfareporting.advertisers.update" call.
  16372. // Exactly one of *Advertiser or error will be non-nil. Any non-2xx
  16373. // status code is an error. Response headers are in either
  16374. // *Advertiser.ServerResponse.Header or (if a response was returned at
  16375. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16376. // to check whether the returned error was because
  16377. // http.StatusNotModified was returned.
  16378. func (c *AdvertisersUpdateCall) Do(opts ...googleapi.CallOption) (*Advertiser, error) {
  16379. gensupport.SetOptions(c.urlParams_, opts...)
  16380. res, err := c.doRequest("json")
  16381. if res != nil && res.StatusCode == http.StatusNotModified {
  16382. if res.Body != nil {
  16383. res.Body.Close()
  16384. }
  16385. return nil, &googleapi.Error{
  16386. Code: res.StatusCode,
  16387. Header: res.Header,
  16388. }
  16389. }
  16390. if err != nil {
  16391. return nil, err
  16392. }
  16393. defer googleapi.CloseBody(res)
  16394. if err := googleapi.CheckResponse(res); err != nil {
  16395. return nil, err
  16396. }
  16397. ret := &Advertiser{
  16398. ServerResponse: googleapi.ServerResponse{
  16399. Header: res.Header,
  16400. HTTPStatusCode: res.StatusCode,
  16401. },
  16402. }
  16403. target := &ret
  16404. if err := gensupport.DecodeResponse(target, res); err != nil {
  16405. return nil, err
  16406. }
  16407. return ret, nil
  16408. // {
  16409. // "description": "Updates an existing advertiser.",
  16410. // "httpMethod": "PUT",
  16411. // "id": "dfareporting.advertisers.update",
  16412. // "parameterOrder": [
  16413. // "profileId"
  16414. // ],
  16415. // "parameters": {
  16416. // "profileId": {
  16417. // "description": "User profile ID associated with this request.",
  16418. // "format": "int64",
  16419. // "location": "path",
  16420. // "required": true,
  16421. // "type": "string"
  16422. // }
  16423. // },
  16424. // "path": "userprofiles/{profileId}/advertisers",
  16425. // "request": {
  16426. // "$ref": "Advertiser"
  16427. // },
  16428. // "response": {
  16429. // "$ref": "Advertiser"
  16430. // },
  16431. // "scopes": [
  16432. // "https://www.googleapis.com/auth/dfatrafficking"
  16433. // ]
  16434. // }
  16435. }
  16436. // method id "dfareporting.browsers.list":
  16437. type BrowsersListCall struct {
  16438. s *Service
  16439. profileId int64
  16440. urlParams_ gensupport.URLParams
  16441. ifNoneMatch_ string
  16442. ctx_ context.Context
  16443. header_ http.Header
  16444. }
  16445. // List: Retrieves a list of browsers.
  16446. func (r *BrowsersService) List(profileId int64) *BrowsersListCall {
  16447. c := &BrowsersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16448. c.profileId = profileId
  16449. return c
  16450. }
  16451. // Fields allows partial responses to be retrieved. See
  16452. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16453. // for more information.
  16454. func (c *BrowsersListCall) Fields(s ...googleapi.Field) *BrowsersListCall {
  16455. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16456. return c
  16457. }
  16458. // IfNoneMatch sets the optional parameter which makes the operation
  16459. // fail if the object's ETag matches the given value. This is useful for
  16460. // getting updates only after the object has changed since the last
  16461. // request. Use googleapi.IsNotModified to check whether the response
  16462. // error from Do is the result of In-None-Match.
  16463. func (c *BrowsersListCall) IfNoneMatch(entityTag string) *BrowsersListCall {
  16464. c.ifNoneMatch_ = entityTag
  16465. return c
  16466. }
  16467. // Context sets the context to be used in this call's Do method. Any
  16468. // pending HTTP request will be aborted if the provided context is
  16469. // canceled.
  16470. func (c *BrowsersListCall) Context(ctx context.Context) *BrowsersListCall {
  16471. c.ctx_ = ctx
  16472. return c
  16473. }
  16474. // Header returns an http.Header that can be modified by the caller to
  16475. // add HTTP headers to the request.
  16476. func (c *BrowsersListCall) Header() http.Header {
  16477. if c.header_ == nil {
  16478. c.header_ = make(http.Header)
  16479. }
  16480. return c.header_
  16481. }
  16482. func (c *BrowsersListCall) doRequest(alt string) (*http.Response, error) {
  16483. reqHeaders := make(http.Header)
  16484. for k, v := range c.header_ {
  16485. reqHeaders[k] = v
  16486. }
  16487. reqHeaders.Set("User-Agent", c.s.userAgent())
  16488. if c.ifNoneMatch_ != "" {
  16489. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16490. }
  16491. var body io.Reader = nil
  16492. c.urlParams_.Set("alt", alt)
  16493. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/browsers")
  16494. urls += "?" + c.urlParams_.Encode()
  16495. req, _ := http.NewRequest("GET", urls, body)
  16496. req.Header = reqHeaders
  16497. googleapi.Expand(req.URL, map[string]string{
  16498. "profileId": strconv.FormatInt(c.profileId, 10),
  16499. })
  16500. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16501. }
  16502. // Do executes the "dfareporting.browsers.list" call.
  16503. // Exactly one of *BrowsersListResponse or error will be non-nil. Any
  16504. // non-2xx status code is an error. Response headers are in either
  16505. // *BrowsersListResponse.ServerResponse.Header or (if a response was
  16506. // returned at all) in error.(*googleapi.Error).Header. Use
  16507. // googleapi.IsNotModified to check whether the returned error was
  16508. // because http.StatusNotModified was returned.
  16509. func (c *BrowsersListCall) Do(opts ...googleapi.CallOption) (*BrowsersListResponse, error) {
  16510. gensupport.SetOptions(c.urlParams_, opts...)
  16511. res, err := c.doRequest("json")
  16512. if res != nil && res.StatusCode == http.StatusNotModified {
  16513. if res.Body != nil {
  16514. res.Body.Close()
  16515. }
  16516. return nil, &googleapi.Error{
  16517. Code: res.StatusCode,
  16518. Header: res.Header,
  16519. }
  16520. }
  16521. if err != nil {
  16522. return nil, err
  16523. }
  16524. defer googleapi.CloseBody(res)
  16525. if err := googleapi.CheckResponse(res); err != nil {
  16526. return nil, err
  16527. }
  16528. ret := &BrowsersListResponse{
  16529. ServerResponse: googleapi.ServerResponse{
  16530. Header: res.Header,
  16531. HTTPStatusCode: res.StatusCode,
  16532. },
  16533. }
  16534. target := &ret
  16535. if err := gensupport.DecodeResponse(target, res); err != nil {
  16536. return nil, err
  16537. }
  16538. return ret, nil
  16539. // {
  16540. // "description": "Retrieves a list of browsers.",
  16541. // "httpMethod": "GET",
  16542. // "id": "dfareporting.browsers.list",
  16543. // "parameterOrder": [
  16544. // "profileId"
  16545. // ],
  16546. // "parameters": {
  16547. // "profileId": {
  16548. // "description": "User profile ID associated with this request.",
  16549. // "format": "int64",
  16550. // "location": "path",
  16551. // "required": true,
  16552. // "type": "string"
  16553. // }
  16554. // },
  16555. // "path": "userprofiles/{profileId}/browsers",
  16556. // "response": {
  16557. // "$ref": "BrowsersListResponse"
  16558. // },
  16559. // "scopes": [
  16560. // "https://www.googleapis.com/auth/dfatrafficking"
  16561. // ]
  16562. // }
  16563. }
  16564. // method id "dfareporting.campaignCreativeAssociations.insert":
  16565. type CampaignCreativeAssociationsInsertCall struct {
  16566. s *Service
  16567. profileId int64
  16568. campaignId int64
  16569. campaigncreativeassociation *CampaignCreativeAssociation
  16570. urlParams_ gensupport.URLParams
  16571. ctx_ context.Context
  16572. header_ http.Header
  16573. }
  16574. // Insert: Associates a creative with the specified campaign. This
  16575. // method creates a default ad with dimensions matching the creative in
  16576. // the campaign if such a default ad does not exist already.
  16577. func (r *CampaignCreativeAssociationsService) Insert(profileId int64, campaignId int64, campaigncreativeassociation *CampaignCreativeAssociation) *CampaignCreativeAssociationsInsertCall {
  16578. c := &CampaignCreativeAssociationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16579. c.profileId = profileId
  16580. c.campaignId = campaignId
  16581. c.campaigncreativeassociation = campaigncreativeassociation
  16582. return c
  16583. }
  16584. // Fields allows partial responses to be retrieved. See
  16585. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16586. // for more information.
  16587. func (c *CampaignCreativeAssociationsInsertCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsInsertCall {
  16588. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16589. return c
  16590. }
  16591. // Context sets the context to be used in this call's Do method. Any
  16592. // pending HTTP request will be aborted if the provided context is
  16593. // canceled.
  16594. func (c *CampaignCreativeAssociationsInsertCall) Context(ctx context.Context) *CampaignCreativeAssociationsInsertCall {
  16595. c.ctx_ = ctx
  16596. return c
  16597. }
  16598. // Header returns an http.Header that can be modified by the caller to
  16599. // add HTTP headers to the request.
  16600. func (c *CampaignCreativeAssociationsInsertCall) Header() http.Header {
  16601. if c.header_ == nil {
  16602. c.header_ = make(http.Header)
  16603. }
  16604. return c.header_
  16605. }
  16606. func (c *CampaignCreativeAssociationsInsertCall) doRequest(alt string) (*http.Response, error) {
  16607. reqHeaders := make(http.Header)
  16608. for k, v := range c.header_ {
  16609. reqHeaders[k] = v
  16610. }
  16611. reqHeaders.Set("User-Agent", c.s.userAgent())
  16612. var body io.Reader = nil
  16613. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaigncreativeassociation)
  16614. if err != nil {
  16615. return nil, err
  16616. }
  16617. reqHeaders.Set("Content-Type", "application/json")
  16618. c.urlParams_.Set("alt", alt)
  16619. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  16620. urls += "?" + c.urlParams_.Encode()
  16621. req, _ := http.NewRequest("POST", urls, body)
  16622. req.Header = reqHeaders
  16623. googleapi.Expand(req.URL, map[string]string{
  16624. "profileId": strconv.FormatInt(c.profileId, 10),
  16625. "campaignId": strconv.FormatInt(c.campaignId, 10),
  16626. })
  16627. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16628. }
  16629. // Do executes the "dfareporting.campaignCreativeAssociations.insert" call.
  16630. // Exactly one of *CampaignCreativeAssociation or error will be non-nil.
  16631. // Any non-2xx status code is an error. Response headers are in either
  16632. // *CampaignCreativeAssociation.ServerResponse.Header or (if a response
  16633. // was returned at all) in error.(*googleapi.Error).Header. Use
  16634. // googleapi.IsNotModified to check whether the returned error was
  16635. // because http.StatusNotModified was returned.
  16636. func (c *CampaignCreativeAssociationsInsertCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociation, error) {
  16637. gensupport.SetOptions(c.urlParams_, opts...)
  16638. res, err := c.doRequest("json")
  16639. if res != nil && res.StatusCode == http.StatusNotModified {
  16640. if res.Body != nil {
  16641. res.Body.Close()
  16642. }
  16643. return nil, &googleapi.Error{
  16644. Code: res.StatusCode,
  16645. Header: res.Header,
  16646. }
  16647. }
  16648. if err != nil {
  16649. return nil, err
  16650. }
  16651. defer googleapi.CloseBody(res)
  16652. if err := googleapi.CheckResponse(res); err != nil {
  16653. return nil, err
  16654. }
  16655. ret := &CampaignCreativeAssociation{
  16656. ServerResponse: googleapi.ServerResponse{
  16657. Header: res.Header,
  16658. HTTPStatusCode: res.StatusCode,
  16659. },
  16660. }
  16661. target := &ret
  16662. if err := gensupport.DecodeResponse(target, res); err != nil {
  16663. return nil, err
  16664. }
  16665. return ret, nil
  16666. // {
  16667. // "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.",
  16668. // "httpMethod": "POST",
  16669. // "id": "dfareporting.campaignCreativeAssociations.insert",
  16670. // "parameterOrder": [
  16671. // "profileId",
  16672. // "campaignId"
  16673. // ],
  16674. // "parameters": {
  16675. // "campaignId": {
  16676. // "description": "Campaign ID in this association.",
  16677. // "format": "int64",
  16678. // "location": "path",
  16679. // "required": true,
  16680. // "type": "string"
  16681. // },
  16682. // "profileId": {
  16683. // "description": "User profile ID associated with this request.",
  16684. // "format": "int64",
  16685. // "location": "path",
  16686. // "required": true,
  16687. // "type": "string"
  16688. // }
  16689. // },
  16690. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  16691. // "request": {
  16692. // "$ref": "CampaignCreativeAssociation"
  16693. // },
  16694. // "response": {
  16695. // "$ref": "CampaignCreativeAssociation"
  16696. // },
  16697. // "scopes": [
  16698. // "https://www.googleapis.com/auth/dfatrafficking"
  16699. // ]
  16700. // }
  16701. }
  16702. // method id "dfareporting.campaignCreativeAssociations.list":
  16703. type CampaignCreativeAssociationsListCall struct {
  16704. s *Service
  16705. profileId int64
  16706. campaignId int64
  16707. urlParams_ gensupport.URLParams
  16708. ifNoneMatch_ string
  16709. ctx_ context.Context
  16710. header_ http.Header
  16711. }
  16712. // List: Retrieves the list of creative IDs associated with the
  16713. // specified campaign. This method supports paging.
  16714. func (r *CampaignCreativeAssociationsService) List(profileId int64, campaignId int64) *CampaignCreativeAssociationsListCall {
  16715. c := &CampaignCreativeAssociationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16716. c.profileId = profileId
  16717. c.campaignId = campaignId
  16718. return c
  16719. }
  16720. // MaxResults sets the optional parameter "maxResults": Maximum number
  16721. // of results to return.
  16722. func (c *CampaignCreativeAssociationsListCall) MaxResults(maxResults int64) *CampaignCreativeAssociationsListCall {
  16723. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  16724. return c
  16725. }
  16726. // PageToken sets the optional parameter "pageToken": Value of the
  16727. // nextPageToken from the previous result page.
  16728. func (c *CampaignCreativeAssociationsListCall) PageToken(pageToken string) *CampaignCreativeAssociationsListCall {
  16729. c.urlParams_.Set("pageToken", pageToken)
  16730. return c
  16731. }
  16732. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  16733. // results.
  16734. //
  16735. // Possible values:
  16736. // "ASCENDING" (default)
  16737. // "DESCENDING"
  16738. func (c *CampaignCreativeAssociationsListCall) SortOrder(sortOrder string) *CampaignCreativeAssociationsListCall {
  16739. c.urlParams_.Set("sortOrder", sortOrder)
  16740. return c
  16741. }
  16742. // Fields allows partial responses to be retrieved. See
  16743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16744. // for more information.
  16745. func (c *CampaignCreativeAssociationsListCall) Fields(s ...googleapi.Field) *CampaignCreativeAssociationsListCall {
  16746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16747. return c
  16748. }
  16749. // IfNoneMatch sets the optional parameter which makes the operation
  16750. // fail if the object's ETag matches the given value. This is useful for
  16751. // getting updates only after the object has changed since the last
  16752. // request. Use googleapi.IsNotModified to check whether the response
  16753. // error from Do is the result of In-None-Match.
  16754. func (c *CampaignCreativeAssociationsListCall) IfNoneMatch(entityTag string) *CampaignCreativeAssociationsListCall {
  16755. c.ifNoneMatch_ = entityTag
  16756. return c
  16757. }
  16758. // Context sets the context to be used in this call's Do method. Any
  16759. // pending HTTP request will be aborted if the provided context is
  16760. // canceled.
  16761. func (c *CampaignCreativeAssociationsListCall) Context(ctx context.Context) *CampaignCreativeAssociationsListCall {
  16762. c.ctx_ = ctx
  16763. return c
  16764. }
  16765. // Header returns an http.Header that can be modified by the caller to
  16766. // add HTTP headers to the request.
  16767. func (c *CampaignCreativeAssociationsListCall) Header() http.Header {
  16768. if c.header_ == nil {
  16769. c.header_ = make(http.Header)
  16770. }
  16771. return c.header_
  16772. }
  16773. func (c *CampaignCreativeAssociationsListCall) doRequest(alt string) (*http.Response, error) {
  16774. reqHeaders := make(http.Header)
  16775. for k, v := range c.header_ {
  16776. reqHeaders[k] = v
  16777. }
  16778. reqHeaders.Set("User-Agent", c.s.userAgent())
  16779. if c.ifNoneMatch_ != "" {
  16780. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16781. }
  16782. var body io.Reader = nil
  16783. c.urlParams_.Set("alt", alt)
  16784. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations")
  16785. urls += "?" + c.urlParams_.Encode()
  16786. req, _ := http.NewRequest("GET", urls, body)
  16787. req.Header = reqHeaders
  16788. googleapi.Expand(req.URL, map[string]string{
  16789. "profileId": strconv.FormatInt(c.profileId, 10),
  16790. "campaignId": strconv.FormatInt(c.campaignId, 10),
  16791. })
  16792. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16793. }
  16794. // Do executes the "dfareporting.campaignCreativeAssociations.list" call.
  16795. // Exactly one of *CampaignCreativeAssociationsListResponse or error
  16796. // will be non-nil. Any non-2xx status code is an error. Response
  16797. // headers are in either
  16798. // *CampaignCreativeAssociationsListResponse.ServerResponse.Header or
  16799. // (if a response was returned at all) in
  16800. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  16801. // whether the returned error was because http.StatusNotModified was
  16802. // returned.
  16803. func (c *CampaignCreativeAssociationsListCall) Do(opts ...googleapi.CallOption) (*CampaignCreativeAssociationsListResponse, error) {
  16804. gensupport.SetOptions(c.urlParams_, opts...)
  16805. res, err := c.doRequest("json")
  16806. if res != nil && res.StatusCode == http.StatusNotModified {
  16807. if res.Body != nil {
  16808. res.Body.Close()
  16809. }
  16810. return nil, &googleapi.Error{
  16811. Code: res.StatusCode,
  16812. Header: res.Header,
  16813. }
  16814. }
  16815. if err != nil {
  16816. return nil, err
  16817. }
  16818. defer googleapi.CloseBody(res)
  16819. if err := googleapi.CheckResponse(res); err != nil {
  16820. return nil, err
  16821. }
  16822. ret := &CampaignCreativeAssociationsListResponse{
  16823. ServerResponse: googleapi.ServerResponse{
  16824. Header: res.Header,
  16825. HTTPStatusCode: res.StatusCode,
  16826. },
  16827. }
  16828. target := &ret
  16829. if err := gensupport.DecodeResponse(target, res); err != nil {
  16830. return nil, err
  16831. }
  16832. return ret, nil
  16833. // {
  16834. // "description": "Retrieves the list of creative IDs associated with the specified campaign. This method supports paging.",
  16835. // "httpMethod": "GET",
  16836. // "id": "dfareporting.campaignCreativeAssociations.list",
  16837. // "parameterOrder": [
  16838. // "profileId",
  16839. // "campaignId"
  16840. // ],
  16841. // "parameters": {
  16842. // "campaignId": {
  16843. // "description": "Campaign ID in this association.",
  16844. // "format": "int64",
  16845. // "location": "path",
  16846. // "required": true,
  16847. // "type": "string"
  16848. // },
  16849. // "maxResults": {
  16850. // "default": "1000",
  16851. // "description": "Maximum number of results to return.",
  16852. // "format": "int32",
  16853. // "location": "query",
  16854. // "maximum": "1000",
  16855. // "minimum": "0",
  16856. // "type": "integer"
  16857. // },
  16858. // "pageToken": {
  16859. // "description": "Value of the nextPageToken from the previous result page.",
  16860. // "location": "query",
  16861. // "type": "string"
  16862. // },
  16863. // "profileId": {
  16864. // "description": "User profile ID associated with this request.",
  16865. // "format": "int64",
  16866. // "location": "path",
  16867. // "required": true,
  16868. // "type": "string"
  16869. // },
  16870. // "sortOrder": {
  16871. // "default": "ASCENDING",
  16872. // "description": "Order of sorted results.",
  16873. // "enum": [
  16874. // "ASCENDING",
  16875. // "DESCENDING"
  16876. // ],
  16877. // "enumDescriptions": [
  16878. // "",
  16879. // ""
  16880. // ],
  16881. // "location": "query",
  16882. // "type": "string"
  16883. // }
  16884. // },
  16885. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/campaignCreativeAssociations",
  16886. // "response": {
  16887. // "$ref": "CampaignCreativeAssociationsListResponse"
  16888. // },
  16889. // "scopes": [
  16890. // "https://www.googleapis.com/auth/dfatrafficking"
  16891. // ]
  16892. // }
  16893. }
  16894. // Pages invokes f for each page of results.
  16895. // A non-nil error returned from f will halt the iteration.
  16896. // The provided context supersedes any context provided to the Context method.
  16897. func (c *CampaignCreativeAssociationsListCall) Pages(ctx context.Context, f func(*CampaignCreativeAssociationsListResponse) error) error {
  16898. c.ctx_ = ctx
  16899. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  16900. for {
  16901. x, err := c.Do()
  16902. if err != nil {
  16903. return err
  16904. }
  16905. if err := f(x); err != nil {
  16906. return err
  16907. }
  16908. if x.NextPageToken == "" {
  16909. return nil
  16910. }
  16911. c.PageToken(x.NextPageToken)
  16912. }
  16913. }
  16914. // method id "dfareporting.campaigns.get":
  16915. type CampaignsGetCall struct {
  16916. s *Service
  16917. profileId int64
  16918. id int64
  16919. urlParams_ gensupport.URLParams
  16920. ifNoneMatch_ string
  16921. ctx_ context.Context
  16922. header_ http.Header
  16923. }
  16924. // Get: Gets one campaign by ID.
  16925. func (r *CampaignsService) Get(profileId int64, id int64) *CampaignsGetCall {
  16926. c := &CampaignsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  16927. c.profileId = profileId
  16928. c.id = id
  16929. return c
  16930. }
  16931. // Fields allows partial responses to be retrieved. See
  16932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  16933. // for more information.
  16934. func (c *CampaignsGetCall) Fields(s ...googleapi.Field) *CampaignsGetCall {
  16935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  16936. return c
  16937. }
  16938. // IfNoneMatch sets the optional parameter which makes the operation
  16939. // fail if the object's ETag matches the given value. This is useful for
  16940. // getting updates only after the object has changed since the last
  16941. // request. Use googleapi.IsNotModified to check whether the response
  16942. // error from Do is the result of In-None-Match.
  16943. func (c *CampaignsGetCall) IfNoneMatch(entityTag string) *CampaignsGetCall {
  16944. c.ifNoneMatch_ = entityTag
  16945. return c
  16946. }
  16947. // Context sets the context to be used in this call's Do method. Any
  16948. // pending HTTP request will be aborted if the provided context is
  16949. // canceled.
  16950. func (c *CampaignsGetCall) Context(ctx context.Context) *CampaignsGetCall {
  16951. c.ctx_ = ctx
  16952. return c
  16953. }
  16954. // Header returns an http.Header that can be modified by the caller to
  16955. // add HTTP headers to the request.
  16956. func (c *CampaignsGetCall) Header() http.Header {
  16957. if c.header_ == nil {
  16958. c.header_ = make(http.Header)
  16959. }
  16960. return c.header_
  16961. }
  16962. func (c *CampaignsGetCall) doRequest(alt string) (*http.Response, error) {
  16963. reqHeaders := make(http.Header)
  16964. for k, v := range c.header_ {
  16965. reqHeaders[k] = v
  16966. }
  16967. reqHeaders.Set("User-Agent", c.s.userAgent())
  16968. if c.ifNoneMatch_ != "" {
  16969. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  16970. }
  16971. var body io.Reader = nil
  16972. c.urlParams_.Set("alt", alt)
  16973. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{id}")
  16974. urls += "?" + c.urlParams_.Encode()
  16975. req, _ := http.NewRequest("GET", urls, body)
  16976. req.Header = reqHeaders
  16977. googleapi.Expand(req.URL, map[string]string{
  16978. "profileId": strconv.FormatInt(c.profileId, 10),
  16979. "id": strconv.FormatInt(c.id, 10),
  16980. })
  16981. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  16982. }
  16983. // Do executes the "dfareporting.campaigns.get" call.
  16984. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  16985. // code is an error. Response headers are in either
  16986. // *Campaign.ServerResponse.Header or (if a response was returned at
  16987. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  16988. // to check whether the returned error was because
  16989. // http.StatusNotModified was returned.
  16990. func (c *CampaignsGetCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  16991. gensupport.SetOptions(c.urlParams_, opts...)
  16992. res, err := c.doRequest("json")
  16993. if res != nil && res.StatusCode == http.StatusNotModified {
  16994. if res.Body != nil {
  16995. res.Body.Close()
  16996. }
  16997. return nil, &googleapi.Error{
  16998. Code: res.StatusCode,
  16999. Header: res.Header,
  17000. }
  17001. }
  17002. if err != nil {
  17003. return nil, err
  17004. }
  17005. defer googleapi.CloseBody(res)
  17006. if err := googleapi.CheckResponse(res); err != nil {
  17007. return nil, err
  17008. }
  17009. ret := &Campaign{
  17010. ServerResponse: googleapi.ServerResponse{
  17011. Header: res.Header,
  17012. HTTPStatusCode: res.StatusCode,
  17013. },
  17014. }
  17015. target := &ret
  17016. if err := gensupport.DecodeResponse(target, res); err != nil {
  17017. return nil, err
  17018. }
  17019. return ret, nil
  17020. // {
  17021. // "description": "Gets one campaign by ID.",
  17022. // "httpMethod": "GET",
  17023. // "id": "dfareporting.campaigns.get",
  17024. // "parameterOrder": [
  17025. // "profileId",
  17026. // "id"
  17027. // ],
  17028. // "parameters": {
  17029. // "id": {
  17030. // "description": "Campaign ID.",
  17031. // "format": "int64",
  17032. // "location": "path",
  17033. // "required": true,
  17034. // "type": "string"
  17035. // },
  17036. // "profileId": {
  17037. // "description": "User profile ID associated with this request.",
  17038. // "format": "int64",
  17039. // "location": "path",
  17040. // "required": true,
  17041. // "type": "string"
  17042. // }
  17043. // },
  17044. // "path": "userprofiles/{profileId}/campaigns/{id}",
  17045. // "response": {
  17046. // "$ref": "Campaign"
  17047. // },
  17048. // "scopes": [
  17049. // "https://www.googleapis.com/auth/dfatrafficking"
  17050. // ]
  17051. // }
  17052. }
  17053. // method id "dfareporting.campaigns.insert":
  17054. type CampaignsInsertCall struct {
  17055. s *Service
  17056. profileId int64
  17057. campaign *Campaign
  17058. urlParams_ gensupport.URLParams
  17059. ctx_ context.Context
  17060. header_ http.Header
  17061. }
  17062. // Insert: Inserts a new campaign.
  17063. func (r *CampaignsService) Insert(profileId int64, defaultLandingPageName string, defaultLandingPageUrl string, campaign *Campaign) *CampaignsInsertCall {
  17064. c := &CampaignsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17065. c.profileId = profileId
  17066. c.urlParams_.Set("defaultLandingPageName", defaultLandingPageName)
  17067. c.urlParams_.Set("defaultLandingPageUrl", defaultLandingPageUrl)
  17068. c.campaign = campaign
  17069. return c
  17070. }
  17071. // Fields allows partial responses to be retrieved. See
  17072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17073. // for more information.
  17074. func (c *CampaignsInsertCall) Fields(s ...googleapi.Field) *CampaignsInsertCall {
  17075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17076. return c
  17077. }
  17078. // Context sets the context to be used in this call's Do method. Any
  17079. // pending HTTP request will be aborted if the provided context is
  17080. // canceled.
  17081. func (c *CampaignsInsertCall) Context(ctx context.Context) *CampaignsInsertCall {
  17082. c.ctx_ = ctx
  17083. return c
  17084. }
  17085. // Header returns an http.Header that can be modified by the caller to
  17086. // add HTTP headers to the request.
  17087. func (c *CampaignsInsertCall) Header() http.Header {
  17088. if c.header_ == nil {
  17089. c.header_ = make(http.Header)
  17090. }
  17091. return c.header_
  17092. }
  17093. func (c *CampaignsInsertCall) doRequest(alt string) (*http.Response, error) {
  17094. reqHeaders := make(http.Header)
  17095. for k, v := range c.header_ {
  17096. reqHeaders[k] = v
  17097. }
  17098. reqHeaders.Set("User-Agent", c.s.userAgent())
  17099. var body io.Reader = nil
  17100. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  17101. if err != nil {
  17102. return nil, err
  17103. }
  17104. reqHeaders.Set("Content-Type", "application/json")
  17105. c.urlParams_.Set("alt", alt)
  17106. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  17107. urls += "?" + c.urlParams_.Encode()
  17108. req, _ := http.NewRequest("POST", urls, body)
  17109. req.Header = reqHeaders
  17110. googleapi.Expand(req.URL, map[string]string{
  17111. "profileId": strconv.FormatInt(c.profileId, 10),
  17112. })
  17113. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17114. }
  17115. // Do executes the "dfareporting.campaigns.insert" call.
  17116. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  17117. // code is an error. Response headers are in either
  17118. // *Campaign.ServerResponse.Header or (if a response was returned at
  17119. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17120. // to check whether the returned error was because
  17121. // http.StatusNotModified was returned.
  17122. func (c *CampaignsInsertCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  17123. gensupport.SetOptions(c.urlParams_, opts...)
  17124. res, err := c.doRequest("json")
  17125. if res != nil && res.StatusCode == http.StatusNotModified {
  17126. if res.Body != nil {
  17127. res.Body.Close()
  17128. }
  17129. return nil, &googleapi.Error{
  17130. Code: res.StatusCode,
  17131. Header: res.Header,
  17132. }
  17133. }
  17134. if err != nil {
  17135. return nil, err
  17136. }
  17137. defer googleapi.CloseBody(res)
  17138. if err := googleapi.CheckResponse(res); err != nil {
  17139. return nil, err
  17140. }
  17141. ret := &Campaign{
  17142. ServerResponse: googleapi.ServerResponse{
  17143. Header: res.Header,
  17144. HTTPStatusCode: res.StatusCode,
  17145. },
  17146. }
  17147. target := &ret
  17148. if err := gensupport.DecodeResponse(target, res); err != nil {
  17149. return nil, err
  17150. }
  17151. return ret, nil
  17152. // {
  17153. // "description": "Inserts a new campaign.",
  17154. // "httpMethod": "POST",
  17155. // "id": "dfareporting.campaigns.insert",
  17156. // "parameterOrder": [
  17157. // "profileId",
  17158. // "defaultLandingPageName",
  17159. // "defaultLandingPageUrl"
  17160. // ],
  17161. // "parameters": {
  17162. // "defaultLandingPageName": {
  17163. // "description": "Default landing page name for this new campaign. Must be less than 256 characters long.",
  17164. // "location": "query",
  17165. // "required": true,
  17166. // "type": "string"
  17167. // },
  17168. // "defaultLandingPageUrl": {
  17169. // "description": "Default landing page URL for this new campaign.",
  17170. // "location": "query",
  17171. // "required": true,
  17172. // "type": "string"
  17173. // },
  17174. // "profileId": {
  17175. // "description": "User profile ID associated with this request.",
  17176. // "format": "int64",
  17177. // "location": "path",
  17178. // "required": true,
  17179. // "type": "string"
  17180. // }
  17181. // },
  17182. // "path": "userprofiles/{profileId}/campaigns",
  17183. // "request": {
  17184. // "$ref": "Campaign"
  17185. // },
  17186. // "response": {
  17187. // "$ref": "Campaign"
  17188. // },
  17189. // "scopes": [
  17190. // "https://www.googleapis.com/auth/dfatrafficking"
  17191. // ]
  17192. // }
  17193. }
  17194. // method id "dfareporting.campaigns.list":
  17195. type CampaignsListCall struct {
  17196. s *Service
  17197. profileId int64
  17198. urlParams_ gensupport.URLParams
  17199. ifNoneMatch_ string
  17200. ctx_ context.Context
  17201. header_ http.Header
  17202. }
  17203. // List: Retrieves a list of campaigns, possibly filtered. This method
  17204. // supports paging.
  17205. func (r *CampaignsService) List(profileId int64) *CampaignsListCall {
  17206. c := &CampaignsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17207. c.profileId = profileId
  17208. return c
  17209. }
  17210. // AdvertiserGroupIds sets the optional parameter "advertiserGroupIds":
  17211. // Select only campaigns whose advertisers belong to these advertiser
  17212. // groups.
  17213. func (c *CampaignsListCall) AdvertiserGroupIds(advertiserGroupIds ...int64) *CampaignsListCall {
  17214. var advertiserGroupIds_ []string
  17215. for _, v := range advertiserGroupIds {
  17216. advertiserGroupIds_ = append(advertiserGroupIds_, fmt.Sprint(v))
  17217. }
  17218. c.urlParams_.SetMulti("advertiserGroupIds", advertiserGroupIds_)
  17219. return c
  17220. }
  17221. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  17222. // only campaigns that belong to these advertisers.
  17223. func (c *CampaignsListCall) AdvertiserIds(advertiserIds ...int64) *CampaignsListCall {
  17224. var advertiserIds_ []string
  17225. for _, v := range advertiserIds {
  17226. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  17227. }
  17228. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  17229. return c
  17230. }
  17231. // Archived sets the optional parameter "archived": Select only archived
  17232. // campaigns. Don't set this field to select both archived and
  17233. // non-archived campaigns.
  17234. func (c *CampaignsListCall) Archived(archived bool) *CampaignsListCall {
  17235. c.urlParams_.Set("archived", fmt.Sprint(archived))
  17236. return c
  17237. }
  17238. // AtLeastOneOptimizationActivity sets the optional parameter
  17239. // "atLeastOneOptimizationActivity": Select only campaigns that have at
  17240. // least one optimization activity.
  17241. func (c *CampaignsListCall) AtLeastOneOptimizationActivity(atLeastOneOptimizationActivity bool) *CampaignsListCall {
  17242. c.urlParams_.Set("atLeastOneOptimizationActivity", fmt.Sprint(atLeastOneOptimizationActivity))
  17243. return c
  17244. }
  17245. // ExcludedIds sets the optional parameter "excludedIds": Exclude
  17246. // campaigns with these IDs.
  17247. func (c *CampaignsListCall) ExcludedIds(excludedIds ...int64) *CampaignsListCall {
  17248. var excludedIds_ []string
  17249. for _, v := range excludedIds {
  17250. excludedIds_ = append(excludedIds_, fmt.Sprint(v))
  17251. }
  17252. c.urlParams_.SetMulti("excludedIds", excludedIds_)
  17253. return c
  17254. }
  17255. // Ids sets the optional parameter "ids": Select only campaigns with
  17256. // these IDs.
  17257. func (c *CampaignsListCall) Ids(ids ...int64) *CampaignsListCall {
  17258. var ids_ []string
  17259. for _, v := range ids {
  17260. ids_ = append(ids_, fmt.Sprint(v))
  17261. }
  17262. c.urlParams_.SetMulti("ids", ids_)
  17263. return c
  17264. }
  17265. // MaxResults sets the optional parameter "maxResults": Maximum number
  17266. // of results to return.
  17267. func (c *CampaignsListCall) MaxResults(maxResults int64) *CampaignsListCall {
  17268. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  17269. return c
  17270. }
  17271. // OverriddenEventTagId sets the optional parameter
  17272. // "overriddenEventTagId": Select only campaigns that have overridden
  17273. // this event tag ID.
  17274. func (c *CampaignsListCall) OverriddenEventTagId(overriddenEventTagId int64) *CampaignsListCall {
  17275. c.urlParams_.Set("overriddenEventTagId", fmt.Sprint(overriddenEventTagId))
  17276. return c
  17277. }
  17278. // PageToken sets the optional parameter "pageToken": Value of the
  17279. // nextPageToken from the previous result page.
  17280. func (c *CampaignsListCall) PageToken(pageToken string) *CampaignsListCall {
  17281. c.urlParams_.Set("pageToken", pageToken)
  17282. return c
  17283. }
  17284. // SearchString sets the optional parameter "searchString": Allows
  17285. // searching for campaigns by name or ID. Wildcards (*) are allowed. For
  17286. // example, "campaign*2015" will return campaigns with names like
  17287. // "campaign June 2015", "campaign April 2015", or simply "campaign
  17288. // 2015". Most of the searches also add wildcards implicitly at the
  17289. // start and the end of the search string. For example, a search string
  17290. // of "campaign" will match campaigns with name "my campaign", "campaign
  17291. // 2015", or simply "campaign".
  17292. func (c *CampaignsListCall) SearchString(searchString string) *CampaignsListCall {
  17293. c.urlParams_.Set("searchString", searchString)
  17294. return c
  17295. }
  17296. // SortField sets the optional parameter "sortField": Field by which to
  17297. // sort the list.
  17298. //
  17299. // Possible values:
  17300. // "ID" (default)
  17301. // "NAME"
  17302. func (c *CampaignsListCall) SortField(sortField string) *CampaignsListCall {
  17303. c.urlParams_.Set("sortField", sortField)
  17304. return c
  17305. }
  17306. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  17307. // results.
  17308. //
  17309. // Possible values:
  17310. // "ASCENDING" (default)
  17311. // "DESCENDING"
  17312. func (c *CampaignsListCall) SortOrder(sortOrder string) *CampaignsListCall {
  17313. c.urlParams_.Set("sortOrder", sortOrder)
  17314. return c
  17315. }
  17316. // SubaccountId sets the optional parameter "subaccountId": Select only
  17317. // campaigns that belong to this subaccount.
  17318. func (c *CampaignsListCall) SubaccountId(subaccountId int64) *CampaignsListCall {
  17319. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  17320. return c
  17321. }
  17322. // Fields allows partial responses to be retrieved. See
  17323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17324. // for more information.
  17325. func (c *CampaignsListCall) Fields(s ...googleapi.Field) *CampaignsListCall {
  17326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17327. return c
  17328. }
  17329. // IfNoneMatch sets the optional parameter which makes the operation
  17330. // fail if the object's ETag matches the given value. This is useful for
  17331. // getting updates only after the object has changed since the last
  17332. // request. Use googleapi.IsNotModified to check whether the response
  17333. // error from Do is the result of In-None-Match.
  17334. func (c *CampaignsListCall) IfNoneMatch(entityTag string) *CampaignsListCall {
  17335. c.ifNoneMatch_ = entityTag
  17336. return c
  17337. }
  17338. // Context sets the context to be used in this call's Do method. Any
  17339. // pending HTTP request will be aborted if the provided context is
  17340. // canceled.
  17341. func (c *CampaignsListCall) Context(ctx context.Context) *CampaignsListCall {
  17342. c.ctx_ = ctx
  17343. return c
  17344. }
  17345. // Header returns an http.Header that can be modified by the caller to
  17346. // add HTTP headers to the request.
  17347. func (c *CampaignsListCall) Header() http.Header {
  17348. if c.header_ == nil {
  17349. c.header_ = make(http.Header)
  17350. }
  17351. return c.header_
  17352. }
  17353. func (c *CampaignsListCall) doRequest(alt string) (*http.Response, error) {
  17354. reqHeaders := make(http.Header)
  17355. for k, v := range c.header_ {
  17356. reqHeaders[k] = v
  17357. }
  17358. reqHeaders.Set("User-Agent", c.s.userAgent())
  17359. if c.ifNoneMatch_ != "" {
  17360. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17361. }
  17362. var body io.Reader = nil
  17363. c.urlParams_.Set("alt", alt)
  17364. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  17365. urls += "?" + c.urlParams_.Encode()
  17366. req, _ := http.NewRequest("GET", urls, body)
  17367. req.Header = reqHeaders
  17368. googleapi.Expand(req.URL, map[string]string{
  17369. "profileId": strconv.FormatInt(c.profileId, 10),
  17370. })
  17371. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17372. }
  17373. // Do executes the "dfareporting.campaigns.list" call.
  17374. // Exactly one of *CampaignsListResponse or error will be non-nil. Any
  17375. // non-2xx status code is an error. Response headers are in either
  17376. // *CampaignsListResponse.ServerResponse.Header or (if a response was
  17377. // returned at all) in error.(*googleapi.Error).Header. Use
  17378. // googleapi.IsNotModified to check whether the returned error was
  17379. // because http.StatusNotModified was returned.
  17380. func (c *CampaignsListCall) Do(opts ...googleapi.CallOption) (*CampaignsListResponse, error) {
  17381. gensupport.SetOptions(c.urlParams_, opts...)
  17382. res, err := c.doRequest("json")
  17383. if res != nil && res.StatusCode == http.StatusNotModified {
  17384. if res.Body != nil {
  17385. res.Body.Close()
  17386. }
  17387. return nil, &googleapi.Error{
  17388. Code: res.StatusCode,
  17389. Header: res.Header,
  17390. }
  17391. }
  17392. if err != nil {
  17393. return nil, err
  17394. }
  17395. defer googleapi.CloseBody(res)
  17396. if err := googleapi.CheckResponse(res); err != nil {
  17397. return nil, err
  17398. }
  17399. ret := &CampaignsListResponse{
  17400. ServerResponse: googleapi.ServerResponse{
  17401. Header: res.Header,
  17402. HTTPStatusCode: res.StatusCode,
  17403. },
  17404. }
  17405. target := &ret
  17406. if err := gensupport.DecodeResponse(target, res); err != nil {
  17407. return nil, err
  17408. }
  17409. return ret, nil
  17410. // {
  17411. // "description": "Retrieves a list of campaigns, possibly filtered. This method supports paging.",
  17412. // "httpMethod": "GET",
  17413. // "id": "dfareporting.campaigns.list",
  17414. // "parameterOrder": [
  17415. // "profileId"
  17416. // ],
  17417. // "parameters": {
  17418. // "advertiserGroupIds": {
  17419. // "description": "Select only campaigns whose advertisers belong to these advertiser groups.",
  17420. // "format": "int64",
  17421. // "location": "query",
  17422. // "repeated": true,
  17423. // "type": "string"
  17424. // },
  17425. // "advertiserIds": {
  17426. // "description": "Select only campaigns that belong to these advertisers.",
  17427. // "format": "int64",
  17428. // "location": "query",
  17429. // "repeated": true,
  17430. // "type": "string"
  17431. // },
  17432. // "archived": {
  17433. // "description": "Select only archived campaigns. Don't set this field to select both archived and non-archived campaigns.",
  17434. // "location": "query",
  17435. // "type": "boolean"
  17436. // },
  17437. // "atLeastOneOptimizationActivity": {
  17438. // "description": "Select only campaigns that have at least one optimization activity.",
  17439. // "location": "query",
  17440. // "type": "boolean"
  17441. // },
  17442. // "excludedIds": {
  17443. // "description": "Exclude campaigns with these IDs.",
  17444. // "format": "int64",
  17445. // "location": "query",
  17446. // "repeated": true,
  17447. // "type": "string"
  17448. // },
  17449. // "ids": {
  17450. // "description": "Select only campaigns with these IDs.",
  17451. // "format": "int64",
  17452. // "location": "query",
  17453. // "repeated": true,
  17454. // "type": "string"
  17455. // },
  17456. // "maxResults": {
  17457. // "default": "1000",
  17458. // "description": "Maximum number of results to return.",
  17459. // "format": "int32",
  17460. // "location": "query",
  17461. // "maximum": "1000",
  17462. // "minimum": "0",
  17463. // "type": "integer"
  17464. // },
  17465. // "overriddenEventTagId": {
  17466. // "description": "Select only campaigns that have overridden this event tag ID.",
  17467. // "format": "int64",
  17468. // "location": "query",
  17469. // "type": "string"
  17470. // },
  17471. // "pageToken": {
  17472. // "description": "Value of the nextPageToken from the previous result page.",
  17473. // "location": "query",
  17474. // "type": "string"
  17475. // },
  17476. // "profileId": {
  17477. // "description": "User profile ID associated with this request.",
  17478. // "format": "int64",
  17479. // "location": "path",
  17480. // "required": true,
  17481. // "type": "string"
  17482. // },
  17483. // "searchString": {
  17484. // "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\".",
  17485. // "location": "query",
  17486. // "type": "string"
  17487. // },
  17488. // "sortField": {
  17489. // "default": "ID",
  17490. // "description": "Field by which to sort the list.",
  17491. // "enum": [
  17492. // "ID",
  17493. // "NAME"
  17494. // ],
  17495. // "enumDescriptions": [
  17496. // "",
  17497. // ""
  17498. // ],
  17499. // "location": "query",
  17500. // "type": "string"
  17501. // },
  17502. // "sortOrder": {
  17503. // "default": "ASCENDING",
  17504. // "description": "Order of sorted results.",
  17505. // "enum": [
  17506. // "ASCENDING",
  17507. // "DESCENDING"
  17508. // ],
  17509. // "enumDescriptions": [
  17510. // "",
  17511. // ""
  17512. // ],
  17513. // "location": "query",
  17514. // "type": "string"
  17515. // },
  17516. // "subaccountId": {
  17517. // "description": "Select only campaigns that belong to this subaccount.",
  17518. // "format": "int64",
  17519. // "location": "query",
  17520. // "type": "string"
  17521. // }
  17522. // },
  17523. // "path": "userprofiles/{profileId}/campaigns",
  17524. // "response": {
  17525. // "$ref": "CampaignsListResponse"
  17526. // },
  17527. // "scopes": [
  17528. // "https://www.googleapis.com/auth/dfatrafficking"
  17529. // ]
  17530. // }
  17531. }
  17532. // Pages invokes f for each page of results.
  17533. // A non-nil error returned from f will halt the iteration.
  17534. // The provided context supersedes any context provided to the Context method.
  17535. func (c *CampaignsListCall) Pages(ctx context.Context, f func(*CampaignsListResponse) error) error {
  17536. c.ctx_ = ctx
  17537. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  17538. for {
  17539. x, err := c.Do()
  17540. if err != nil {
  17541. return err
  17542. }
  17543. if err := f(x); err != nil {
  17544. return err
  17545. }
  17546. if x.NextPageToken == "" {
  17547. return nil
  17548. }
  17549. c.PageToken(x.NextPageToken)
  17550. }
  17551. }
  17552. // method id "dfareporting.campaigns.patch":
  17553. type CampaignsPatchCall struct {
  17554. s *Service
  17555. profileId int64
  17556. campaign *Campaign
  17557. urlParams_ gensupport.URLParams
  17558. ctx_ context.Context
  17559. header_ http.Header
  17560. }
  17561. // Patch: Updates an existing campaign. This method supports patch
  17562. // semantics.
  17563. func (r *CampaignsService) Patch(profileId int64, id int64, campaign *Campaign) *CampaignsPatchCall {
  17564. c := &CampaignsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17565. c.profileId = profileId
  17566. c.urlParams_.Set("id", fmt.Sprint(id))
  17567. c.campaign = campaign
  17568. return c
  17569. }
  17570. // Fields allows partial responses to be retrieved. See
  17571. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17572. // for more information.
  17573. func (c *CampaignsPatchCall) Fields(s ...googleapi.Field) *CampaignsPatchCall {
  17574. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17575. return c
  17576. }
  17577. // Context sets the context to be used in this call's Do method. Any
  17578. // pending HTTP request will be aborted if the provided context is
  17579. // canceled.
  17580. func (c *CampaignsPatchCall) Context(ctx context.Context) *CampaignsPatchCall {
  17581. c.ctx_ = ctx
  17582. return c
  17583. }
  17584. // Header returns an http.Header that can be modified by the caller to
  17585. // add HTTP headers to the request.
  17586. func (c *CampaignsPatchCall) Header() http.Header {
  17587. if c.header_ == nil {
  17588. c.header_ = make(http.Header)
  17589. }
  17590. return c.header_
  17591. }
  17592. func (c *CampaignsPatchCall) doRequest(alt string) (*http.Response, error) {
  17593. reqHeaders := make(http.Header)
  17594. for k, v := range c.header_ {
  17595. reqHeaders[k] = v
  17596. }
  17597. reqHeaders.Set("User-Agent", c.s.userAgent())
  17598. var body io.Reader = nil
  17599. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  17600. if err != nil {
  17601. return nil, err
  17602. }
  17603. reqHeaders.Set("Content-Type", "application/json")
  17604. c.urlParams_.Set("alt", alt)
  17605. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  17606. urls += "?" + c.urlParams_.Encode()
  17607. req, _ := http.NewRequest("PATCH", urls, body)
  17608. req.Header = reqHeaders
  17609. googleapi.Expand(req.URL, map[string]string{
  17610. "profileId": strconv.FormatInt(c.profileId, 10),
  17611. })
  17612. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17613. }
  17614. // Do executes the "dfareporting.campaigns.patch" call.
  17615. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  17616. // code is an error. Response headers are in either
  17617. // *Campaign.ServerResponse.Header or (if a response was returned at
  17618. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17619. // to check whether the returned error was because
  17620. // http.StatusNotModified was returned.
  17621. func (c *CampaignsPatchCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  17622. gensupport.SetOptions(c.urlParams_, opts...)
  17623. res, err := c.doRequest("json")
  17624. if res != nil && res.StatusCode == http.StatusNotModified {
  17625. if res.Body != nil {
  17626. res.Body.Close()
  17627. }
  17628. return nil, &googleapi.Error{
  17629. Code: res.StatusCode,
  17630. Header: res.Header,
  17631. }
  17632. }
  17633. if err != nil {
  17634. return nil, err
  17635. }
  17636. defer googleapi.CloseBody(res)
  17637. if err := googleapi.CheckResponse(res); err != nil {
  17638. return nil, err
  17639. }
  17640. ret := &Campaign{
  17641. ServerResponse: googleapi.ServerResponse{
  17642. Header: res.Header,
  17643. HTTPStatusCode: res.StatusCode,
  17644. },
  17645. }
  17646. target := &ret
  17647. if err := gensupport.DecodeResponse(target, res); err != nil {
  17648. return nil, err
  17649. }
  17650. return ret, nil
  17651. // {
  17652. // "description": "Updates an existing campaign. This method supports patch semantics.",
  17653. // "httpMethod": "PATCH",
  17654. // "id": "dfareporting.campaigns.patch",
  17655. // "parameterOrder": [
  17656. // "profileId",
  17657. // "id"
  17658. // ],
  17659. // "parameters": {
  17660. // "id": {
  17661. // "description": "Campaign ID.",
  17662. // "format": "int64",
  17663. // "location": "query",
  17664. // "required": true,
  17665. // "type": "string"
  17666. // },
  17667. // "profileId": {
  17668. // "description": "User profile ID associated with this request.",
  17669. // "format": "int64",
  17670. // "location": "path",
  17671. // "required": true,
  17672. // "type": "string"
  17673. // }
  17674. // },
  17675. // "path": "userprofiles/{profileId}/campaigns",
  17676. // "request": {
  17677. // "$ref": "Campaign"
  17678. // },
  17679. // "response": {
  17680. // "$ref": "Campaign"
  17681. // },
  17682. // "scopes": [
  17683. // "https://www.googleapis.com/auth/dfatrafficking"
  17684. // ]
  17685. // }
  17686. }
  17687. // method id "dfareporting.campaigns.update":
  17688. type CampaignsUpdateCall struct {
  17689. s *Service
  17690. profileId int64
  17691. campaign *Campaign
  17692. urlParams_ gensupport.URLParams
  17693. ctx_ context.Context
  17694. header_ http.Header
  17695. }
  17696. // Update: Updates an existing campaign.
  17697. func (r *CampaignsService) Update(profileId int64, campaign *Campaign) *CampaignsUpdateCall {
  17698. c := &CampaignsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17699. c.profileId = profileId
  17700. c.campaign = campaign
  17701. return c
  17702. }
  17703. // Fields allows partial responses to be retrieved. See
  17704. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17705. // for more information.
  17706. func (c *CampaignsUpdateCall) Fields(s ...googleapi.Field) *CampaignsUpdateCall {
  17707. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17708. return c
  17709. }
  17710. // Context sets the context to be used in this call's Do method. Any
  17711. // pending HTTP request will be aborted if the provided context is
  17712. // canceled.
  17713. func (c *CampaignsUpdateCall) Context(ctx context.Context) *CampaignsUpdateCall {
  17714. c.ctx_ = ctx
  17715. return c
  17716. }
  17717. // Header returns an http.Header that can be modified by the caller to
  17718. // add HTTP headers to the request.
  17719. func (c *CampaignsUpdateCall) Header() http.Header {
  17720. if c.header_ == nil {
  17721. c.header_ = make(http.Header)
  17722. }
  17723. return c.header_
  17724. }
  17725. func (c *CampaignsUpdateCall) doRequest(alt string) (*http.Response, error) {
  17726. reqHeaders := make(http.Header)
  17727. for k, v := range c.header_ {
  17728. reqHeaders[k] = v
  17729. }
  17730. reqHeaders.Set("User-Agent", c.s.userAgent())
  17731. var body io.Reader = nil
  17732. body, err := googleapi.WithoutDataWrapper.JSONReader(c.campaign)
  17733. if err != nil {
  17734. return nil, err
  17735. }
  17736. reqHeaders.Set("Content-Type", "application/json")
  17737. c.urlParams_.Set("alt", alt)
  17738. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns")
  17739. urls += "?" + c.urlParams_.Encode()
  17740. req, _ := http.NewRequest("PUT", urls, body)
  17741. req.Header = reqHeaders
  17742. googleapi.Expand(req.URL, map[string]string{
  17743. "profileId": strconv.FormatInt(c.profileId, 10),
  17744. })
  17745. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17746. }
  17747. // Do executes the "dfareporting.campaigns.update" call.
  17748. // Exactly one of *Campaign or error will be non-nil. Any non-2xx status
  17749. // code is an error. Response headers are in either
  17750. // *Campaign.ServerResponse.Header or (if a response was returned at
  17751. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17752. // to check whether the returned error was because
  17753. // http.StatusNotModified was returned.
  17754. func (c *CampaignsUpdateCall) Do(opts ...googleapi.CallOption) (*Campaign, error) {
  17755. gensupport.SetOptions(c.urlParams_, opts...)
  17756. res, err := c.doRequest("json")
  17757. if res != nil && res.StatusCode == http.StatusNotModified {
  17758. if res.Body != nil {
  17759. res.Body.Close()
  17760. }
  17761. return nil, &googleapi.Error{
  17762. Code: res.StatusCode,
  17763. Header: res.Header,
  17764. }
  17765. }
  17766. if err != nil {
  17767. return nil, err
  17768. }
  17769. defer googleapi.CloseBody(res)
  17770. if err := googleapi.CheckResponse(res); err != nil {
  17771. return nil, err
  17772. }
  17773. ret := &Campaign{
  17774. ServerResponse: googleapi.ServerResponse{
  17775. Header: res.Header,
  17776. HTTPStatusCode: res.StatusCode,
  17777. },
  17778. }
  17779. target := &ret
  17780. if err := gensupport.DecodeResponse(target, res); err != nil {
  17781. return nil, err
  17782. }
  17783. return ret, nil
  17784. // {
  17785. // "description": "Updates an existing campaign.",
  17786. // "httpMethod": "PUT",
  17787. // "id": "dfareporting.campaigns.update",
  17788. // "parameterOrder": [
  17789. // "profileId"
  17790. // ],
  17791. // "parameters": {
  17792. // "profileId": {
  17793. // "description": "User profile ID associated with this request.",
  17794. // "format": "int64",
  17795. // "location": "path",
  17796. // "required": true,
  17797. // "type": "string"
  17798. // }
  17799. // },
  17800. // "path": "userprofiles/{profileId}/campaigns",
  17801. // "request": {
  17802. // "$ref": "Campaign"
  17803. // },
  17804. // "response": {
  17805. // "$ref": "Campaign"
  17806. // },
  17807. // "scopes": [
  17808. // "https://www.googleapis.com/auth/dfatrafficking"
  17809. // ]
  17810. // }
  17811. }
  17812. // method id "dfareporting.changeLogs.get":
  17813. type ChangeLogsGetCall struct {
  17814. s *Service
  17815. profileId int64
  17816. id int64
  17817. urlParams_ gensupport.URLParams
  17818. ifNoneMatch_ string
  17819. ctx_ context.Context
  17820. header_ http.Header
  17821. }
  17822. // Get: Gets one change log by ID.
  17823. func (r *ChangeLogsService) Get(profileId int64, id int64) *ChangeLogsGetCall {
  17824. c := &ChangeLogsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17825. c.profileId = profileId
  17826. c.id = id
  17827. return c
  17828. }
  17829. // Fields allows partial responses to be retrieved. See
  17830. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  17831. // for more information.
  17832. func (c *ChangeLogsGetCall) Fields(s ...googleapi.Field) *ChangeLogsGetCall {
  17833. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  17834. return c
  17835. }
  17836. // IfNoneMatch sets the optional parameter which makes the operation
  17837. // fail if the object's ETag matches the given value. This is useful for
  17838. // getting updates only after the object has changed since the last
  17839. // request. Use googleapi.IsNotModified to check whether the response
  17840. // error from Do is the result of In-None-Match.
  17841. func (c *ChangeLogsGetCall) IfNoneMatch(entityTag string) *ChangeLogsGetCall {
  17842. c.ifNoneMatch_ = entityTag
  17843. return c
  17844. }
  17845. // Context sets the context to be used in this call's Do method. Any
  17846. // pending HTTP request will be aborted if the provided context is
  17847. // canceled.
  17848. func (c *ChangeLogsGetCall) Context(ctx context.Context) *ChangeLogsGetCall {
  17849. c.ctx_ = ctx
  17850. return c
  17851. }
  17852. // Header returns an http.Header that can be modified by the caller to
  17853. // add HTTP headers to the request.
  17854. func (c *ChangeLogsGetCall) Header() http.Header {
  17855. if c.header_ == nil {
  17856. c.header_ = make(http.Header)
  17857. }
  17858. return c.header_
  17859. }
  17860. func (c *ChangeLogsGetCall) doRequest(alt string) (*http.Response, error) {
  17861. reqHeaders := make(http.Header)
  17862. for k, v := range c.header_ {
  17863. reqHeaders[k] = v
  17864. }
  17865. reqHeaders.Set("User-Agent", c.s.userAgent())
  17866. if c.ifNoneMatch_ != "" {
  17867. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  17868. }
  17869. var body io.Reader = nil
  17870. c.urlParams_.Set("alt", alt)
  17871. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs/{id}")
  17872. urls += "?" + c.urlParams_.Encode()
  17873. req, _ := http.NewRequest("GET", urls, body)
  17874. req.Header = reqHeaders
  17875. googleapi.Expand(req.URL, map[string]string{
  17876. "profileId": strconv.FormatInt(c.profileId, 10),
  17877. "id": strconv.FormatInt(c.id, 10),
  17878. })
  17879. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  17880. }
  17881. // Do executes the "dfareporting.changeLogs.get" call.
  17882. // Exactly one of *ChangeLog or error will be non-nil. Any non-2xx
  17883. // status code is an error. Response headers are in either
  17884. // *ChangeLog.ServerResponse.Header or (if a response was returned at
  17885. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  17886. // to check whether the returned error was because
  17887. // http.StatusNotModified was returned.
  17888. func (c *ChangeLogsGetCall) Do(opts ...googleapi.CallOption) (*ChangeLog, error) {
  17889. gensupport.SetOptions(c.urlParams_, opts...)
  17890. res, err := c.doRequest("json")
  17891. if res != nil && res.StatusCode == http.StatusNotModified {
  17892. if res.Body != nil {
  17893. res.Body.Close()
  17894. }
  17895. return nil, &googleapi.Error{
  17896. Code: res.StatusCode,
  17897. Header: res.Header,
  17898. }
  17899. }
  17900. if err != nil {
  17901. return nil, err
  17902. }
  17903. defer googleapi.CloseBody(res)
  17904. if err := googleapi.CheckResponse(res); err != nil {
  17905. return nil, err
  17906. }
  17907. ret := &ChangeLog{
  17908. ServerResponse: googleapi.ServerResponse{
  17909. Header: res.Header,
  17910. HTTPStatusCode: res.StatusCode,
  17911. },
  17912. }
  17913. target := &ret
  17914. if err := gensupport.DecodeResponse(target, res); err != nil {
  17915. return nil, err
  17916. }
  17917. return ret, nil
  17918. // {
  17919. // "description": "Gets one change log by ID.",
  17920. // "httpMethod": "GET",
  17921. // "id": "dfareporting.changeLogs.get",
  17922. // "parameterOrder": [
  17923. // "profileId",
  17924. // "id"
  17925. // ],
  17926. // "parameters": {
  17927. // "id": {
  17928. // "description": "Change log ID.",
  17929. // "format": "int64",
  17930. // "location": "path",
  17931. // "required": true,
  17932. // "type": "string"
  17933. // },
  17934. // "profileId": {
  17935. // "description": "User profile ID associated with this request.",
  17936. // "format": "int64",
  17937. // "location": "path",
  17938. // "required": true,
  17939. // "type": "string"
  17940. // }
  17941. // },
  17942. // "path": "userprofiles/{profileId}/changeLogs/{id}",
  17943. // "response": {
  17944. // "$ref": "ChangeLog"
  17945. // },
  17946. // "scopes": [
  17947. // "https://www.googleapis.com/auth/dfatrafficking"
  17948. // ]
  17949. // }
  17950. }
  17951. // method id "dfareporting.changeLogs.list":
  17952. type ChangeLogsListCall struct {
  17953. s *Service
  17954. profileId int64
  17955. urlParams_ gensupport.URLParams
  17956. ifNoneMatch_ string
  17957. ctx_ context.Context
  17958. header_ http.Header
  17959. }
  17960. // List: Retrieves a list of change logs. This method supports paging.
  17961. func (r *ChangeLogsService) List(profileId int64) *ChangeLogsListCall {
  17962. c := &ChangeLogsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  17963. c.profileId = profileId
  17964. return c
  17965. }
  17966. // Action sets the optional parameter "action": Select only change logs
  17967. // with the specified action.
  17968. //
  17969. // Possible values:
  17970. // "ACTION_ADD"
  17971. // "ACTION_ASSIGN"
  17972. // "ACTION_ASSOCIATE"
  17973. // "ACTION_CREATE"
  17974. // "ACTION_DELETE"
  17975. // "ACTION_DISABLE"
  17976. // "ACTION_EMAIL_TAGS"
  17977. // "ACTION_ENABLE"
  17978. // "ACTION_LINK"
  17979. // "ACTION_MARK_AS_DEFAULT"
  17980. // "ACTION_PUSH"
  17981. // "ACTION_REMOVE"
  17982. // "ACTION_SEND"
  17983. // "ACTION_SHARE"
  17984. // "ACTION_UNASSIGN"
  17985. // "ACTION_UNLINK"
  17986. // "ACTION_UPDATE"
  17987. func (c *ChangeLogsListCall) Action(action string) *ChangeLogsListCall {
  17988. c.urlParams_.Set("action", action)
  17989. return c
  17990. }
  17991. // Ids sets the optional parameter "ids": Select only change logs with
  17992. // these IDs.
  17993. func (c *ChangeLogsListCall) Ids(ids ...int64) *ChangeLogsListCall {
  17994. var ids_ []string
  17995. for _, v := range ids {
  17996. ids_ = append(ids_, fmt.Sprint(v))
  17997. }
  17998. c.urlParams_.SetMulti("ids", ids_)
  17999. return c
  18000. }
  18001. // MaxChangeTime sets the optional parameter "maxChangeTime": Select
  18002. // only change logs whose change time is before the specified
  18003. // maxChangeTime.The time should be formatted as an RFC3339 date/time
  18004. // string. For example, for 10:54 PM on July 18th, 2015, in the
  18005. // America/New York time zone, the format is
  18006. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  18007. // the letter T, the hour (24-hour clock system), minute, second, and
  18008. // then the time zone offset.
  18009. func (c *ChangeLogsListCall) MaxChangeTime(maxChangeTime string) *ChangeLogsListCall {
  18010. c.urlParams_.Set("maxChangeTime", maxChangeTime)
  18011. return c
  18012. }
  18013. // MaxResults sets the optional parameter "maxResults": Maximum number
  18014. // of results to return.
  18015. func (c *ChangeLogsListCall) MaxResults(maxResults int64) *ChangeLogsListCall {
  18016. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  18017. return c
  18018. }
  18019. // MinChangeTime sets the optional parameter "minChangeTime": Select
  18020. // only change logs whose change time is before the specified
  18021. // minChangeTime.The time should be formatted as an RFC3339 date/time
  18022. // string. For example, for 10:54 PM on July 18th, 2015, in the
  18023. // America/New York time zone, the format is
  18024. // "2015-07-18T22:54:00-04:00". In other words, the year, month, day,
  18025. // the letter T, the hour (24-hour clock system), minute, second, and
  18026. // then the time zone offset.
  18027. func (c *ChangeLogsListCall) MinChangeTime(minChangeTime string) *ChangeLogsListCall {
  18028. c.urlParams_.Set("minChangeTime", minChangeTime)
  18029. return c
  18030. }
  18031. // ObjectIds sets the optional parameter "objectIds": Select only change
  18032. // logs with these object IDs.
  18033. func (c *ChangeLogsListCall) ObjectIds(objectIds ...int64) *ChangeLogsListCall {
  18034. var objectIds_ []string
  18035. for _, v := range objectIds {
  18036. objectIds_ = append(objectIds_, fmt.Sprint(v))
  18037. }
  18038. c.urlParams_.SetMulti("objectIds", objectIds_)
  18039. return c
  18040. }
  18041. // ObjectType sets the optional parameter "objectType": Select only
  18042. // change logs with the specified object type.
  18043. //
  18044. // Possible values:
  18045. // "OBJECT_ACCOUNT"
  18046. // "OBJECT_ACCOUNT_BILLING_FEATURE"
  18047. // "OBJECT_AD"
  18048. // "OBJECT_ADVERTISER"
  18049. // "OBJECT_ADVERTISER_GROUP"
  18050. // "OBJECT_BILLING_ACCOUNT_GROUP"
  18051. // "OBJECT_BILLING_FEATURE"
  18052. // "OBJECT_BILLING_MINIMUM_FEE"
  18053. // "OBJECT_BILLING_PROFILE"
  18054. // "OBJECT_CAMPAIGN"
  18055. // "OBJECT_CONTENT_CATEGORY"
  18056. // "OBJECT_CREATIVE"
  18057. // "OBJECT_CREATIVE_ASSET"
  18058. // "OBJECT_CREATIVE_BUNDLE"
  18059. // "OBJECT_CREATIVE_FIELD"
  18060. // "OBJECT_CREATIVE_GROUP"
  18061. // "OBJECT_DFA_SITE"
  18062. // "OBJECT_EVENT_TAG"
  18063. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP"
  18064. // "OBJECT_FLOODLIGHT_ACTVITY"
  18065. // "OBJECT_FLOODLIGHT_CONFIGURATION"
  18066. // "OBJECT_INSTREAM_CREATIVE"
  18067. // "OBJECT_LANDING_PAGE"
  18068. // "OBJECT_MEDIA_ORDER"
  18069. // "OBJECT_PLACEMENT"
  18070. // "OBJECT_PLACEMENT_STRATEGY"
  18071. // "OBJECT_PLAYSTORE_LINK"
  18072. // "OBJECT_PROVIDED_LIST_CLIENT"
  18073. // "OBJECT_RATE_CARD"
  18074. // "OBJECT_REMARKETING_LIST"
  18075. // "OBJECT_RICHMEDIA_CREATIVE"
  18076. // "OBJECT_SD_SITE"
  18077. // "OBJECT_SEARCH_LIFT_STUDY"
  18078. // "OBJECT_SIZE"
  18079. // "OBJECT_SUBACCOUNT"
  18080. // "OBJECT_TARGETING_TEMPLATE"
  18081. // "OBJECT_USER_PROFILE"
  18082. // "OBJECT_USER_PROFILE_FILTER"
  18083. // "OBJECT_USER_ROLE"
  18084. func (c *ChangeLogsListCall) ObjectType(objectType string) *ChangeLogsListCall {
  18085. c.urlParams_.Set("objectType", objectType)
  18086. return c
  18087. }
  18088. // PageToken sets the optional parameter "pageToken": Value of the
  18089. // nextPageToken from the previous result page.
  18090. func (c *ChangeLogsListCall) PageToken(pageToken string) *ChangeLogsListCall {
  18091. c.urlParams_.Set("pageToken", pageToken)
  18092. return c
  18093. }
  18094. // SearchString sets the optional parameter "searchString": Select only
  18095. // change logs whose object ID, user name, old or new values match the
  18096. // search string.
  18097. func (c *ChangeLogsListCall) SearchString(searchString string) *ChangeLogsListCall {
  18098. c.urlParams_.Set("searchString", searchString)
  18099. return c
  18100. }
  18101. // UserProfileIds sets the optional parameter "userProfileIds": Select
  18102. // only change logs with these user profile IDs.
  18103. func (c *ChangeLogsListCall) UserProfileIds(userProfileIds ...int64) *ChangeLogsListCall {
  18104. var userProfileIds_ []string
  18105. for _, v := range userProfileIds {
  18106. userProfileIds_ = append(userProfileIds_, fmt.Sprint(v))
  18107. }
  18108. c.urlParams_.SetMulti("userProfileIds", userProfileIds_)
  18109. return c
  18110. }
  18111. // Fields allows partial responses to be retrieved. See
  18112. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18113. // for more information.
  18114. func (c *ChangeLogsListCall) Fields(s ...googleapi.Field) *ChangeLogsListCall {
  18115. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18116. return c
  18117. }
  18118. // IfNoneMatch sets the optional parameter which makes the operation
  18119. // fail if the object's ETag matches the given value. This is useful for
  18120. // getting updates only after the object has changed since the last
  18121. // request. Use googleapi.IsNotModified to check whether the response
  18122. // error from Do is the result of In-None-Match.
  18123. func (c *ChangeLogsListCall) IfNoneMatch(entityTag string) *ChangeLogsListCall {
  18124. c.ifNoneMatch_ = entityTag
  18125. return c
  18126. }
  18127. // Context sets the context to be used in this call's Do method. Any
  18128. // pending HTTP request will be aborted if the provided context is
  18129. // canceled.
  18130. func (c *ChangeLogsListCall) Context(ctx context.Context) *ChangeLogsListCall {
  18131. c.ctx_ = ctx
  18132. return c
  18133. }
  18134. // Header returns an http.Header that can be modified by the caller to
  18135. // add HTTP headers to the request.
  18136. func (c *ChangeLogsListCall) Header() http.Header {
  18137. if c.header_ == nil {
  18138. c.header_ = make(http.Header)
  18139. }
  18140. return c.header_
  18141. }
  18142. func (c *ChangeLogsListCall) doRequest(alt string) (*http.Response, error) {
  18143. reqHeaders := make(http.Header)
  18144. for k, v := range c.header_ {
  18145. reqHeaders[k] = v
  18146. }
  18147. reqHeaders.Set("User-Agent", c.s.userAgent())
  18148. if c.ifNoneMatch_ != "" {
  18149. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18150. }
  18151. var body io.Reader = nil
  18152. c.urlParams_.Set("alt", alt)
  18153. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/changeLogs")
  18154. urls += "?" + c.urlParams_.Encode()
  18155. req, _ := http.NewRequest("GET", urls, body)
  18156. req.Header = reqHeaders
  18157. googleapi.Expand(req.URL, map[string]string{
  18158. "profileId": strconv.FormatInt(c.profileId, 10),
  18159. })
  18160. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18161. }
  18162. // Do executes the "dfareporting.changeLogs.list" call.
  18163. // Exactly one of *ChangeLogsListResponse or error will be non-nil. Any
  18164. // non-2xx status code is an error. Response headers are in either
  18165. // *ChangeLogsListResponse.ServerResponse.Header or (if a response was
  18166. // returned at all) in error.(*googleapi.Error).Header. Use
  18167. // googleapi.IsNotModified to check whether the returned error was
  18168. // because http.StatusNotModified was returned.
  18169. func (c *ChangeLogsListCall) Do(opts ...googleapi.CallOption) (*ChangeLogsListResponse, error) {
  18170. gensupport.SetOptions(c.urlParams_, opts...)
  18171. res, err := c.doRequest("json")
  18172. if res != nil && res.StatusCode == http.StatusNotModified {
  18173. if res.Body != nil {
  18174. res.Body.Close()
  18175. }
  18176. return nil, &googleapi.Error{
  18177. Code: res.StatusCode,
  18178. Header: res.Header,
  18179. }
  18180. }
  18181. if err != nil {
  18182. return nil, err
  18183. }
  18184. defer googleapi.CloseBody(res)
  18185. if err := googleapi.CheckResponse(res); err != nil {
  18186. return nil, err
  18187. }
  18188. ret := &ChangeLogsListResponse{
  18189. ServerResponse: googleapi.ServerResponse{
  18190. Header: res.Header,
  18191. HTTPStatusCode: res.StatusCode,
  18192. },
  18193. }
  18194. target := &ret
  18195. if err := gensupport.DecodeResponse(target, res); err != nil {
  18196. return nil, err
  18197. }
  18198. return ret, nil
  18199. // {
  18200. // "description": "Retrieves a list of change logs. This method supports paging.",
  18201. // "httpMethod": "GET",
  18202. // "id": "dfareporting.changeLogs.list",
  18203. // "parameterOrder": [
  18204. // "profileId"
  18205. // ],
  18206. // "parameters": {
  18207. // "action": {
  18208. // "description": "Select only change logs with the specified action.",
  18209. // "enum": [
  18210. // "ACTION_ADD",
  18211. // "ACTION_ASSIGN",
  18212. // "ACTION_ASSOCIATE",
  18213. // "ACTION_CREATE",
  18214. // "ACTION_DELETE",
  18215. // "ACTION_DISABLE",
  18216. // "ACTION_EMAIL_TAGS",
  18217. // "ACTION_ENABLE",
  18218. // "ACTION_LINK",
  18219. // "ACTION_MARK_AS_DEFAULT",
  18220. // "ACTION_PUSH",
  18221. // "ACTION_REMOVE",
  18222. // "ACTION_SEND",
  18223. // "ACTION_SHARE",
  18224. // "ACTION_UNASSIGN",
  18225. // "ACTION_UNLINK",
  18226. // "ACTION_UPDATE"
  18227. // ],
  18228. // "enumDescriptions": [
  18229. // "",
  18230. // "",
  18231. // "",
  18232. // "",
  18233. // "",
  18234. // "",
  18235. // "",
  18236. // "",
  18237. // "",
  18238. // "",
  18239. // "",
  18240. // "",
  18241. // "",
  18242. // "",
  18243. // "",
  18244. // "",
  18245. // ""
  18246. // ],
  18247. // "location": "query",
  18248. // "type": "string"
  18249. // },
  18250. // "ids": {
  18251. // "description": "Select only change logs with these IDs.",
  18252. // "format": "int64",
  18253. // "location": "query",
  18254. // "repeated": true,
  18255. // "type": "string"
  18256. // },
  18257. // "maxChangeTime": {
  18258. // "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.",
  18259. // "location": "query",
  18260. // "type": "string"
  18261. // },
  18262. // "maxResults": {
  18263. // "default": "1000",
  18264. // "description": "Maximum number of results to return.",
  18265. // "format": "int32",
  18266. // "location": "query",
  18267. // "maximum": "1000",
  18268. // "minimum": "0",
  18269. // "type": "integer"
  18270. // },
  18271. // "minChangeTime": {
  18272. // "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.",
  18273. // "location": "query",
  18274. // "type": "string"
  18275. // },
  18276. // "objectIds": {
  18277. // "description": "Select only change logs with these object IDs.",
  18278. // "format": "int64",
  18279. // "location": "query",
  18280. // "repeated": true,
  18281. // "type": "string"
  18282. // },
  18283. // "objectType": {
  18284. // "description": "Select only change logs with the specified object type.",
  18285. // "enum": [
  18286. // "OBJECT_ACCOUNT",
  18287. // "OBJECT_ACCOUNT_BILLING_FEATURE",
  18288. // "OBJECT_AD",
  18289. // "OBJECT_ADVERTISER",
  18290. // "OBJECT_ADVERTISER_GROUP",
  18291. // "OBJECT_BILLING_ACCOUNT_GROUP",
  18292. // "OBJECT_BILLING_FEATURE",
  18293. // "OBJECT_BILLING_MINIMUM_FEE",
  18294. // "OBJECT_BILLING_PROFILE",
  18295. // "OBJECT_CAMPAIGN",
  18296. // "OBJECT_CONTENT_CATEGORY",
  18297. // "OBJECT_CREATIVE",
  18298. // "OBJECT_CREATIVE_ASSET",
  18299. // "OBJECT_CREATIVE_BUNDLE",
  18300. // "OBJECT_CREATIVE_FIELD",
  18301. // "OBJECT_CREATIVE_GROUP",
  18302. // "OBJECT_DFA_SITE",
  18303. // "OBJECT_EVENT_TAG",
  18304. // "OBJECT_FLOODLIGHT_ACTIVITY_GROUP",
  18305. // "OBJECT_FLOODLIGHT_ACTVITY",
  18306. // "OBJECT_FLOODLIGHT_CONFIGURATION",
  18307. // "OBJECT_INSTREAM_CREATIVE",
  18308. // "OBJECT_LANDING_PAGE",
  18309. // "OBJECT_MEDIA_ORDER",
  18310. // "OBJECT_PLACEMENT",
  18311. // "OBJECT_PLACEMENT_STRATEGY",
  18312. // "OBJECT_PLAYSTORE_LINK",
  18313. // "OBJECT_PROVIDED_LIST_CLIENT",
  18314. // "OBJECT_RATE_CARD",
  18315. // "OBJECT_REMARKETING_LIST",
  18316. // "OBJECT_RICHMEDIA_CREATIVE",
  18317. // "OBJECT_SD_SITE",
  18318. // "OBJECT_SEARCH_LIFT_STUDY",
  18319. // "OBJECT_SIZE",
  18320. // "OBJECT_SUBACCOUNT",
  18321. // "OBJECT_TARGETING_TEMPLATE",
  18322. // "OBJECT_USER_PROFILE",
  18323. // "OBJECT_USER_PROFILE_FILTER",
  18324. // "OBJECT_USER_ROLE"
  18325. // ],
  18326. // "enumDescriptions": [
  18327. // "",
  18328. // "",
  18329. // "",
  18330. // "",
  18331. // "",
  18332. // "",
  18333. // "",
  18334. // "",
  18335. // "",
  18336. // "",
  18337. // "",
  18338. // "",
  18339. // "",
  18340. // "",
  18341. // "",
  18342. // "",
  18343. // "",
  18344. // "",
  18345. // "",
  18346. // "",
  18347. // "",
  18348. // "",
  18349. // "",
  18350. // "",
  18351. // "",
  18352. // "",
  18353. // "",
  18354. // "",
  18355. // "",
  18356. // "",
  18357. // "",
  18358. // "",
  18359. // "",
  18360. // "",
  18361. // "",
  18362. // "",
  18363. // "",
  18364. // "",
  18365. // ""
  18366. // ],
  18367. // "location": "query",
  18368. // "type": "string"
  18369. // },
  18370. // "pageToken": {
  18371. // "description": "Value of the nextPageToken from the previous result page.",
  18372. // "location": "query",
  18373. // "type": "string"
  18374. // },
  18375. // "profileId": {
  18376. // "description": "User profile ID associated with this request.",
  18377. // "format": "int64",
  18378. // "location": "path",
  18379. // "required": true,
  18380. // "type": "string"
  18381. // },
  18382. // "searchString": {
  18383. // "description": "Select only change logs whose object ID, user name, old or new values match the search string.",
  18384. // "location": "query",
  18385. // "type": "string"
  18386. // },
  18387. // "userProfileIds": {
  18388. // "description": "Select only change logs with these user profile IDs.",
  18389. // "format": "int64",
  18390. // "location": "query",
  18391. // "repeated": true,
  18392. // "type": "string"
  18393. // }
  18394. // },
  18395. // "path": "userprofiles/{profileId}/changeLogs",
  18396. // "response": {
  18397. // "$ref": "ChangeLogsListResponse"
  18398. // },
  18399. // "scopes": [
  18400. // "https://www.googleapis.com/auth/dfatrafficking"
  18401. // ]
  18402. // }
  18403. }
  18404. // Pages invokes f for each page of results.
  18405. // A non-nil error returned from f will halt the iteration.
  18406. // The provided context supersedes any context provided to the Context method.
  18407. func (c *ChangeLogsListCall) Pages(ctx context.Context, f func(*ChangeLogsListResponse) error) error {
  18408. c.ctx_ = ctx
  18409. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  18410. for {
  18411. x, err := c.Do()
  18412. if err != nil {
  18413. return err
  18414. }
  18415. if err := f(x); err != nil {
  18416. return err
  18417. }
  18418. if x.NextPageToken == "" {
  18419. return nil
  18420. }
  18421. c.PageToken(x.NextPageToken)
  18422. }
  18423. }
  18424. // method id "dfareporting.cities.list":
  18425. type CitiesListCall struct {
  18426. s *Service
  18427. profileId int64
  18428. urlParams_ gensupport.URLParams
  18429. ifNoneMatch_ string
  18430. ctx_ context.Context
  18431. header_ http.Header
  18432. }
  18433. // List: Retrieves a list of cities, possibly filtered.
  18434. func (r *CitiesService) List(profileId int64) *CitiesListCall {
  18435. c := &CitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18436. c.profileId = profileId
  18437. return c
  18438. }
  18439. // CountryDartIds sets the optional parameter "countryDartIds": Select
  18440. // only cities from these countries.
  18441. func (c *CitiesListCall) CountryDartIds(countryDartIds ...int64) *CitiesListCall {
  18442. var countryDartIds_ []string
  18443. for _, v := range countryDartIds {
  18444. countryDartIds_ = append(countryDartIds_, fmt.Sprint(v))
  18445. }
  18446. c.urlParams_.SetMulti("countryDartIds", countryDartIds_)
  18447. return c
  18448. }
  18449. // DartIds sets the optional parameter "dartIds": Select only cities
  18450. // with these DART IDs.
  18451. func (c *CitiesListCall) DartIds(dartIds ...int64) *CitiesListCall {
  18452. var dartIds_ []string
  18453. for _, v := range dartIds {
  18454. dartIds_ = append(dartIds_, fmt.Sprint(v))
  18455. }
  18456. c.urlParams_.SetMulti("dartIds", dartIds_)
  18457. return c
  18458. }
  18459. // NamePrefix sets the optional parameter "namePrefix": Select only
  18460. // cities with names starting with this prefix.
  18461. func (c *CitiesListCall) NamePrefix(namePrefix string) *CitiesListCall {
  18462. c.urlParams_.Set("namePrefix", namePrefix)
  18463. return c
  18464. }
  18465. // RegionDartIds sets the optional parameter "regionDartIds": Select
  18466. // only cities from these regions.
  18467. func (c *CitiesListCall) RegionDartIds(regionDartIds ...int64) *CitiesListCall {
  18468. var regionDartIds_ []string
  18469. for _, v := range regionDartIds {
  18470. regionDartIds_ = append(regionDartIds_, fmt.Sprint(v))
  18471. }
  18472. c.urlParams_.SetMulti("regionDartIds", regionDartIds_)
  18473. return c
  18474. }
  18475. // Fields allows partial responses to be retrieved. See
  18476. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18477. // for more information.
  18478. func (c *CitiesListCall) Fields(s ...googleapi.Field) *CitiesListCall {
  18479. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18480. return c
  18481. }
  18482. // IfNoneMatch sets the optional parameter which makes the operation
  18483. // fail if the object's ETag matches the given value. This is useful for
  18484. // getting updates only after the object has changed since the last
  18485. // request. Use googleapi.IsNotModified to check whether the response
  18486. // error from Do is the result of In-None-Match.
  18487. func (c *CitiesListCall) IfNoneMatch(entityTag string) *CitiesListCall {
  18488. c.ifNoneMatch_ = entityTag
  18489. return c
  18490. }
  18491. // Context sets the context to be used in this call's Do method. Any
  18492. // pending HTTP request will be aborted if the provided context is
  18493. // canceled.
  18494. func (c *CitiesListCall) Context(ctx context.Context) *CitiesListCall {
  18495. c.ctx_ = ctx
  18496. return c
  18497. }
  18498. // Header returns an http.Header that can be modified by the caller to
  18499. // add HTTP headers to the request.
  18500. func (c *CitiesListCall) Header() http.Header {
  18501. if c.header_ == nil {
  18502. c.header_ = make(http.Header)
  18503. }
  18504. return c.header_
  18505. }
  18506. func (c *CitiesListCall) doRequest(alt string) (*http.Response, error) {
  18507. reqHeaders := make(http.Header)
  18508. for k, v := range c.header_ {
  18509. reqHeaders[k] = v
  18510. }
  18511. reqHeaders.Set("User-Agent", c.s.userAgent())
  18512. if c.ifNoneMatch_ != "" {
  18513. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18514. }
  18515. var body io.Reader = nil
  18516. c.urlParams_.Set("alt", alt)
  18517. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/cities")
  18518. urls += "?" + c.urlParams_.Encode()
  18519. req, _ := http.NewRequest("GET", urls, body)
  18520. req.Header = reqHeaders
  18521. googleapi.Expand(req.URL, map[string]string{
  18522. "profileId": strconv.FormatInt(c.profileId, 10),
  18523. })
  18524. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18525. }
  18526. // Do executes the "dfareporting.cities.list" call.
  18527. // Exactly one of *CitiesListResponse or error will be non-nil. Any
  18528. // non-2xx status code is an error. Response headers are in either
  18529. // *CitiesListResponse.ServerResponse.Header or (if a response was
  18530. // returned at all) in error.(*googleapi.Error).Header. Use
  18531. // googleapi.IsNotModified to check whether the returned error was
  18532. // because http.StatusNotModified was returned.
  18533. func (c *CitiesListCall) Do(opts ...googleapi.CallOption) (*CitiesListResponse, error) {
  18534. gensupport.SetOptions(c.urlParams_, opts...)
  18535. res, err := c.doRequest("json")
  18536. if res != nil && res.StatusCode == http.StatusNotModified {
  18537. if res.Body != nil {
  18538. res.Body.Close()
  18539. }
  18540. return nil, &googleapi.Error{
  18541. Code: res.StatusCode,
  18542. Header: res.Header,
  18543. }
  18544. }
  18545. if err != nil {
  18546. return nil, err
  18547. }
  18548. defer googleapi.CloseBody(res)
  18549. if err := googleapi.CheckResponse(res); err != nil {
  18550. return nil, err
  18551. }
  18552. ret := &CitiesListResponse{
  18553. ServerResponse: googleapi.ServerResponse{
  18554. Header: res.Header,
  18555. HTTPStatusCode: res.StatusCode,
  18556. },
  18557. }
  18558. target := &ret
  18559. if err := gensupport.DecodeResponse(target, res); err != nil {
  18560. return nil, err
  18561. }
  18562. return ret, nil
  18563. // {
  18564. // "description": "Retrieves a list of cities, possibly filtered.",
  18565. // "httpMethod": "GET",
  18566. // "id": "dfareporting.cities.list",
  18567. // "parameterOrder": [
  18568. // "profileId"
  18569. // ],
  18570. // "parameters": {
  18571. // "countryDartIds": {
  18572. // "description": "Select only cities from these countries.",
  18573. // "format": "int64",
  18574. // "location": "query",
  18575. // "repeated": true,
  18576. // "type": "string"
  18577. // },
  18578. // "dartIds": {
  18579. // "description": "Select only cities with these DART IDs.",
  18580. // "format": "int64",
  18581. // "location": "query",
  18582. // "repeated": true,
  18583. // "type": "string"
  18584. // },
  18585. // "namePrefix": {
  18586. // "description": "Select only cities with names starting with this prefix.",
  18587. // "location": "query",
  18588. // "type": "string"
  18589. // },
  18590. // "profileId": {
  18591. // "description": "User profile ID associated with this request.",
  18592. // "format": "int64",
  18593. // "location": "path",
  18594. // "required": true,
  18595. // "type": "string"
  18596. // },
  18597. // "regionDartIds": {
  18598. // "description": "Select only cities from these regions.",
  18599. // "format": "int64",
  18600. // "location": "query",
  18601. // "repeated": true,
  18602. // "type": "string"
  18603. // }
  18604. // },
  18605. // "path": "userprofiles/{profileId}/cities",
  18606. // "response": {
  18607. // "$ref": "CitiesListResponse"
  18608. // },
  18609. // "scopes": [
  18610. // "https://www.googleapis.com/auth/dfatrafficking"
  18611. // ]
  18612. // }
  18613. }
  18614. // method id "dfareporting.connectionTypes.get":
  18615. type ConnectionTypesGetCall struct {
  18616. s *Service
  18617. profileId int64
  18618. id int64
  18619. urlParams_ gensupport.URLParams
  18620. ifNoneMatch_ string
  18621. ctx_ context.Context
  18622. header_ http.Header
  18623. }
  18624. // Get: Gets one connection type by ID.
  18625. func (r *ConnectionTypesService) Get(profileId int64, id int64) *ConnectionTypesGetCall {
  18626. c := &ConnectionTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18627. c.profileId = profileId
  18628. c.id = id
  18629. return c
  18630. }
  18631. // Fields allows partial responses to be retrieved. See
  18632. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18633. // for more information.
  18634. func (c *ConnectionTypesGetCall) Fields(s ...googleapi.Field) *ConnectionTypesGetCall {
  18635. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18636. return c
  18637. }
  18638. // IfNoneMatch sets the optional parameter which makes the operation
  18639. // fail if the object's ETag matches the given value. This is useful for
  18640. // getting updates only after the object has changed since the last
  18641. // request. Use googleapi.IsNotModified to check whether the response
  18642. // error from Do is the result of In-None-Match.
  18643. func (c *ConnectionTypesGetCall) IfNoneMatch(entityTag string) *ConnectionTypesGetCall {
  18644. c.ifNoneMatch_ = entityTag
  18645. return c
  18646. }
  18647. // Context sets the context to be used in this call's Do method. Any
  18648. // pending HTTP request will be aborted if the provided context is
  18649. // canceled.
  18650. func (c *ConnectionTypesGetCall) Context(ctx context.Context) *ConnectionTypesGetCall {
  18651. c.ctx_ = ctx
  18652. return c
  18653. }
  18654. // Header returns an http.Header that can be modified by the caller to
  18655. // add HTTP headers to the request.
  18656. func (c *ConnectionTypesGetCall) Header() http.Header {
  18657. if c.header_ == nil {
  18658. c.header_ = make(http.Header)
  18659. }
  18660. return c.header_
  18661. }
  18662. func (c *ConnectionTypesGetCall) doRequest(alt string) (*http.Response, error) {
  18663. reqHeaders := make(http.Header)
  18664. for k, v := range c.header_ {
  18665. reqHeaders[k] = v
  18666. }
  18667. reqHeaders.Set("User-Agent", c.s.userAgent())
  18668. if c.ifNoneMatch_ != "" {
  18669. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18670. }
  18671. var body io.Reader = nil
  18672. c.urlParams_.Set("alt", alt)
  18673. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes/{id}")
  18674. urls += "?" + c.urlParams_.Encode()
  18675. req, _ := http.NewRequest("GET", urls, body)
  18676. req.Header = reqHeaders
  18677. googleapi.Expand(req.URL, map[string]string{
  18678. "profileId": strconv.FormatInt(c.profileId, 10),
  18679. "id": strconv.FormatInt(c.id, 10),
  18680. })
  18681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18682. }
  18683. // Do executes the "dfareporting.connectionTypes.get" call.
  18684. // Exactly one of *ConnectionType or error will be non-nil. Any non-2xx
  18685. // status code is an error. Response headers are in either
  18686. // *ConnectionType.ServerResponse.Header or (if a response was returned
  18687. // at all) in error.(*googleapi.Error).Header. Use
  18688. // googleapi.IsNotModified to check whether the returned error was
  18689. // because http.StatusNotModified was returned.
  18690. func (c *ConnectionTypesGetCall) Do(opts ...googleapi.CallOption) (*ConnectionType, error) {
  18691. gensupport.SetOptions(c.urlParams_, opts...)
  18692. res, err := c.doRequest("json")
  18693. if res != nil && res.StatusCode == http.StatusNotModified {
  18694. if res.Body != nil {
  18695. res.Body.Close()
  18696. }
  18697. return nil, &googleapi.Error{
  18698. Code: res.StatusCode,
  18699. Header: res.Header,
  18700. }
  18701. }
  18702. if err != nil {
  18703. return nil, err
  18704. }
  18705. defer googleapi.CloseBody(res)
  18706. if err := googleapi.CheckResponse(res); err != nil {
  18707. return nil, err
  18708. }
  18709. ret := &ConnectionType{
  18710. ServerResponse: googleapi.ServerResponse{
  18711. Header: res.Header,
  18712. HTTPStatusCode: res.StatusCode,
  18713. },
  18714. }
  18715. target := &ret
  18716. if err := gensupport.DecodeResponse(target, res); err != nil {
  18717. return nil, err
  18718. }
  18719. return ret, nil
  18720. // {
  18721. // "description": "Gets one connection type by ID.",
  18722. // "httpMethod": "GET",
  18723. // "id": "dfareporting.connectionTypes.get",
  18724. // "parameterOrder": [
  18725. // "profileId",
  18726. // "id"
  18727. // ],
  18728. // "parameters": {
  18729. // "id": {
  18730. // "description": "Connection type ID.",
  18731. // "format": "int64",
  18732. // "location": "path",
  18733. // "required": true,
  18734. // "type": "string"
  18735. // },
  18736. // "profileId": {
  18737. // "description": "User profile ID associated with this request.",
  18738. // "format": "int64",
  18739. // "location": "path",
  18740. // "required": true,
  18741. // "type": "string"
  18742. // }
  18743. // },
  18744. // "path": "userprofiles/{profileId}/connectionTypes/{id}",
  18745. // "response": {
  18746. // "$ref": "ConnectionType"
  18747. // },
  18748. // "scopes": [
  18749. // "https://www.googleapis.com/auth/dfatrafficking"
  18750. // ]
  18751. // }
  18752. }
  18753. // method id "dfareporting.connectionTypes.list":
  18754. type ConnectionTypesListCall struct {
  18755. s *Service
  18756. profileId int64
  18757. urlParams_ gensupport.URLParams
  18758. ifNoneMatch_ string
  18759. ctx_ context.Context
  18760. header_ http.Header
  18761. }
  18762. // List: Retrieves a list of connection types.
  18763. func (r *ConnectionTypesService) List(profileId int64) *ConnectionTypesListCall {
  18764. c := &ConnectionTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18765. c.profileId = profileId
  18766. return c
  18767. }
  18768. // Fields allows partial responses to be retrieved. See
  18769. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18770. // for more information.
  18771. func (c *ConnectionTypesListCall) Fields(s ...googleapi.Field) *ConnectionTypesListCall {
  18772. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18773. return c
  18774. }
  18775. // IfNoneMatch sets the optional parameter which makes the operation
  18776. // fail if the object's ETag matches the given value. This is useful for
  18777. // getting updates only after the object has changed since the last
  18778. // request. Use googleapi.IsNotModified to check whether the response
  18779. // error from Do is the result of In-None-Match.
  18780. func (c *ConnectionTypesListCall) IfNoneMatch(entityTag string) *ConnectionTypesListCall {
  18781. c.ifNoneMatch_ = entityTag
  18782. return c
  18783. }
  18784. // Context sets the context to be used in this call's Do method. Any
  18785. // pending HTTP request will be aborted if the provided context is
  18786. // canceled.
  18787. func (c *ConnectionTypesListCall) Context(ctx context.Context) *ConnectionTypesListCall {
  18788. c.ctx_ = ctx
  18789. return c
  18790. }
  18791. // Header returns an http.Header that can be modified by the caller to
  18792. // add HTTP headers to the request.
  18793. func (c *ConnectionTypesListCall) Header() http.Header {
  18794. if c.header_ == nil {
  18795. c.header_ = make(http.Header)
  18796. }
  18797. return c.header_
  18798. }
  18799. func (c *ConnectionTypesListCall) doRequest(alt string) (*http.Response, error) {
  18800. reqHeaders := make(http.Header)
  18801. for k, v := range c.header_ {
  18802. reqHeaders[k] = v
  18803. }
  18804. reqHeaders.Set("User-Agent", c.s.userAgent())
  18805. if c.ifNoneMatch_ != "" {
  18806. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  18807. }
  18808. var body io.Reader = nil
  18809. c.urlParams_.Set("alt", alt)
  18810. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/connectionTypes")
  18811. urls += "?" + c.urlParams_.Encode()
  18812. req, _ := http.NewRequest("GET", urls, body)
  18813. req.Header = reqHeaders
  18814. googleapi.Expand(req.URL, map[string]string{
  18815. "profileId": strconv.FormatInt(c.profileId, 10),
  18816. })
  18817. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18818. }
  18819. // Do executes the "dfareporting.connectionTypes.list" call.
  18820. // Exactly one of *ConnectionTypesListResponse or error will be non-nil.
  18821. // Any non-2xx status code is an error. Response headers are in either
  18822. // *ConnectionTypesListResponse.ServerResponse.Header or (if a response
  18823. // was returned at all) in error.(*googleapi.Error).Header. Use
  18824. // googleapi.IsNotModified to check whether the returned error was
  18825. // because http.StatusNotModified was returned.
  18826. func (c *ConnectionTypesListCall) Do(opts ...googleapi.CallOption) (*ConnectionTypesListResponse, error) {
  18827. gensupport.SetOptions(c.urlParams_, opts...)
  18828. res, err := c.doRequest("json")
  18829. if res != nil && res.StatusCode == http.StatusNotModified {
  18830. if res.Body != nil {
  18831. res.Body.Close()
  18832. }
  18833. return nil, &googleapi.Error{
  18834. Code: res.StatusCode,
  18835. Header: res.Header,
  18836. }
  18837. }
  18838. if err != nil {
  18839. return nil, err
  18840. }
  18841. defer googleapi.CloseBody(res)
  18842. if err := googleapi.CheckResponse(res); err != nil {
  18843. return nil, err
  18844. }
  18845. ret := &ConnectionTypesListResponse{
  18846. ServerResponse: googleapi.ServerResponse{
  18847. Header: res.Header,
  18848. HTTPStatusCode: res.StatusCode,
  18849. },
  18850. }
  18851. target := &ret
  18852. if err := gensupport.DecodeResponse(target, res); err != nil {
  18853. return nil, err
  18854. }
  18855. return ret, nil
  18856. // {
  18857. // "description": "Retrieves a list of connection types.",
  18858. // "httpMethod": "GET",
  18859. // "id": "dfareporting.connectionTypes.list",
  18860. // "parameterOrder": [
  18861. // "profileId"
  18862. // ],
  18863. // "parameters": {
  18864. // "profileId": {
  18865. // "description": "User profile ID associated with this request.",
  18866. // "format": "int64",
  18867. // "location": "path",
  18868. // "required": true,
  18869. // "type": "string"
  18870. // }
  18871. // },
  18872. // "path": "userprofiles/{profileId}/connectionTypes",
  18873. // "response": {
  18874. // "$ref": "ConnectionTypesListResponse"
  18875. // },
  18876. // "scopes": [
  18877. // "https://www.googleapis.com/auth/dfatrafficking"
  18878. // ]
  18879. // }
  18880. }
  18881. // method id "dfareporting.contentCategories.delete":
  18882. type ContentCategoriesDeleteCall struct {
  18883. s *Service
  18884. profileId int64
  18885. id int64
  18886. urlParams_ gensupport.URLParams
  18887. ctx_ context.Context
  18888. header_ http.Header
  18889. }
  18890. // Delete: Deletes an existing content category.
  18891. func (r *ContentCategoriesService) Delete(profileId int64, id int64) *ContentCategoriesDeleteCall {
  18892. c := &ContentCategoriesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18893. c.profileId = profileId
  18894. c.id = id
  18895. return c
  18896. }
  18897. // Fields allows partial responses to be retrieved. See
  18898. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18899. // for more information.
  18900. func (c *ContentCategoriesDeleteCall) Fields(s ...googleapi.Field) *ContentCategoriesDeleteCall {
  18901. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  18902. return c
  18903. }
  18904. // Context sets the context to be used in this call's Do method. Any
  18905. // pending HTTP request will be aborted if the provided context is
  18906. // canceled.
  18907. func (c *ContentCategoriesDeleteCall) Context(ctx context.Context) *ContentCategoriesDeleteCall {
  18908. c.ctx_ = ctx
  18909. return c
  18910. }
  18911. // Header returns an http.Header that can be modified by the caller to
  18912. // add HTTP headers to the request.
  18913. func (c *ContentCategoriesDeleteCall) Header() http.Header {
  18914. if c.header_ == nil {
  18915. c.header_ = make(http.Header)
  18916. }
  18917. return c.header_
  18918. }
  18919. func (c *ContentCategoriesDeleteCall) doRequest(alt string) (*http.Response, error) {
  18920. reqHeaders := make(http.Header)
  18921. for k, v := range c.header_ {
  18922. reqHeaders[k] = v
  18923. }
  18924. reqHeaders.Set("User-Agent", c.s.userAgent())
  18925. var body io.Reader = nil
  18926. c.urlParams_.Set("alt", alt)
  18927. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  18928. urls += "?" + c.urlParams_.Encode()
  18929. req, _ := http.NewRequest("DELETE", urls, body)
  18930. req.Header = reqHeaders
  18931. googleapi.Expand(req.URL, map[string]string{
  18932. "profileId": strconv.FormatInt(c.profileId, 10),
  18933. "id": strconv.FormatInt(c.id, 10),
  18934. })
  18935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  18936. }
  18937. // Do executes the "dfareporting.contentCategories.delete" call.
  18938. func (c *ContentCategoriesDeleteCall) Do(opts ...googleapi.CallOption) error {
  18939. gensupport.SetOptions(c.urlParams_, opts...)
  18940. res, err := c.doRequest("json")
  18941. if err != nil {
  18942. return err
  18943. }
  18944. defer googleapi.CloseBody(res)
  18945. if err := googleapi.CheckResponse(res); err != nil {
  18946. return err
  18947. }
  18948. return nil
  18949. // {
  18950. // "description": "Deletes an existing content category.",
  18951. // "httpMethod": "DELETE",
  18952. // "id": "dfareporting.contentCategories.delete",
  18953. // "parameterOrder": [
  18954. // "profileId",
  18955. // "id"
  18956. // ],
  18957. // "parameters": {
  18958. // "id": {
  18959. // "description": "Content category ID.",
  18960. // "format": "int64",
  18961. // "location": "path",
  18962. // "required": true,
  18963. // "type": "string"
  18964. // },
  18965. // "profileId": {
  18966. // "description": "User profile ID associated with this request.",
  18967. // "format": "int64",
  18968. // "location": "path",
  18969. // "required": true,
  18970. // "type": "string"
  18971. // }
  18972. // },
  18973. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  18974. // "scopes": [
  18975. // "https://www.googleapis.com/auth/dfatrafficking"
  18976. // ]
  18977. // }
  18978. }
  18979. // method id "dfareporting.contentCategories.get":
  18980. type ContentCategoriesGetCall struct {
  18981. s *Service
  18982. profileId int64
  18983. id int64
  18984. urlParams_ gensupport.URLParams
  18985. ifNoneMatch_ string
  18986. ctx_ context.Context
  18987. header_ http.Header
  18988. }
  18989. // Get: Gets one content category by ID.
  18990. func (r *ContentCategoriesService) Get(profileId int64, id int64) *ContentCategoriesGetCall {
  18991. c := &ContentCategoriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  18992. c.profileId = profileId
  18993. c.id = id
  18994. return c
  18995. }
  18996. // Fields allows partial responses to be retrieved. See
  18997. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  18998. // for more information.
  18999. func (c *ContentCategoriesGetCall) Fields(s ...googleapi.Field) *ContentCategoriesGetCall {
  19000. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19001. return c
  19002. }
  19003. // IfNoneMatch sets the optional parameter which makes the operation
  19004. // fail if the object's ETag matches the given value. This is useful for
  19005. // getting updates only after the object has changed since the last
  19006. // request. Use googleapi.IsNotModified to check whether the response
  19007. // error from Do is the result of In-None-Match.
  19008. func (c *ContentCategoriesGetCall) IfNoneMatch(entityTag string) *ContentCategoriesGetCall {
  19009. c.ifNoneMatch_ = entityTag
  19010. return c
  19011. }
  19012. // Context sets the context to be used in this call's Do method. Any
  19013. // pending HTTP request will be aborted if the provided context is
  19014. // canceled.
  19015. func (c *ContentCategoriesGetCall) Context(ctx context.Context) *ContentCategoriesGetCall {
  19016. c.ctx_ = ctx
  19017. return c
  19018. }
  19019. // Header returns an http.Header that can be modified by the caller to
  19020. // add HTTP headers to the request.
  19021. func (c *ContentCategoriesGetCall) Header() http.Header {
  19022. if c.header_ == nil {
  19023. c.header_ = make(http.Header)
  19024. }
  19025. return c.header_
  19026. }
  19027. func (c *ContentCategoriesGetCall) doRequest(alt string) (*http.Response, error) {
  19028. reqHeaders := make(http.Header)
  19029. for k, v := range c.header_ {
  19030. reqHeaders[k] = v
  19031. }
  19032. reqHeaders.Set("User-Agent", c.s.userAgent())
  19033. if c.ifNoneMatch_ != "" {
  19034. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19035. }
  19036. var body io.Reader = nil
  19037. c.urlParams_.Set("alt", alt)
  19038. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories/{id}")
  19039. urls += "?" + c.urlParams_.Encode()
  19040. req, _ := http.NewRequest("GET", urls, body)
  19041. req.Header = reqHeaders
  19042. googleapi.Expand(req.URL, map[string]string{
  19043. "profileId": strconv.FormatInt(c.profileId, 10),
  19044. "id": strconv.FormatInt(c.id, 10),
  19045. })
  19046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19047. }
  19048. // Do executes the "dfareporting.contentCategories.get" call.
  19049. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  19050. // status code is an error. Response headers are in either
  19051. // *ContentCategory.ServerResponse.Header or (if a response was returned
  19052. // at all) in error.(*googleapi.Error).Header. Use
  19053. // googleapi.IsNotModified to check whether the returned error was
  19054. // because http.StatusNotModified was returned.
  19055. func (c *ContentCategoriesGetCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  19056. gensupport.SetOptions(c.urlParams_, opts...)
  19057. res, err := c.doRequest("json")
  19058. if res != nil && res.StatusCode == http.StatusNotModified {
  19059. if res.Body != nil {
  19060. res.Body.Close()
  19061. }
  19062. return nil, &googleapi.Error{
  19063. Code: res.StatusCode,
  19064. Header: res.Header,
  19065. }
  19066. }
  19067. if err != nil {
  19068. return nil, err
  19069. }
  19070. defer googleapi.CloseBody(res)
  19071. if err := googleapi.CheckResponse(res); err != nil {
  19072. return nil, err
  19073. }
  19074. ret := &ContentCategory{
  19075. ServerResponse: googleapi.ServerResponse{
  19076. Header: res.Header,
  19077. HTTPStatusCode: res.StatusCode,
  19078. },
  19079. }
  19080. target := &ret
  19081. if err := gensupport.DecodeResponse(target, res); err != nil {
  19082. return nil, err
  19083. }
  19084. return ret, nil
  19085. // {
  19086. // "description": "Gets one content category by ID.",
  19087. // "httpMethod": "GET",
  19088. // "id": "dfareporting.contentCategories.get",
  19089. // "parameterOrder": [
  19090. // "profileId",
  19091. // "id"
  19092. // ],
  19093. // "parameters": {
  19094. // "id": {
  19095. // "description": "Content category ID.",
  19096. // "format": "int64",
  19097. // "location": "path",
  19098. // "required": true,
  19099. // "type": "string"
  19100. // },
  19101. // "profileId": {
  19102. // "description": "User profile ID associated with this request.",
  19103. // "format": "int64",
  19104. // "location": "path",
  19105. // "required": true,
  19106. // "type": "string"
  19107. // }
  19108. // },
  19109. // "path": "userprofiles/{profileId}/contentCategories/{id}",
  19110. // "response": {
  19111. // "$ref": "ContentCategory"
  19112. // },
  19113. // "scopes": [
  19114. // "https://www.googleapis.com/auth/dfatrafficking"
  19115. // ]
  19116. // }
  19117. }
  19118. // method id "dfareporting.contentCategories.insert":
  19119. type ContentCategoriesInsertCall struct {
  19120. s *Service
  19121. profileId int64
  19122. contentcategory *ContentCategory
  19123. urlParams_ gensupport.URLParams
  19124. ctx_ context.Context
  19125. header_ http.Header
  19126. }
  19127. // Insert: Inserts a new content category.
  19128. func (r *ContentCategoriesService) Insert(profileId int64, contentcategory *ContentCategory) *ContentCategoriesInsertCall {
  19129. c := &ContentCategoriesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19130. c.profileId = profileId
  19131. c.contentcategory = contentcategory
  19132. return c
  19133. }
  19134. // Fields allows partial responses to be retrieved. See
  19135. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19136. // for more information.
  19137. func (c *ContentCategoriesInsertCall) Fields(s ...googleapi.Field) *ContentCategoriesInsertCall {
  19138. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19139. return c
  19140. }
  19141. // Context sets the context to be used in this call's Do method. Any
  19142. // pending HTTP request will be aborted if the provided context is
  19143. // canceled.
  19144. func (c *ContentCategoriesInsertCall) Context(ctx context.Context) *ContentCategoriesInsertCall {
  19145. c.ctx_ = ctx
  19146. return c
  19147. }
  19148. // Header returns an http.Header that can be modified by the caller to
  19149. // add HTTP headers to the request.
  19150. func (c *ContentCategoriesInsertCall) Header() http.Header {
  19151. if c.header_ == nil {
  19152. c.header_ = make(http.Header)
  19153. }
  19154. return c.header_
  19155. }
  19156. func (c *ContentCategoriesInsertCall) doRequest(alt string) (*http.Response, error) {
  19157. reqHeaders := make(http.Header)
  19158. for k, v := range c.header_ {
  19159. reqHeaders[k] = v
  19160. }
  19161. reqHeaders.Set("User-Agent", c.s.userAgent())
  19162. var body io.Reader = nil
  19163. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  19164. if err != nil {
  19165. return nil, err
  19166. }
  19167. reqHeaders.Set("Content-Type", "application/json")
  19168. c.urlParams_.Set("alt", alt)
  19169. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  19170. urls += "?" + c.urlParams_.Encode()
  19171. req, _ := http.NewRequest("POST", urls, body)
  19172. req.Header = reqHeaders
  19173. googleapi.Expand(req.URL, map[string]string{
  19174. "profileId": strconv.FormatInt(c.profileId, 10),
  19175. })
  19176. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19177. }
  19178. // Do executes the "dfareporting.contentCategories.insert" call.
  19179. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  19180. // status code is an error. Response headers are in either
  19181. // *ContentCategory.ServerResponse.Header or (if a response was returned
  19182. // at all) in error.(*googleapi.Error).Header. Use
  19183. // googleapi.IsNotModified to check whether the returned error was
  19184. // because http.StatusNotModified was returned.
  19185. func (c *ContentCategoriesInsertCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  19186. gensupport.SetOptions(c.urlParams_, opts...)
  19187. res, err := c.doRequest("json")
  19188. if res != nil && res.StatusCode == http.StatusNotModified {
  19189. if res.Body != nil {
  19190. res.Body.Close()
  19191. }
  19192. return nil, &googleapi.Error{
  19193. Code: res.StatusCode,
  19194. Header: res.Header,
  19195. }
  19196. }
  19197. if err != nil {
  19198. return nil, err
  19199. }
  19200. defer googleapi.CloseBody(res)
  19201. if err := googleapi.CheckResponse(res); err != nil {
  19202. return nil, err
  19203. }
  19204. ret := &ContentCategory{
  19205. ServerResponse: googleapi.ServerResponse{
  19206. Header: res.Header,
  19207. HTTPStatusCode: res.StatusCode,
  19208. },
  19209. }
  19210. target := &ret
  19211. if err := gensupport.DecodeResponse(target, res); err != nil {
  19212. return nil, err
  19213. }
  19214. return ret, nil
  19215. // {
  19216. // "description": "Inserts a new content category.",
  19217. // "httpMethod": "POST",
  19218. // "id": "dfareporting.contentCategories.insert",
  19219. // "parameterOrder": [
  19220. // "profileId"
  19221. // ],
  19222. // "parameters": {
  19223. // "profileId": {
  19224. // "description": "User profile ID associated with this request.",
  19225. // "format": "int64",
  19226. // "location": "path",
  19227. // "required": true,
  19228. // "type": "string"
  19229. // }
  19230. // },
  19231. // "path": "userprofiles/{profileId}/contentCategories",
  19232. // "request": {
  19233. // "$ref": "ContentCategory"
  19234. // },
  19235. // "response": {
  19236. // "$ref": "ContentCategory"
  19237. // },
  19238. // "scopes": [
  19239. // "https://www.googleapis.com/auth/dfatrafficking"
  19240. // ]
  19241. // }
  19242. }
  19243. // method id "dfareporting.contentCategories.list":
  19244. type ContentCategoriesListCall struct {
  19245. s *Service
  19246. profileId int64
  19247. urlParams_ gensupport.URLParams
  19248. ifNoneMatch_ string
  19249. ctx_ context.Context
  19250. header_ http.Header
  19251. }
  19252. // List: Retrieves a list of content categories, possibly filtered. This
  19253. // method supports paging.
  19254. func (r *ContentCategoriesService) List(profileId int64) *ContentCategoriesListCall {
  19255. c := &ContentCategoriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19256. c.profileId = profileId
  19257. return c
  19258. }
  19259. // Ids sets the optional parameter "ids": Select only content categories
  19260. // with these IDs.
  19261. func (c *ContentCategoriesListCall) Ids(ids ...int64) *ContentCategoriesListCall {
  19262. var ids_ []string
  19263. for _, v := range ids {
  19264. ids_ = append(ids_, fmt.Sprint(v))
  19265. }
  19266. c.urlParams_.SetMulti("ids", ids_)
  19267. return c
  19268. }
  19269. // MaxResults sets the optional parameter "maxResults": Maximum number
  19270. // of results to return.
  19271. func (c *ContentCategoriesListCall) MaxResults(maxResults int64) *ContentCategoriesListCall {
  19272. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  19273. return c
  19274. }
  19275. // PageToken sets the optional parameter "pageToken": Value of the
  19276. // nextPageToken from the previous result page.
  19277. func (c *ContentCategoriesListCall) PageToken(pageToken string) *ContentCategoriesListCall {
  19278. c.urlParams_.Set("pageToken", pageToken)
  19279. return c
  19280. }
  19281. // SearchString sets the optional parameter "searchString": Allows
  19282. // searching for objects by name or ID. Wildcards (*) are allowed. For
  19283. // example, "contentcategory*2015" will return objects with names like
  19284. // "contentcategory June 2015", "contentcategory April 2015", or simply
  19285. // "contentcategory 2015". Most of the searches also add wildcards
  19286. // implicitly at the start and the end of the search string. For
  19287. // example, a search string of "contentcategory" will match objects with
  19288. // name "my contentcategory", "contentcategory 2015", or simply
  19289. // "contentcategory".
  19290. func (c *ContentCategoriesListCall) SearchString(searchString string) *ContentCategoriesListCall {
  19291. c.urlParams_.Set("searchString", searchString)
  19292. return c
  19293. }
  19294. // SortField sets the optional parameter "sortField": Field by which to
  19295. // sort the list.
  19296. //
  19297. // Possible values:
  19298. // "ID" (default)
  19299. // "NAME"
  19300. func (c *ContentCategoriesListCall) SortField(sortField string) *ContentCategoriesListCall {
  19301. c.urlParams_.Set("sortField", sortField)
  19302. return c
  19303. }
  19304. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  19305. // results.
  19306. //
  19307. // Possible values:
  19308. // "ASCENDING" (default)
  19309. // "DESCENDING"
  19310. func (c *ContentCategoriesListCall) SortOrder(sortOrder string) *ContentCategoriesListCall {
  19311. c.urlParams_.Set("sortOrder", sortOrder)
  19312. return c
  19313. }
  19314. // Fields allows partial responses to be retrieved. See
  19315. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19316. // for more information.
  19317. func (c *ContentCategoriesListCall) Fields(s ...googleapi.Field) *ContentCategoriesListCall {
  19318. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19319. return c
  19320. }
  19321. // IfNoneMatch sets the optional parameter which makes the operation
  19322. // fail if the object's ETag matches the given value. This is useful for
  19323. // getting updates only after the object has changed since the last
  19324. // request. Use googleapi.IsNotModified to check whether the response
  19325. // error from Do is the result of In-None-Match.
  19326. func (c *ContentCategoriesListCall) IfNoneMatch(entityTag string) *ContentCategoriesListCall {
  19327. c.ifNoneMatch_ = entityTag
  19328. return c
  19329. }
  19330. // Context sets the context to be used in this call's Do method. Any
  19331. // pending HTTP request will be aborted if the provided context is
  19332. // canceled.
  19333. func (c *ContentCategoriesListCall) Context(ctx context.Context) *ContentCategoriesListCall {
  19334. c.ctx_ = ctx
  19335. return c
  19336. }
  19337. // Header returns an http.Header that can be modified by the caller to
  19338. // add HTTP headers to the request.
  19339. func (c *ContentCategoriesListCall) Header() http.Header {
  19340. if c.header_ == nil {
  19341. c.header_ = make(http.Header)
  19342. }
  19343. return c.header_
  19344. }
  19345. func (c *ContentCategoriesListCall) doRequest(alt string) (*http.Response, error) {
  19346. reqHeaders := make(http.Header)
  19347. for k, v := range c.header_ {
  19348. reqHeaders[k] = v
  19349. }
  19350. reqHeaders.Set("User-Agent", c.s.userAgent())
  19351. if c.ifNoneMatch_ != "" {
  19352. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19353. }
  19354. var body io.Reader = nil
  19355. c.urlParams_.Set("alt", alt)
  19356. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  19357. urls += "?" + c.urlParams_.Encode()
  19358. req, _ := http.NewRequest("GET", urls, body)
  19359. req.Header = reqHeaders
  19360. googleapi.Expand(req.URL, map[string]string{
  19361. "profileId": strconv.FormatInt(c.profileId, 10),
  19362. })
  19363. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19364. }
  19365. // Do executes the "dfareporting.contentCategories.list" call.
  19366. // Exactly one of *ContentCategoriesListResponse or error will be
  19367. // non-nil. Any non-2xx status code is an error. Response headers are in
  19368. // either *ContentCategoriesListResponse.ServerResponse.Header or (if a
  19369. // response was returned at all) in error.(*googleapi.Error).Header. Use
  19370. // googleapi.IsNotModified to check whether the returned error was
  19371. // because http.StatusNotModified was returned.
  19372. func (c *ContentCategoriesListCall) Do(opts ...googleapi.CallOption) (*ContentCategoriesListResponse, error) {
  19373. gensupport.SetOptions(c.urlParams_, opts...)
  19374. res, err := c.doRequest("json")
  19375. if res != nil && res.StatusCode == http.StatusNotModified {
  19376. if res.Body != nil {
  19377. res.Body.Close()
  19378. }
  19379. return nil, &googleapi.Error{
  19380. Code: res.StatusCode,
  19381. Header: res.Header,
  19382. }
  19383. }
  19384. if err != nil {
  19385. return nil, err
  19386. }
  19387. defer googleapi.CloseBody(res)
  19388. if err := googleapi.CheckResponse(res); err != nil {
  19389. return nil, err
  19390. }
  19391. ret := &ContentCategoriesListResponse{
  19392. ServerResponse: googleapi.ServerResponse{
  19393. Header: res.Header,
  19394. HTTPStatusCode: res.StatusCode,
  19395. },
  19396. }
  19397. target := &ret
  19398. if err := gensupport.DecodeResponse(target, res); err != nil {
  19399. return nil, err
  19400. }
  19401. return ret, nil
  19402. // {
  19403. // "description": "Retrieves a list of content categories, possibly filtered. This method supports paging.",
  19404. // "httpMethod": "GET",
  19405. // "id": "dfareporting.contentCategories.list",
  19406. // "parameterOrder": [
  19407. // "profileId"
  19408. // ],
  19409. // "parameters": {
  19410. // "ids": {
  19411. // "description": "Select only content categories with these IDs.",
  19412. // "format": "int64",
  19413. // "location": "query",
  19414. // "repeated": true,
  19415. // "type": "string"
  19416. // },
  19417. // "maxResults": {
  19418. // "default": "1000",
  19419. // "description": "Maximum number of results to return.",
  19420. // "format": "int32",
  19421. // "location": "query",
  19422. // "maximum": "1000",
  19423. // "minimum": "0",
  19424. // "type": "integer"
  19425. // },
  19426. // "pageToken": {
  19427. // "description": "Value of the nextPageToken from the previous result page.",
  19428. // "location": "query",
  19429. // "type": "string"
  19430. // },
  19431. // "profileId": {
  19432. // "description": "User profile ID associated with this request.",
  19433. // "format": "int64",
  19434. // "location": "path",
  19435. // "required": true,
  19436. // "type": "string"
  19437. // },
  19438. // "searchString": {
  19439. // "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\".",
  19440. // "location": "query",
  19441. // "type": "string"
  19442. // },
  19443. // "sortField": {
  19444. // "default": "ID",
  19445. // "description": "Field by which to sort the list.",
  19446. // "enum": [
  19447. // "ID",
  19448. // "NAME"
  19449. // ],
  19450. // "enumDescriptions": [
  19451. // "",
  19452. // ""
  19453. // ],
  19454. // "location": "query",
  19455. // "type": "string"
  19456. // },
  19457. // "sortOrder": {
  19458. // "default": "ASCENDING",
  19459. // "description": "Order of sorted results.",
  19460. // "enum": [
  19461. // "ASCENDING",
  19462. // "DESCENDING"
  19463. // ],
  19464. // "enumDescriptions": [
  19465. // "",
  19466. // ""
  19467. // ],
  19468. // "location": "query",
  19469. // "type": "string"
  19470. // }
  19471. // },
  19472. // "path": "userprofiles/{profileId}/contentCategories",
  19473. // "response": {
  19474. // "$ref": "ContentCategoriesListResponse"
  19475. // },
  19476. // "scopes": [
  19477. // "https://www.googleapis.com/auth/dfatrafficking"
  19478. // ]
  19479. // }
  19480. }
  19481. // Pages invokes f for each page of results.
  19482. // A non-nil error returned from f will halt the iteration.
  19483. // The provided context supersedes any context provided to the Context method.
  19484. func (c *ContentCategoriesListCall) Pages(ctx context.Context, f func(*ContentCategoriesListResponse) error) error {
  19485. c.ctx_ = ctx
  19486. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  19487. for {
  19488. x, err := c.Do()
  19489. if err != nil {
  19490. return err
  19491. }
  19492. if err := f(x); err != nil {
  19493. return err
  19494. }
  19495. if x.NextPageToken == "" {
  19496. return nil
  19497. }
  19498. c.PageToken(x.NextPageToken)
  19499. }
  19500. }
  19501. // method id "dfareporting.contentCategories.patch":
  19502. type ContentCategoriesPatchCall struct {
  19503. s *Service
  19504. profileId int64
  19505. contentcategory *ContentCategory
  19506. urlParams_ gensupport.URLParams
  19507. ctx_ context.Context
  19508. header_ http.Header
  19509. }
  19510. // Patch: Updates an existing content category. This method supports
  19511. // patch semantics.
  19512. func (r *ContentCategoriesService) Patch(profileId int64, id int64, contentcategory *ContentCategory) *ContentCategoriesPatchCall {
  19513. c := &ContentCategoriesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19514. c.profileId = profileId
  19515. c.urlParams_.Set("id", fmt.Sprint(id))
  19516. c.contentcategory = contentcategory
  19517. return c
  19518. }
  19519. // Fields allows partial responses to be retrieved. See
  19520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19521. // for more information.
  19522. func (c *ContentCategoriesPatchCall) Fields(s ...googleapi.Field) *ContentCategoriesPatchCall {
  19523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19524. return c
  19525. }
  19526. // Context sets the context to be used in this call's Do method. Any
  19527. // pending HTTP request will be aborted if the provided context is
  19528. // canceled.
  19529. func (c *ContentCategoriesPatchCall) Context(ctx context.Context) *ContentCategoriesPatchCall {
  19530. c.ctx_ = ctx
  19531. return c
  19532. }
  19533. // Header returns an http.Header that can be modified by the caller to
  19534. // add HTTP headers to the request.
  19535. func (c *ContentCategoriesPatchCall) Header() http.Header {
  19536. if c.header_ == nil {
  19537. c.header_ = make(http.Header)
  19538. }
  19539. return c.header_
  19540. }
  19541. func (c *ContentCategoriesPatchCall) doRequest(alt string) (*http.Response, error) {
  19542. reqHeaders := make(http.Header)
  19543. for k, v := range c.header_ {
  19544. reqHeaders[k] = v
  19545. }
  19546. reqHeaders.Set("User-Agent", c.s.userAgent())
  19547. var body io.Reader = nil
  19548. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  19549. if err != nil {
  19550. return nil, err
  19551. }
  19552. reqHeaders.Set("Content-Type", "application/json")
  19553. c.urlParams_.Set("alt", alt)
  19554. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  19555. urls += "?" + c.urlParams_.Encode()
  19556. req, _ := http.NewRequest("PATCH", urls, body)
  19557. req.Header = reqHeaders
  19558. googleapi.Expand(req.URL, map[string]string{
  19559. "profileId": strconv.FormatInt(c.profileId, 10),
  19560. })
  19561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19562. }
  19563. // Do executes the "dfareporting.contentCategories.patch" call.
  19564. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  19565. // status code is an error. Response headers are in either
  19566. // *ContentCategory.ServerResponse.Header or (if a response was returned
  19567. // at all) in error.(*googleapi.Error).Header. Use
  19568. // googleapi.IsNotModified to check whether the returned error was
  19569. // because http.StatusNotModified was returned.
  19570. func (c *ContentCategoriesPatchCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  19571. gensupport.SetOptions(c.urlParams_, opts...)
  19572. res, err := c.doRequest("json")
  19573. if res != nil && res.StatusCode == http.StatusNotModified {
  19574. if res.Body != nil {
  19575. res.Body.Close()
  19576. }
  19577. return nil, &googleapi.Error{
  19578. Code: res.StatusCode,
  19579. Header: res.Header,
  19580. }
  19581. }
  19582. if err != nil {
  19583. return nil, err
  19584. }
  19585. defer googleapi.CloseBody(res)
  19586. if err := googleapi.CheckResponse(res); err != nil {
  19587. return nil, err
  19588. }
  19589. ret := &ContentCategory{
  19590. ServerResponse: googleapi.ServerResponse{
  19591. Header: res.Header,
  19592. HTTPStatusCode: res.StatusCode,
  19593. },
  19594. }
  19595. target := &ret
  19596. if err := gensupport.DecodeResponse(target, res); err != nil {
  19597. return nil, err
  19598. }
  19599. return ret, nil
  19600. // {
  19601. // "description": "Updates an existing content category. This method supports patch semantics.",
  19602. // "httpMethod": "PATCH",
  19603. // "id": "dfareporting.contentCategories.patch",
  19604. // "parameterOrder": [
  19605. // "profileId",
  19606. // "id"
  19607. // ],
  19608. // "parameters": {
  19609. // "id": {
  19610. // "description": "Content category ID.",
  19611. // "format": "int64",
  19612. // "location": "query",
  19613. // "required": true,
  19614. // "type": "string"
  19615. // },
  19616. // "profileId": {
  19617. // "description": "User profile ID associated with this request.",
  19618. // "format": "int64",
  19619. // "location": "path",
  19620. // "required": true,
  19621. // "type": "string"
  19622. // }
  19623. // },
  19624. // "path": "userprofiles/{profileId}/contentCategories",
  19625. // "request": {
  19626. // "$ref": "ContentCategory"
  19627. // },
  19628. // "response": {
  19629. // "$ref": "ContentCategory"
  19630. // },
  19631. // "scopes": [
  19632. // "https://www.googleapis.com/auth/dfatrafficking"
  19633. // ]
  19634. // }
  19635. }
  19636. // method id "dfareporting.contentCategories.update":
  19637. type ContentCategoriesUpdateCall struct {
  19638. s *Service
  19639. profileId int64
  19640. contentcategory *ContentCategory
  19641. urlParams_ gensupport.URLParams
  19642. ctx_ context.Context
  19643. header_ http.Header
  19644. }
  19645. // Update: Updates an existing content category.
  19646. func (r *ContentCategoriesService) Update(profileId int64, contentcategory *ContentCategory) *ContentCategoriesUpdateCall {
  19647. c := &ContentCategoriesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19648. c.profileId = profileId
  19649. c.contentcategory = contentcategory
  19650. return c
  19651. }
  19652. // Fields allows partial responses to be retrieved. See
  19653. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19654. // for more information.
  19655. func (c *ContentCategoriesUpdateCall) Fields(s ...googleapi.Field) *ContentCategoriesUpdateCall {
  19656. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19657. return c
  19658. }
  19659. // Context sets the context to be used in this call's Do method. Any
  19660. // pending HTTP request will be aborted if the provided context is
  19661. // canceled.
  19662. func (c *ContentCategoriesUpdateCall) Context(ctx context.Context) *ContentCategoriesUpdateCall {
  19663. c.ctx_ = ctx
  19664. return c
  19665. }
  19666. // Header returns an http.Header that can be modified by the caller to
  19667. // add HTTP headers to the request.
  19668. func (c *ContentCategoriesUpdateCall) Header() http.Header {
  19669. if c.header_ == nil {
  19670. c.header_ = make(http.Header)
  19671. }
  19672. return c.header_
  19673. }
  19674. func (c *ContentCategoriesUpdateCall) doRequest(alt string) (*http.Response, error) {
  19675. reqHeaders := make(http.Header)
  19676. for k, v := range c.header_ {
  19677. reqHeaders[k] = v
  19678. }
  19679. reqHeaders.Set("User-Agent", c.s.userAgent())
  19680. var body io.Reader = nil
  19681. body, err := googleapi.WithoutDataWrapper.JSONReader(c.contentcategory)
  19682. if err != nil {
  19683. return nil, err
  19684. }
  19685. reqHeaders.Set("Content-Type", "application/json")
  19686. c.urlParams_.Set("alt", alt)
  19687. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/contentCategories")
  19688. urls += "?" + c.urlParams_.Encode()
  19689. req, _ := http.NewRequest("PUT", urls, body)
  19690. req.Header = reqHeaders
  19691. googleapi.Expand(req.URL, map[string]string{
  19692. "profileId": strconv.FormatInt(c.profileId, 10),
  19693. })
  19694. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19695. }
  19696. // Do executes the "dfareporting.contentCategories.update" call.
  19697. // Exactly one of *ContentCategory or error will be non-nil. Any non-2xx
  19698. // status code is an error. Response headers are in either
  19699. // *ContentCategory.ServerResponse.Header or (if a response was returned
  19700. // at all) in error.(*googleapi.Error).Header. Use
  19701. // googleapi.IsNotModified to check whether the returned error was
  19702. // because http.StatusNotModified was returned.
  19703. func (c *ContentCategoriesUpdateCall) Do(opts ...googleapi.CallOption) (*ContentCategory, error) {
  19704. gensupport.SetOptions(c.urlParams_, opts...)
  19705. res, err := c.doRequest("json")
  19706. if res != nil && res.StatusCode == http.StatusNotModified {
  19707. if res.Body != nil {
  19708. res.Body.Close()
  19709. }
  19710. return nil, &googleapi.Error{
  19711. Code: res.StatusCode,
  19712. Header: res.Header,
  19713. }
  19714. }
  19715. if err != nil {
  19716. return nil, err
  19717. }
  19718. defer googleapi.CloseBody(res)
  19719. if err := googleapi.CheckResponse(res); err != nil {
  19720. return nil, err
  19721. }
  19722. ret := &ContentCategory{
  19723. ServerResponse: googleapi.ServerResponse{
  19724. Header: res.Header,
  19725. HTTPStatusCode: res.StatusCode,
  19726. },
  19727. }
  19728. target := &ret
  19729. if err := gensupport.DecodeResponse(target, res); err != nil {
  19730. return nil, err
  19731. }
  19732. return ret, nil
  19733. // {
  19734. // "description": "Updates an existing content category.",
  19735. // "httpMethod": "PUT",
  19736. // "id": "dfareporting.contentCategories.update",
  19737. // "parameterOrder": [
  19738. // "profileId"
  19739. // ],
  19740. // "parameters": {
  19741. // "profileId": {
  19742. // "description": "User profile ID associated with this request.",
  19743. // "format": "int64",
  19744. // "location": "path",
  19745. // "required": true,
  19746. // "type": "string"
  19747. // }
  19748. // },
  19749. // "path": "userprofiles/{profileId}/contentCategories",
  19750. // "request": {
  19751. // "$ref": "ContentCategory"
  19752. // },
  19753. // "response": {
  19754. // "$ref": "ContentCategory"
  19755. // },
  19756. // "scopes": [
  19757. // "https://www.googleapis.com/auth/dfatrafficking"
  19758. // ]
  19759. // }
  19760. }
  19761. // method id "dfareporting.conversions.batchinsert":
  19762. type ConversionsBatchinsertCall struct {
  19763. s *Service
  19764. profileId int64
  19765. conversionsbatchinsertrequest *ConversionsBatchInsertRequest
  19766. urlParams_ gensupport.URLParams
  19767. ctx_ context.Context
  19768. header_ http.Header
  19769. }
  19770. // Batchinsert: Inserts conversions.
  19771. func (r *ConversionsService) Batchinsert(profileId int64, conversionsbatchinsertrequest *ConversionsBatchInsertRequest) *ConversionsBatchinsertCall {
  19772. c := &ConversionsBatchinsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19773. c.profileId = profileId
  19774. c.conversionsbatchinsertrequest = conversionsbatchinsertrequest
  19775. return c
  19776. }
  19777. // Fields allows partial responses to be retrieved. See
  19778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19779. // for more information.
  19780. func (c *ConversionsBatchinsertCall) Fields(s ...googleapi.Field) *ConversionsBatchinsertCall {
  19781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19782. return c
  19783. }
  19784. // Context sets the context to be used in this call's Do method. Any
  19785. // pending HTTP request will be aborted if the provided context is
  19786. // canceled.
  19787. func (c *ConversionsBatchinsertCall) Context(ctx context.Context) *ConversionsBatchinsertCall {
  19788. c.ctx_ = ctx
  19789. return c
  19790. }
  19791. // Header returns an http.Header that can be modified by the caller to
  19792. // add HTTP headers to the request.
  19793. func (c *ConversionsBatchinsertCall) Header() http.Header {
  19794. if c.header_ == nil {
  19795. c.header_ = make(http.Header)
  19796. }
  19797. return c.header_
  19798. }
  19799. func (c *ConversionsBatchinsertCall) doRequest(alt string) (*http.Response, error) {
  19800. reqHeaders := make(http.Header)
  19801. for k, v := range c.header_ {
  19802. reqHeaders[k] = v
  19803. }
  19804. reqHeaders.Set("User-Agent", c.s.userAgent())
  19805. var body io.Reader = nil
  19806. body, err := googleapi.WithoutDataWrapper.JSONReader(c.conversionsbatchinsertrequest)
  19807. if err != nil {
  19808. return nil, err
  19809. }
  19810. reqHeaders.Set("Content-Type", "application/json")
  19811. c.urlParams_.Set("alt", alt)
  19812. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/conversions/batchinsert")
  19813. urls += "?" + c.urlParams_.Encode()
  19814. req, _ := http.NewRequest("POST", urls, body)
  19815. req.Header = reqHeaders
  19816. googleapi.Expand(req.URL, map[string]string{
  19817. "profileId": strconv.FormatInt(c.profileId, 10),
  19818. })
  19819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19820. }
  19821. // Do executes the "dfareporting.conversions.batchinsert" call.
  19822. // Exactly one of *ConversionsBatchInsertResponse or error will be
  19823. // non-nil. Any non-2xx status code is an error. Response headers are in
  19824. // either *ConversionsBatchInsertResponse.ServerResponse.Header or (if a
  19825. // response was returned at all) in error.(*googleapi.Error).Header. Use
  19826. // googleapi.IsNotModified to check whether the returned error was
  19827. // because http.StatusNotModified was returned.
  19828. func (c *ConversionsBatchinsertCall) Do(opts ...googleapi.CallOption) (*ConversionsBatchInsertResponse, error) {
  19829. gensupport.SetOptions(c.urlParams_, opts...)
  19830. res, err := c.doRequest("json")
  19831. if res != nil && res.StatusCode == http.StatusNotModified {
  19832. if res.Body != nil {
  19833. res.Body.Close()
  19834. }
  19835. return nil, &googleapi.Error{
  19836. Code: res.StatusCode,
  19837. Header: res.Header,
  19838. }
  19839. }
  19840. if err != nil {
  19841. return nil, err
  19842. }
  19843. defer googleapi.CloseBody(res)
  19844. if err := googleapi.CheckResponse(res); err != nil {
  19845. return nil, err
  19846. }
  19847. ret := &ConversionsBatchInsertResponse{
  19848. ServerResponse: googleapi.ServerResponse{
  19849. Header: res.Header,
  19850. HTTPStatusCode: res.StatusCode,
  19851. },
  19852. }
  19853. target := &ret
  19854. if err := gensupport.DecodeResponse(target, res); err != nil {
  19855. return nil, err
  19856. }
  19857. return ret, nil
  19858. // {
  19859. // "description": "Inserts conversions.",
  19860. // "httpMethod": "POST",
  19861. // "id": "dfareporting.conversions.batchinsert",
  19862. // "parameterOrder": [
  19863. // "profileId"
  19864. // ],
  19865. // "parameters": {
  19866. // "profileId": {
  19867. // "description": "User profile ID associated with this request.",
  19868. // "format": "int64",
  19869. // "location": "path",
  19870. // "required": true,
  19871. // "type": "string"
  19872. // }
  19873. // },
  19874. // "path": "userprofiles/{profileId}/conversions/batchinsert",
  19875. // "request": {
  19876. // "$ref": "ConversionsBatchInsertRequest"
  19877. // },
  19878. // "response": {
  19879. // "$ref": "ConversionsBatchInsertResponse"
  19880. // },
  19881. // "scopes": [
  19882. // "https://www.googleapis.com/auth/ddmconversions"
  19883. // ]
  19884. // }
  19885. }
  19886. // method id "dfareporting.countries.get":
  19887. type CountriesGetCall struct {
  19888. s *Service
  19889. profileId int64
  19890. dartId int64
  19891. urlParams_ gensupport.URLParams
  19892. ifNoneMatch_ string
  19893. ctx_ context.Context
  19894. header_ http.Header
  19895. }
  19896. // Get: Gets one country by ID.
  19897. func (r *CountriesService) Get(profileId int64, dartId int64) *CountriesGetCall {
  19898. c := &CountriesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  19899. c.profileId = profileId
  19900. c.dartId = dartId
  19901. return c
  19902. }
  19903. // Fields allows partial responses to be retrieved. See
  19904. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  19905. // for more information.
  19906. func (c *CountriesGetCall) Fields(s ...googleapi.Field) *CountriesGetCall {
  19907. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  19908. return c
  19909. }
  19910. // IfNoneMatch sets the optional parameter which makes the operation
  19911. // fail if the object's ETag matches the given value. This is useful for
  19912. // getting updates only after the object has changed since the last
  19913. // request. Use googleapi.IsNotModified to check whether the response
  19914. // error from Do is the result of In-None-Match.
  19915. func (c *CountriesGetCall) IfNoneMatch(entityTag string) *CountriesGetCall {
  19916. c.ifNoneMatch_ = entityTag
  19917. return c
  19918. }
  19919. // Context sets the context to be used in this call's Do method. Any
  19920. // pending HTTP request will be aborted if the provided context is
  19921. // canceled.
  19922. func (c *CountriesGetCall) Context(ctx context.Context) *CountriesGetCall {
  19923. c.ctx_ = ctx
  19924. return c
  19925. }
  19926. // Header returns an http.Header that can be modified by the caller to
  19927. // add HTTP headers to the request.
  19928. func (c *CountriesGetCall) Header() http.Header {
  19929. if c.header_ == nil {
  19930. c.header_ = make(http.Header)
  19931. }
  19932. return c.header_
  19933. }
  19934. func (c *CountriesGetCall) doRequest(alt string) (*http.Response, error) {
  19935. reqHeaders := make(http.Header)
  19936. for k, v := range c.header_ {
  19937. reqHeaders[k] = v
  19938. }
  19939. reqHeaders.Set("User-Agent", c.s.userAgent())
  19940. if c.ifNoneMatch_ != "" {
  19941. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  19942. }
  19943. var body io.Reader = nil
  19944. c.urlParams_.Set("alt", alt)
  19945. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries/{dartId}")
  19946. urls += "?" + c.urlParams_.Encode()
  19947. req, _ := http.NewRequest("GET", urls, body)
  19948. req.Header = reqHeaders
  19949. googleapi.Expand(req.URL, map[string]string{
  19950. "profileId": strconv.FormatInt(c.profileId, 10),
  19951. "dartId": strconv.FormatInt(c.dartId, 10),
  19952. })
  19953. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  19954. }
  19955. // Do executes the "dfareporting.countries.get" call.
  19956. // Exactly one of *Country or error will be non-nil. Any non-2xx status
  19957. // code is an error. Response headers are in either
  19958. // *Country.ServerResponse.Header or (if a response was returned at all)
  19959. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  19960. // check whether the returned error was because http.StatusNotModified
  19961. // was returned.
  19962. func (c *CountriesGetCall) Do(opts ...googleapi.CallOption) (*Country, error) {
  19963. gensupport.SetOptions(c.urlParams_, opts...)
  19964. res, err := c.doRequest("json")
  19965. if res != nil && res.StatusCode == http.StatusNotModified {
  19966. if res.Body != nil {
  19967. res.Body.Close()
  19968. }
  19969. return nil, &googleapi.Error{
  19970. Code: res.StatusCode,
  19971. Header: res.Header,
  19972. }
  19973. }
  19974. if err != nil {
  19975. return nil, err
  19976. }
  19977. defer googleapi.CloseBody(res)
  19978. if err := googleapi.CheckResponse(res); err != nil {
  19979. return nil, err
  19980. }
  19981. ret := &Country{
  19982. ServerResponse: googleapi.ServerResponse{
  19983. Header: res.Header,
  19984. HTTPStatusCode: res.StatusCode,
  19985. },
  19986. }
  19987. target := &ret
  19988. if err := gensupport.DecodeResponse(target, res); err != nil {
  19989. return nil, err
  19990. }
  19991. return ret, nil
  19992. // {
  19993. // "description": "Gets one country by ID.",
  19994. // "httpMethod": "GET",
  19995. // "id": "dfareporting.countries.get",
  19996. // "parameterOrder": [
  19997. // "profileId",
  19998. // "dartId"
  19999. // ],
  20000. // "parameters": {
  20001. // "dartId": {
  20002. // "description": "Country DART ID.",
  20003. // "format": "int64",
  20004. // "location": "path",
  20005. // "required": true,
  20006. // "type": "string"
  20007. // },
  20008. // "profileId": {
  20009. // "description": "User profile ID associated with this request.",
  20010. // "format": "int64",
  20011. // "location": "path",
  20012. // "required": true,
  20013. // "type": "string"
  20014. // }
  20015. // },
  20016. // "path": "userprofiles/{profileId}/countries/{dartId}",
  20017. // "response": {
  20018. // "$ref": "Country"
  20019. // },
  20020. // "scopes": [
  20021. // "https://www.googleapis.com/auth/dfatrafficking"
  20022. // ]
  20023. // }
  20024. }
  20025. // method id "dfareporting.countries.list":
  20026. type CountriesListCall struct {
  20027. s *Service
  20028. profileId int64
  20029. urlParams_ gensupport.URLParams
  20030. ifNoneMatch_ string
  20031. ctx_ context.Context
  20032. header_ http.Header
  20033. }
  20034. // List: Retrieves a list of countries.
  20035. func (r *CountriesService) List(profileId int64) *CountriesListCall {
  20036. c := &CountriesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20037. c.profileId = profileId
  20038. return c
  20039. }
  20040. // Fields allows partial responses to be retrieved. See
  20041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20042. // for more information.
  20043. func (c *CountriesListCall) Fields(s ...googleapi.Field) *CountriesListCall {
  20044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20045. return c
  20046. }
  20047. // IfNoneMatch sets the optional parameter which makes the operation
  20048. // fail if the object's ETag matches the given value. This is useful for
  20049. // getting updates only after the object has changed since the last
  20050. // request. Use googleapi.IsNotModified to check whether the response
  20051. // error from Do is the result of In-None-Match.
  20052. func (c *CountriesListCall) IfNoneMatch(entityTag string) *CountriesListCall {
  20053. c.ifNoneMatch_ = entityTag
  20054. return c
  20055. }
  20056. // Context sets the context to be used in this call's Do method. Any
  20057. // pending HTTP request will be aborted if the provided context is
  20058. // canceled.
  20059. func (c *CountriesListCall) Context(ctx context.Context) *CountriesListCall {
  20060. c.ctx_ = ctx
  20061. return c
  20062. }
  20063. // Header returns an http.Header that can be modified by the caller to
  20064. // add HTTP headers to the request.
  20065. func (c *CountriesListCall) Header() http.Header {
  20066. if c.header_ == nil {
  20067. c.header_ = make(http.Header)
  20068. }
  20069. return c.header_
  20070. }
  20071. func (c *CountriesListCall) doRequest(alt string) (*http.Response, error) {
  20072. reqHeaders := make(http.Header)
  20073. for k, v := range c.header_ {
  20074. reqHeaders[k] = v
  20075. }
  20076. reqHeaders.Set("User-Agent", c.s.userAgent())
  20077. if c.ifNoneMatch_ != "" {
  20078. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20079. }
  20080. var body io.Reader = nil
  20081. c.urlParams_.Set("alt", alt)
  20082. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/countries")
  20083. urls += "?" + c.urlParams_.Encode()
  20084. req, _ := http.NewRequest("GET", urls, body)
  20085. req.Header = reqHeaders
  20086. googleapi.Expand(req.URL, map[string]string{
  20087. "profileId": strconv.FormatInt(c.profileId, 10),
  20088. })
  20089. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20090. }
  20091. // Do executes the "dfareporting.countries.list" call.
  20092. // Exactly one of *CountriesListResponse or error will be non-nil. Any
  20093. // non-2xx status code is an error. Response headers are in either
  20094. // *CountriesListResponse.ServerResponse.Header or (if a response was
  20095. // returned at all) in error.(*googleapi.Error).Header. Use
  20096. // googleapi.IsNotModified to check whether the returned error was
  20097. // because http.StatusNotModified was returned.
  20098. func (c *CountriesListCall) Do(opts ...googleapi.CallOption) (*CountriesListResponse, error) {
  20099. gensupport.SetOptions(c.urlParams_, opts...)
  20100. res, err := c.doRequest("json")
  20101. if res != nil && res.StatusCode == http.StatusNotModified {
  20102. if res.Body != nil {
  20103. res.Body.Close()
  20104. }
  20105. return nil, &googleapi.Error{
  20106. Code: res.StatusCode,
  20107. Header: res.Header,
  20108. }
  20109. }
  20110. if err != nil {
  20111. return nil, err
  20112. }
  20113. defer googleapi.CloseBody(res)
  20114. if err := googleapi.CheckResponse(res); err != nil {
  20115. return nil, err
  20116. }
  20117. ret := &CountriesListResponse{
  20118. ServerResponse: googleapi.ServerResponse{
  20119. Header: res.Header,
  20120. HTTPStatusCode: res.StatusCode,
  20121. },
  20122. }
  20123. target := &ret
  20124. if err := gensupport.DecodeResponse(target, res); err != nil {
  20125. return nil, err
  20126. }
  20127. return ret, nil
  20128. // {
  20129. // "description": "Retrieves a list of countries.",
  20130. // "httpMethod": "GET",
  20131. // "id": "dfareporting.countries.list",
  20132. // "parameterOrder": [
  20133. // "profileId"
  20134. // ],
  20135. // "parameters": {
  20136. // "profileId": {
  20137. // "description": "User profile ID associated with this request.",
  20138. // "format": "int64",
  20139. // "location": "path",
  20140. // "required": true,
  20141. // "type": "string"
  20142. // }
  20143. // },
  20144. // "path": "userprofiles/{profileId}/countries",
  20145. // "response": {
  20146. // "$ref": "CountriesListResponse"
  20147. // },
  20148. // "scopes": [
  20149. // "https://www.googleapis.com/auth/dfatrafficking"
  20150. // ]
  20151. // }
  20152. }
  20153. // method id "dfareporting.creativeAssets.insert":
  20154. type CreativeAssetsInsertCall struct {
  20155. s *Service
  20156. profileId int64
  20157. advertiserId int64
  20158. creativeassetmetadata *CreativeAssetMetadata
  20159. urlParams_ gensupport.URLParams
  20160. mediaInfo_ *gensupport.MediaInfo
  20161. ctx_ context.Context
  20162. header_ http.Header
  20163. }
  20164. // Insert: Inserts a new creative asset.
  20165. func (r *CreativeAssetsService) Insert(profileId int64, advertiserId int64, creativeassetmetadata *CreativeAssetMetadata) *CreativeAssetsInsertCall {
  20166. c := &CreativeAssetsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20167. c.profileId = profileId
  20168. c.advertiserId = advertiserId
  20169. c.creativeassetmetadata = creativeassetmetadata
  20170. return c
  20171. }
  20172. // Media specifies the media to upload in one or more chunks. The chunk
  20173. // size may be controlled by supplying a MediaOption generated by
  20174. // googleapi.ChunkSize. The chunk size defaults to
  20175. // googleapi.DefaultUploadChunkSize.The Content-Type header used in the
  20176. // upload request will be determined by sniffing the contents of r,
  20177. // unless a MediaOption generated by googleapi.ContentType is
  20178. // supplied.
  20179. // At most one of Media and ResumableMedia may be set.
  20180. func (c *CreativeAssetsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *CreativeAssetsInsertCall {
  20181. c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  20182. return c
  20183. }
  20184. // ResumableMedia specifies the media to upload in chunks and can be
  20185. // canceled with ctx.
  20186. //
  20187. // Deprecated: use Media instead.
  20188. //
  20189. // At most one of Media and ResumableMedia may be set. mediaType
  20190. // identifies the MIME media type of the upload, such as "image/png". If
  20191. // mediaType is "", it will be auto-detected. The provided ctx will
  20192. // supersede any context previously provided to the Context method.
  20193. func (c *CreativeAssetsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *CreativeAssetsInsertCall {
  20194. c.ctx_ = ctx
  20195. c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  20196. return c
  20197. }
  20198. // ProgressUpdater provides a callback function that will be called
  20199. // after every chunk. It should be a low-latency function in order to
  20200. // not slow down the upload operation. This should only be called when
  20201. // using ResumableMedia (as opposed to Media).
  20202. func (c *CreativeAssetsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *CreativeAssetsInsertCall {
  20203. c.mediaInfo_.SetProgressUpdater(pu)
  20204. return c
  20205. }
  20206. // Fields allows partial responses to be retrieved. See
  20207. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20208. // for more information.
  20209. func (c *CreativeAssetsInsertCall) Fields(s ...googleapi.Field) *CreativeAssetsInsertCall {
  20210. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20211. return c
  20212. }
  20213. // Context sets the context to be used in this call's Do method. Any
  20214. // pending HTTP request will be aborted if the provided context is
  20215. // canceled.
  20216. // This context will supersede any context previously provided to the
  20217. // ResumableMedia method.
  20218. func (c *CreativeAssetsInsertCall) Context(ctx context.Context) *CreativeAssetsInsertCall {
  20219. c.ctx_ = ctx
  20220. return c
  20221. }
  20222. // Header returns an http.Header that can be modified by the caller to
  20223. // add HTTP headers to the request.
  20224. func (c *CreativeAssetsInsertCall) Header() http.Header {
  20225. if c.header_ == nil {
  20226. c.header_ = make(http.Header)
  20227. }
  20228. return c.header_
  20229. }
  20230. func (c *CreativeAssetsInsertCall) doRequest(alt string) (*http.Response, error) {
  20231. reqHeaders := make(http.Header)
  20232. for k, v := range c.header_ {
  20233. reqHeaders[k] = v
  20234. }
  20235. reqHeaders.Set("User-Agent", c.s.userAgent())
  20236. var body io.Reader = nil
  20237. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativeassetmetadata)
  20238. if err != nil {
  20239. return nil, err
  20240. }
  20241. reqHeaders.Set("Content-Type", "application/json")
  20242. c.urlParams_.Set("alt", alt)
  20243. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets")
  20244. if c.mediaInfo_ != nil {
  20245. urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
  20246. c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  20247. }
  20248. if body == nil {
  20249. body = new(bytes.Buffer)
  20250. reqHeaders.Set("Content-Type", "application/json")
  20251. }
  20252. body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  20253. defer cleanup()
  20254. urls += "?" + c.urlParams_.Encode()
  20255. req, _ := http.NewRequest("POST", urls, body)
  20256. req.Header = reqHeaders
  20257. gensupport.SetGetBody(req, getBody)
  20258. googleapi.Expand(req.URL, map[string]string{
  20259. "profileId": strconv.FormatInt(c.profileId, 10),
  20260. "advertiserId": strconv.FormatInt(c.advertiserId, 10),
  20261. })
  20262. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20263. }
  20264. // Do executes the "dfareporting.creativeAssets.insert" call.
  20265. // Exactly one of *CreativeAssetMetadata or error will be non-nil. Any
  20266. // non-2xx status code is an error. Response headers are in either
  20267. // *CreativeAssetMetadata.ServerResponse.Header or (if a response was
  20268. // returned at all) in error.(*googleapi.Error).Header. Use
  20269. // googleapi.IsNotModified to check whether the returned error was
  20270. // because http.StatusNotModified was returned.
  20271. func (c *CreativeAssetsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeAssetMetadata, error) {
  20272. gensupport.SetOptions(c.urlParams_, opts...)
  20273. res, err := c.doRequest("json")
  20274. if res != nil && res.StatusCode == http.StatusNotModified {
  20275. if res.Body != nil {
  20276. res.Body.Close()
  20277. }
  20278. return nil, &googleapi.Error{
  20279. Code: res.StatusCode,
  20280. Header: res.Header,
  20281. }
  20282. }
  20283. if err != nil {
  20284. return nil, err
  20285. }
  20286. defer googleapi.CloseBody(res)
  20287. if err := googleapi.CheckResponse(res); err != nil {
  20288. return nil, err
  20289. }
  20290. rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  20291. if rx != nil {
  20292. rx.Client = c.s.client
  20293. rx.UserAgent = c.s.userAgent()
  20294. ctx := c.ctx_
  20295. if ctx == nil {
  20296. ctx = context.TODO()
  20297. }
  20298. res, err = rx.Upload(ctx)
  20299. if err != nil {
  20300. return nil, err
  20301. }
  20302. defer res.Body.Close()
  20303. if err := googleapi.CheckResponse(res); err != nil {
  20304. return nil, err
  20305. }
  20306. }
  20307. ret := &CreativeAssetMetadata{
  20308. ServerResponse: googleapi.ServerResponse{
  20309. Header: res.Header,
  20310. HTTPStatusCode: res.StatusCode,
  20311. },
  20312. }
  20313. target := &ret
  20314. if err := gensupport.DecodeResponse(target, res); err != nil {
  20315. return nil, err
  20316. }
  20317. return ret, nil
  20318. // {
  20319. // "description": "Inserts a new creative asset.",
  20320. // "httpMethod": "POST",
  20321. // "id": "dfareporting.creativeAssets.insert",
  20322. // "mediaUpload": {
  20323. // "accept": [
  20324. // "*/*"
  20325. // ],
  20326. // "maxSize": "1024MB",
  20327. // "protocols": {
  20328. // "resumable": {
  20329. // "multipart": true,
  20330. // "path": "/resumable/upload/dfareporting/v2.7/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  20331. // },
  20332. // "simple": {
  20333. // "multipart": true,
  20334. // "path": "/upload/dfareporting/v2.7/userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets"
  20335. // }
  20336. // }
  20337. // },
  20338. // "parameterOrder": [
  20339. // "profileId",
  20340. // "advertiserId"
  20341. // ],
  20342. // "parameters": {
  20343. // "advertiserId": {
  20344. // "description": "Advertiser ID of this creative. This is a required field.",
  20345. // "format": "int64",
  20346. // "location": "path",
  20347. // "required": true,
  20348. // "type": "string"
  20349. // },
  20350. // "profileId": {
  20351. // "description": "User profile ID associated with this request.",
  20352. // "format": "int64",
  20353. // "location": "path",
  20354. // "required": true,
  20355. // "type": "string"
  20356. // }
  20357. // },
  20358. // "path": "userprofiles/{profileId}/creativeAssets/{advertiserId}/creativeAssets",
  20359. // "request": {
  20360. // "$ref": "CreativeAssetMetadata"
  20361. // },
  20362. // "response": {
  20363. // "$ref": "CreativeAssetMetadata"
  20364. // },
  20365. // "scopes": [
  20366. // "https://www.googleapis.com/auth/dfatrafficking"
  20367. // ],
  20368. // "supportsMediaUpload": true
  20369. // }
  20370. }
  20371. // method id "dfareporting.creativeFieldValues.delete":
  20372. type CreativeFieldValuesDeleteCall struct {
  20373. s *Service
  20374. profileId int64
  20375. creativeFieldId int64
  20376. id int64
  20377. urlParams_ gensupport.URLParams
  20378. ctx_ context.Context
  20379. header_ http.Header
  20380. }
  20381. // Delete: Deletes an existing creative field value.
  20382. func (r *CreativeFieldValuesService) Delete(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesDeleteCall {
  20383. c := &CreativeFieldValuesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20384. c.profileId = profileId
  20385. c.creativeFieldId = creativeFieldId
  20386. c.id = id
  20387. return c
  20388. }
  20389. // Fields allows partial responses to be retrieved. See
  20390. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20391. // for more information.
  20392. func (c *CreativeFieldValuesDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldValuesDeleteCall {
  20393. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20394. return c
  20395. }
  20396. // Context sets the context to be used in this call's Do method. Any
  20397. // pending HTTP request will be aborted if the provided context is
  20398. // canceled.
  20399. func (c *CreativeFieldValuesDeleteCall) Context(ctx context.Context) *CreativeFieldValuesDeleteCall {
  20400. c.ctx_ = ctx
  20401. return c
  20402. }
  20403. // Header returns an http.Header that can be modified by the caller to
  20404. // add HTTP headers to the request.
  20405. func (c *CreativeFieldValuesDeleteCall) Header() http.Header {
  20406. if c.header_ == nil {
  20407. c.header_ = make(http.Header)
  20408. }
  20409. return c.header_
  20410. }
  20411. func (c *CreativeFieldValuesDeleteCall) doRequest(alt string) (*http.Response, error) {
  20412. reqHeaders := make(http.Header)
  20413. for k, v := range c.header_ {
  20414. reqHeaders[k] = v
  20415. }
  20416. reqHeaders.Set("User-Agent", c.s.userAgent())
  20417. var body io.Reader = nil
  20418. c.urlParams_.Set("alt", alt)
  20419. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  20420. urls += "?" + c.urlParams_.Encode()
  20421. req, _ := http.NewRequest("DELETE", urls, body)
  20422. req.Header = reqHeaders
  20423. googleapi.Expand(req.URL, map[string]string{
  20424. "profileId": strconv.FormatInt(c.profileId, 10),
  20425. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  20426. "id": strconv.FormatInt(c.id, 10),
  20427. })
  20428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20429. }
  20430. // Do executes the "dfareporting.creativeFieldValues.delete" call.
  20431. func (c *CreativeFieldValuesDeleteCall) Do(opts ...googleapi.CallOption) error {
  20432. gensupport.SetOptions(c.urlParams_, opts...)
  20433. res, err := c.doRequest("json")
  20434. if err != nil {
  20435. return err
  20436. }
  20437. defer googleapi.CloseBody(res)
  20438. if err := googleapi.CheckResponse(res); err != nil {
  20439. return err
  20440. }
  20441. return nil
  20442. // {
  20443. // "description": "Deletes an existing creative field value.",
  20444. // "httpMethod": "DELETE",
  20445. // "id": "dfareporting.creativeFieldValues.delete",
  20446. // "parameterOrder": [
  20447. // "profileId",
  20448. // "creativeFieldId",
  20449. // "id"
  20450. // ],
  20451. // "parameters": {
  20452. // "creativeFieldId": {
  20453. // "description": "Creative field ID for this creative field value.",
  20454. // "format": "int64",
  20455. // "location": "path",
  20456. // "required": true,
  20457. // "type": "string"
  20458. // },
  20459. // "id": {
  20460. // "description": "Creative Field Value ID",
  20461. // "format": "int64",
  20462. // "location": "path",
  20463. // "required": true,
  20464. // "type": "string"
  20465. // },
  20466. // "profileId": {
  20467. // "description": "User profile ID associated with this request.",
  20468. // "format": "int64",
  20469. // "location": "path",
  20470. // "required": true,
  20471. // "type": "string"
  20472. // }
  20473. // },
  20474. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  20475. // "scopes": [
  20476. // "https://www.googleapis.com/auth/dfatrafficking"
  20477. // ]
  20478. // }
  20479. }
  20480. // method id "dfareporting.creativeFieldValues.get":
  20481. type CreativeFieldValuesGetCall struct {
  20482. s *Service
  20483. profileId int64
  20484. creativeFieldId int64
  20485. id int64
  20486. urlParams_ gensupport.URLParams
  20487. ifNoneMatch_ string
  20488. ctx_ context.Context
  20489. header_ http.Header
  20490. }
  20491. // Get: Gets one creative field value by ID.
  20492. func (r *CreativeFieldValuesService) Get(profileId int64, creativeFieldId int64, id int64) *CreativeFieldValuesGetCall {
  20493. c := &CreativeFieldValuesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20494. c.profileId = profileId
  20495. c.creativeFieldId = creativeFieldId
  20496. c.id = id
  20497. return c
  20498. }
  20499. // Fields allows partial responses to be retrieved. See
  20500. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20501. // for more information.
  20502. func (c *CreativeFieldValuesGetCall) Fields(s ...googleapi.Field) *CreativeFieldValuesGetCall {
  20503. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20504. return c
  20505. }
  20506. // IfNoneMatch sets the optional parameter which makes the operation
  20507. // fail if the object's ETag matches the given value. This is useful for
  20508. // getting updates only after the object has changed since the last
  20509. // request. Use googleapi.IsNotModified to check whether the response
  20510. // error from Do is the result of In-None-Match.
  20511. func (c *CreativeFieldValuesGetCall) IfNoneMatch(entityTag string) *CreativeFieldValuesGetCall {
  20512. c.ifNoneMatch_ = entityTag
  20513. return c
  20514. }
  20515. // Context sets the context to be used in this call's Do method. Any
  20516. // pending HTTP request will be aborted if the provided context is
  20517. // canceled.
  20518. func (c *CreativeFieldValuesGetCall) Context(ctx context.Context) *CreativeFieldValuesGetCall {
  20519. c.ctx_ = ctx
  20520. return c
  20521. }
  20522. // Header returns an http.Header that can be modified by the caller to
  20523. // add HTTP headers to the request.
  20524. func (c *CreativeFieldValuesGetCall) Header() http.Header {
  20525. if c.header_ == nil {
  20526. c.header_ = make(http.Header)
  20527. }
  20528. return c.header_
  20529. }
  20530. func (c *CreativeFieldValuesGetCall) doRequest(alt string) (*http.Response, error) {
  20531. reqHeaders := make(http.Header)
  20532. for k, v := range c.header_ {
  20533. reqHeaders[k] = v
  20534. }
  20535. reqHeaders.Set("User-Agent", c.s.userAgent())
  20536. if c.ifNoneMatch_ != "" {
  20537. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20538. }
  20539. var body io.Reader = nil
  20540. c.urlParams_.Set("alt", alt)
  20541. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}")
  20542. urls += "?" + c.urlParams_.Encode()
  20543. req, _ := http.NewRequest("GET", urls, body)
  20544. req.Header = reqHeaders
  20545. googleapi.Expand(req.URL, map[string]string{
  20546. "profileId": strconv.FormatInt(c.profileId, 10),
  20547. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  20548. "id": strconv.FormatInt(c.id, 10),
  20549. })
  20550. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20551. }
  20552. // Do executes the "dfareporting.creativeFieldValues.get" call.
  20553. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  20554. // non-2xx status code is an error. Response headers are in either
  20555. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  20556. // returned at all) in error.(*googleapi.Error).Header. Use
  20557. // googleapi.IsNotModified to check whether the returned error was
  20558. // because http.StatusNotModified was returned.
  20559. func (c *CreativeFieldValuesGetCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  20560. gensupport.SetOptions(c.urlParams_, opts...)
  20561. res, err := c.doRequest("json")
  20562. if res != nil && res.StatusCode == http.StatusNotModified {
  20563. if res.Body != nil {
  20564. res.Body.Close()
  20565. }
  20566. return nil, &googleapi.Error{
  20567. Code: res.StatusCode,
  20568. Header: res.Header,
  20569. }
  20570. }
  20571. if err != nil {
  20572. return nil, err
  20573. }
  20574. defer googleapi.CloseBody(res)
  20575. if err := googleapi.CheckResponse(res); err != nil {
  20576. return nil, err
  20577. }
  20578. ret := &CreativeFieldValue{
  20579. ServerResponse: googleapi.ServerResponse{
  20580. Header: res.Header,
  20581. HTTPStatusCode: res.StatusCode,
  20582. },
  20583. }
  20584. target := &ret
  20585. if err := gensupport.DecodeResponse(target, res); err != nil {
  20586. return nil, err
  20587. }
  20588. return ret, nil
  20589. // {
  20590. // "description": "Gets one creative field value by ID.",
  20591. // "httpMethod": "GET",
  20592. // "id": "dfareporting.creativeFieldValues.get",
  20593. // "parameterOrder": [
  20594. // "profileId",
  20595. // "creativeFieldId",
  20596. // "id"
  20597. // ],
  20598. // "parameters": {
  20599. // "creativeFieldId": {
  20600. // "description": "Creative field ID for this creative field value.",
  20601. // "format": "int64",
  20602. // "location": "path",
  20603. // "required": true,
  20604. // "type": "string"
  20605. // },
  20606. // "id": {
  20607. // "description": "Creative Field Value ID",
  20608. // "format": "int64",
  20609. // "location": "path",
  20610. // "required": true,
  20611. // "type": "string"
  20612. // },
  20613. // "profileId": {
  20614. // "description": "User profile ID associated with this request.",
  20615. // "format": "int64",
  20616. // "location": "path",
  20617. // "required": true,
  20618. // "type": "string"
  20619. // }
  20620. // },
  20621. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues/{id}",
  20622. // "response": {
  20623. // "$ref": "CreativeFieldValue"
  20624. // },
  20625. // "scopes": [
  20626. // "https://www.googleapis.com/auth/dfatrafficking"
  20627. // ]
  20628. // }
  20629. }
  20630. // method id "dfareporting.creativeFieldValues.insert":
  20631. type CreativeFieldValuesInsertCall struct {
  20632. s *Service
  20633. profileId int64
  20634. creativeFieldId int64
  20635. creativefieldvalue *CreativeFieldValue
  20636. urlParams_ gensupport.URLParams
  20637. ctx_ context.Context
  20638. header_ http.Header
  20639. }
  20640. // Insert: Inserts a new creative field value.
  20641. func (r *CreativeFieldValuesService) Insert(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesInsertCall {
  20642. c := &CreativeFieldValuesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20643. c.profileId = profileId
  20644. c.creativeFieldId = creativeFieldId
  20645. c.creativefieldvalue = creativefieldvalue
  20646. return c
  20647. }
  20648. // Fields allows partial responses to be retrieved. See
  20649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20650. // for more information.
  20651. func (c *CreativeFieldValuesInsertCall) Fields(s ...googleapi.Field) *CreativeFieldValuesInsertCall {
  20652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20653. return c
  20654. }
  20655. // Context sets the context to be used in this call's Do method. Any
  20656. // pending HTTP request will be aborted if the provided context is
  20657. // canceled.
  20658. func (c *CreativeFieldValuesInsertCall) Context(ctx context.Context) *CreativeFieldValuesInsertCall {
  20659. c.ctx_ = ctx
  20660. return c
  20661. }
  20662. // Header returns an http.Header that can be modified by the caller to
  20663. // add HTTP headers to the request.
  20664. func (c *CreativeFieldValuesInsertCall) Header() http.Header {
  20665. if c.header_ == nil {
  20666. c.header_ = make(http.Header)
  20667. }
  20668. return c.header_
  20669. }
  20670. func (c *CreativeFieldValuesInsertCall) doRequest(alt string) (*http.Response, error) {
  20671. reqHeaders := make(http.Header)
  20672. for k, v := range c.header_ {
  20673. reqHeaders[k] = v
  20674. }
  20675. reqHeaders.Set("User-Agent", c.s.userAgent())
  20676. var body io.Reader = nil
  20677. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  20678. if err != nil {
  20679. return nil, err
  20680. }
  20681. reqHeaders.Set("Content-Type", "application/json")
  20682. c.urlParams_.Set("alt", alt)
  20683. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  20684. urls += "?" + c.urlParams_.Encode()
  20685. req, _ := http.NewRequest("POST", urls, body)
  20686. req.Header = reqHeaders
  20687. googleapi.Expand(req.URL, map[string]string{
  20688. "profileId": strconv.FormatInt(c.profileId, 10),
  20689. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  20690. })
  20691. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20692. }
  20693. // Do executes the "dfareporting.creativeFieldValues.insert" call.
  20694. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  20695. // non-2xx status code is an error. Response headers are in either
  20696. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  20697. // returned at all) in error.(*googleapi.Error).Header. Use
  20698. // googleapi.IsNotModified to check whether the returned error was
  20699. // because http.StatusNotModified was returned.
  20700. func (c *CreativeFieldValuesInsertCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  20701. gensupport.SetOptions(c.urlParams_, opts...)
  20702. res, err := c.doRequest("json")
  20703. if res != nil && res.StatusCode == http.StatusNotModified {
  20704. if res.Body != nil {
  20705. res.Body.Close()
  20706. }
  20707. return nil, &googleapi.Error{
  20708. Code: res.StatusCode,
  20709. Header: res.Header,
  20710. }
  20711. }
  20712. if err != nil {
  20713. return nil, err
  20714. }
  20715. defer googleapi.CloseBody(res)
  20716. if err := googleapi.CheckResponse(res); err != nil {
  20717. return nil, err
  20718. }
  20719. ret := &CreativeFieldValue{
  20720. ServerResponse: googleapi.ServerResponse{
  20721. Header: res.Header,
  20722. HTTPStatusCode: res.StatusCode,
  20723. },
  20724. }
  20725. target := &ret
  20726. if err := gensupport.DecodeResponse(target, res); err != nil {
  20727. return nil, err
  20728. }
  20729. return ret, nil
  20730. // {
  20731. // "description": "Inserts a new creative field value.",
  20732. // "httpMethod": "POST",
  20733. // "id": "dfareporting.creativeFieldValues.insert",
  20734. // "parameterOrder": [
  20735. // "profileId",
  20736. // "creativeFieldId"
  20737. // ],
  20738. // "parameters": {
  20739. // "creativeFieldId": {
  20740. // "description": "Creative field ID for this creative field value.",
  20741. // "format": "int64",
  20742. // "location": "path",
  20743. // "required": true,
  20744. // "type": "string"
  20745. // },
  20746. // "profileId": {
  20747. // "description": "User profile ID associated with this request.",
  20748. // "format": "int64",
  20749. // "location": "path",
  20750. // "required": true,
  20751. // "type": "string"
  20752. // }
  20753. // },
  20754. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  20755. // "request": {
  20756. // "$ref": "CreativeFieldValue"
  20757. // },
  20758. // "response": {
  20759. // "$ref": "CreativeFieldValue"
  20760. // },
  20761. // "scopes": [
  20762. // "https://www.googleapis.com/auth/dfatrafficking"
  20763. // ]
  20764. // }
  20765. }
  20766. // method id "dfareporting.creativeFieldValues.list":
  20767. type CreativeFieldValuesListCall struct {
  20768. s *Service
  20769. profileId int64
  20770. creativeFieldId int64
  20771. urlParams_ gensupport.URLParams
  20772. ifNoneMatch_ string
  20773. ctx_ context.Context
  20774. header_ http.Header
  20775. }
  20776. // List: Retrieves a list of creative field values, possibly filtered.
  20777. // This method supports paging.
  20778. func (r *CreativeFieldValuesService) List(profileId int64, creativeFieldId int64) *CreativeFieldValuesListCall {
  20779. c := &CreativeFieldValuesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  20780. c.profileId = profileId
  20781. c.creativeFieldId = creativeFieldId
  20782. return c
  20783. }
  20784. // Ids sets the optional parameter "ids": Select only creative field
  20785. // values with these IDs.
  20786. func (c *CreativeFieldValuesListCall) Ids(ids ...int64) *CreativeFieldValuesListCall {
  20787. var ids_ []string
  20788. for _, v := range ids {
  20789. ids_ = append(ids_, fmt.Sprint(v))
  20790. }
  20791. c.urlParams_.SetMulti("ids", ids_)
  20792. return c
  20793. }
  20794. // MaxResults sets the optional parameter "maxResults": Maximum number
  20795. // of results to return.
  20796. func (c *CreativeFieldValuesListCall) MaxResults(maxResults int64) *CreativeFieldValuesListCall {
  20797. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  20798. return c
  20799. }
  20800. // PageToken sets the optional parameter "pageToken": Value of the
  20801. // nextPageToken from the previous result page.
  20802. func (c *CreativeFieldValuesListCall) PageToken(pageToken string) *CreativeFieldValuesListCall {
  20803. c.urlParams_.Set("pageToken", pageToken)
  20804. return c
  20805. }
  20806. // SearchString sets the optional parameter "searchString": Allows
  20807. // searching for creative field values by their values. Wildcards (e.g.
  20808. // *) are not allowed.
  20809. func (c *CreativeFieldValuesListCall) SearchString(searchString string) *CreativeFieldValuesListCall {
  20810. c.urlParams_.Set("searchString", searchString)
  20811. return c
  20812. }
  20813. // SortField sets the optional parameter "sortField": Field by which to
  20814. // sort the list.
  20815. //
  20816. // Possible values:
  20817. // "ID" (default)
  20818. // "VALUE"
  20819. func (c *CreativeFieldValuesListCall) SortField(sortField string) *CreativeFieldValuesListCall {
  20820. c.urlParams_.Set("sortField", sortField)
  20821. return c
  20822. }
  20823. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  20824. // results.
  20825. //
  20826. // Possible values:
  20827. // "ASCENDING" (default)
  20828. // "DESCENDING"
  20829. func (c *CreativeFieldValuesListCall) SortOrder(sortOrder string) *CreativeFieldValuesListCall {
  20830. c.urlParams_.Set("sortOrder", sortOrder)
  20831. return c
  20832. }
  20833. // Fields allows partial responses to be retrieved. See
  20834. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  20835. // for more information.
  20836. func (c *CreativeFieldValuesListCall) Fields(s ...googleapi.Field) *CreativeFieldValuesListCall {
  20837. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  20838. return c
  20839. }
  20840. // IfNoneMatch sets the optional parameter which makes the operation
  20841. // fail if the object's ETag matches the given value. This is useful for
  20842. // getting updates only after the object has changed since the last
  20843. // request. Use googleapi.IsNotModified to check whether the response
  20844. // error from Do is the result of In-None-Match.
  20845. func (c *CreativeFieldValuesListCall) IfNoneMatch(entityTag string) *CreativeFieldValuesListCall {
  20846. c.ifNoneMatch_ = entityTag
  20847. return c
  20848. }
  20849. // Context sets the context to be used in this call's Do method. Any
  20850. // pending HTTP request will be aborted if the provided context is
  20851. // canceled.
  20852. func (c *CreativeFieldValuesListCall) Context(ctx context.Context) *CreativeFieldValuesListCall {
  20853. c.ctx_ = ctx
  20854. return c
  20855. }
  20856. // Header returns an http.Header that can be modified by the caller to
  20857. // add HTTP headers to the request.
  20858. func (c *CreativeFieldValuesListCall) Header() http.Header {
  20859. if c.header_ == nil {
  20860. c.header_ = make(http.Header)
  20861. }
  20862. return c.header_
  20863. }
  20864. func (c *CreativeFieldValuesListCall) doRequest(alt string) (*http.Response, error) {
  20865. reqHeaders := make(http.Header)
  20866. for k, v := range c.header_ {
  20867. reqHeaders[k] = v
  20868. }
  20869. reqHeaders.Set("User-Agent", c.s.userAgent())
  20870. if c.ifNoneMatch_ != "" {
  20871. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  20872. }
  20873. var body io.Reader = nil
  20874. c.urlParams_.Set("alt", alt)
  20875. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  20876. urls += "?" + c.urlParams_.Encode()
  20877. req, _ := http.NewRequest("GET", urls, body)
  20878. req.Header = reqHeaders
  20879. googleapi.Expand(req.URL, map[string]string{
  20880. "profileId": strconv.FormatInt(c.profileId, 10),
  20881. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  20882. })
  20883. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  20884. }
  20885. // Do executes the "dfareporting.creativeFieldValues.list" call.
  20886. // Exactly one of *CreativeFieldValuesListResponse or error will be
  20887. // non-nil. Any non-2xx status code is an error. Response headers are in
  20888. // either *CreativeFieldValuesListResponse.ServerResponse.Header or (if
  20889. // a response was returned at all) in error.(*googleapi.Error).Header.
  20890. // Use googleapi.IsNotModified to check whether the returned error was
  20891. // because http.StatusNotModified was returned.
  20892. func (c *CreativeFieldValuesListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValuesListResponse, error) {
  20893. gensupport.SetOptions(c.urlParams_, opts...)
  20894. res, err := c.doRequest("json")
  20895. if res != nil && res.StatusCode == http.StatusNotModified {
  20896. if res.Body != nil {
  20897. res.Body.Close()
  20898. }
  20899. return nil, &googleapi.Error{
  20900. Code: res.StatusCode,
  20901. Header: res.Header,
  20902. }
  20903. }
  20904. if err != nil {
  20905. return nil, err
  20906. }
  20907. defer googleapi.CloseBody(res)
  20908. if err := googleapi.CheckResponse(res); err != nil {
  20909. return nil, err
  20910. }
  20911. ret := &CreativeFieldValuesListResponse{
  20912. ServerResponse: googleapi.ServerResponse{
  20913. Header: res.Header,
  20914. HTTPStatusCode: res.StatusCode,
  20915. },
  20916. }
  20917. target := &ret
  20918. if err := gensupport.DecodeResponse(target, res); err != nil {
  20919. return nil, err
  20920. }
  20921. return ret, nil
  20922. // {
  20923. // "description": "Retrieves a list of creative field values, possibly filtered. This method supports paging.",
  20924. // "httpMethod": "GET",
  20925. // "id": "dfareporting.creativeFieldValues.list",
  20926. // "parameterOrder": [
  20927. // "profileId",
  20928. // "creativeFieldId"
  20929. // ],
  20930. // "parameters": {
  20931. // "creativeFieldId": {
  20932. // "description": "Creative field ID for this creative field value.",
  20933. // "format": "int64",
  20934. // "location": "path",
  20935. // "required": true,
  20936. // "type": "string"
  20937. // },
  20938. // "ids": {
  20939. // "description": "Select only creative field values with these IDs.",
  20940. // "format": "int64",
  20941. // "location": "query",
  20942. // "repeated": true,
  20943. // "type": "string"
  20944. // },
  20945. // "maxResults": {
  20946. // "default": "1000",
  20947. // "description": "Maximum number of results to return.",
  20948. // "format": "int32",
  20949. // "location": "query",
  20950. // "maximum": "1000",
  20951. // "minimum": "0",
  20952. // "type": "integer"
  20953. // },
  20954. // "pageToken": {
  20955. // "description": "Value of the nextPageToken from the previous result page.",
  20956. // "location": "query",
  20957. // "type": "string"
  20958. // },
  20959. // "profileId": {
  20960. // "description": "User profile ID associated with this request.",
  20961. // "format": "int64",
  20962. // "location": "path",
  20963. // "required": true,
  20964. // "type": "string"
  20965. // },
  20966. // "searchString": {
  20967. // "description": "Allows searching for creative field values by their values. Wildcards (e.g. *) are not allowed.",
  20968. // "location": "query",
  20969. // "type": "string"
  20970. // },
  20971. // "sortField": {
  20972. // "default": "ID",
  20973. // "description": "Field by which to sort the list.",
  20974. // "enum": [
  20975. // "ID",
  20976. // "VALUE"
  20977. // ],
  20978. // "enumDescriptions": [
  20979. // "",
  20980. // ""
  20981. // ],
  20982. // "location": "query",
  20983. // "type": "string"
  20984. // },
  20985. // "sortOrder": {
  20986. // "default": "ASCENDING",
  20987. // "description": "Order of sorted results.",
  20988. // "enum": [
  20989. // "ASCENDING",
  20990. // "DESCENDING"
  20991. // ],
  20992. // "enumDescriptions": [
  20993. // "",
  20994. // ""
  20995. // ],
  20996. // "location": "query",
  20997. // "type": "string"
  20998. // }
  20999. // },
  21000. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  21001. // "response": {
  21002. // "$ref": "CreativeFieldValuesListResponse"
  21003. // },
  21004. // "scopes": [
  21005. // "https://www.googleapis.com/auth/dfatrafficking"
  21006. // ]
  21007. // }
  21008. }
  21009. // Pages invokes f for each page of results.
  21010. // A non-nil error returned from f will halt the iteration.
  21011. // The provided context supersedes any context provided to the Context method.
  21012. func (c *CreativeFieldValuesListCall) Pages(ctx context.Context, f func(*CreativeFieldValuesListResponse) error) error {
  21013. c.ctx_ = ctx
  21014. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  21015. for {
  21016. x, err := c.Do()
  21017. if err != nil {
  21018. return err
  21019. }
  21020. if err := f(x); err != nil {
  21021. return err
  21022. }
  21023. if x.NextPageToken == "" {
  21024. return nil
  21025. }
  21026. c.PageToken(x.NextPageToken)
  21027. }
  21028. }
  21029. // method id "dfareporting.creativeFieldValues.patch":
  21030. type CreativeFieldValuesPatchCall struct {
  21031. s *Service
  21032. profileId int64
  21033. creativeFieldId int64
  21034. creativefieldvalue *CreativeFieldValue
  21035. urlParams_ gensupport.URLParams
  21036. ctx_ context.Context
  21037. header_ http.Header
  21038. }
  21039. // Patch: Updates an existing creative field value. This method supports
  21040. // patch semantics.
  21041. func (r *CreativeFieldValuesService) Patch(profileId int64, creativeFieldId int64, id int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesPatchCall {
  21042. c := &CreativeFieldValuesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21043. c.profileId = profileId
  21044. c.creativeFieldId = creativeFieldId
  21045. c.urlParams_.Set("id", fmt.Sprint(id))
  21046. c.creativefieldvalue = creativefieldvalue
  21047. return c
  21048. }
  21049. // Fields allows partial responses to be retrieved. See
  21050. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21051. // for more information.
  21052. func (c *CreativeFieldValuesPatchCall) Fields(s ...googleapi.Field) *CreativeFieldValuesPatchCall {
  21053. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21054. return c
  21055. }
  21056. // Context sets the context to be used in this call's Do method. Any
  21057. // pending HTTP request will be aborted if the provided context is
  21058. // canceled.
  21059. func (c *CreativeFieldValuesPatchCall) Context(ctx context.Context) *CreativeFieldValuesPatchCall {
  21060. c.ctx_ = ctx
  21061. return c
  21062. }
  21063. // Header returns an http.Header that can be modified by the caller to
  21064. // add HTTP headers to the request.
  21065. func (c *CreativeFieldValuesPatchCall) Header() http.Header {
  21066. if c.header_ == nil {
  21067. c.header_ = make(http.Header)
  21068. }
  21069. return c.header_
  21070. }
  21071. func (c *CreativeFieldValuesPatchCall) doRequest(alt string) (*http.Response, error) {
  21072. reqHeaders := make(http.Header)
  21073. for k, v := range c.header_ {
  21074. reqHeaders[k] = v
  21075. }
  21076. reqHeaders.Set("User-Agent", c.s.userAgent())
  21077. var body io.Reader = nil
  21078. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  21079. if err != nil {
  21080. return nil, err
  21081. }
  21082. reqHeaders.Set("Content-Type", "application/json")
  21083. c.urlParams_.Set("alt", alt)
  21084. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  21085. urls += "?" + c.urlParams_.Encode()
  21086. req, _ := http.NewRequest("PATCH", urls, body)
  21087. req.Header = reqHeaders
  21088. googleapi.Expand(req.URL, map[string]string{
  21089. "profileId": strconv.FormatInt(c.profileId, 10),
  21090. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21091. })
  21092. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21093. }
  21094. // Do executes the "dfareporting.creativeFieldValues.patch" call.
  21095. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  21096. // non-2xx status code is an error. Response headers are in either
  21097. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  21098. // returned at all) in error.(*googleapi.Error).Header. Use
  21099. // googleapi.IsNotModified to check whether the returned error was
  21100. // because http.StatusNotModified was returned.
  21101. func (c *CreativeFieldValuesPatchCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  21102. gensupport.SetOptions(c.urlParams_, opts...)
  21103. res, err := c.doRequest("json")
  21104. if res != nil && res.StatusCode == http.StatusNotModified {
  21105. if res.Body != nil {
  21106. res.Body.Close()
  21107. }
  21108. return nil, &googleapi.Error{
  21109. Code: res.StatusCode,
  21110. Header: res.Header,
  21111. }
  21112. }
  21113. if err != nil {
  21114. return nil, err
  21115. }
  21116. defer googleapi.CloseBody(res)
  21117. if err := googleapi.CheckResponse(res); err != nil {
  21118. return nil, err
  21119. }
  21120. ret := &CreativeFieldValue{
  21121. ServerResponse: googleapi.ServerResponse{
  21122. Header: res.Header,
  21123. HTTPStatusCode: res.StatusCode,
  21124. },
  21125. }
  21126. target := &ret
  21127. if err := gensupport.DecodeResponse(target, res); err != nil {
  21128. return nil, err
  21129. }
  21130. return ret, nil
  21131. // {
  21132. // "description": "Updates an existing creative field value. This method supports patch semantics.",
  21133. // "httpMethod": "PATCH",
  21134. // "id": "dfareporting.creativeFieldValues.patch",
  21135. // "parameterOrder": [
  21136. // "profileId",
  21137. // "creativeFieldId",
  21138. // "id"
  21139. // ],
  21140. // "parameters": {
  21141. // "creativeFieldId": {
  21142. // "description": "Creative field ID for this creative field value.",
  21143. // "format": "int64",
  21144. // "location": "path",
  21145. // "required": true,
  21146. // "type": "string"
  21147. // },
  21148. // "id": {
  21149. // "description": "Creative Field Value ID",
  21150. // "format": "int64",
  21151. // "location": "query",
  21152. // "required": true,
  21153. // "type": "string"
  21154. // },
  21155. // "profileId": {
  21156. // "description": "User profile ID associated with this request.",
  21157. // "format": "int64",
  21158. // "location": "path",
  21159. // "required": true,
  21160. // "type": "string"
  21161. // }
  21162. // },
  21163. // "path": "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues",
  21164. // "request": {
  21165. // "$ref": "CreativeFieldValue"
  21166. // },
  21167. // "response": {
  21168. // "$ref": "CreativeFieldValue"
  21169. // },
  21170. // "scopes": [
  21171. // "https://www.googleapis.com/auth/dfatrafficking"
  21172. // ]
  21173. // }
  21174. }
  21175. // method id "dfareporting.creativeFieldValues.update":
  21176. type CreativeFieldValuesUpdateCall struct {
  21177. s *Service
  21178. profileId int64
  21179. creativeFieldId int64
  21180. creativefieldvalue *CreativeFieldValue
  21181. urlParams_ gensupport.URLParams
  21182. ctx_ context.Context
  21183. header_ http.Header
  21184. }
  21185. // Update: Updates an existing creative field value.
  21186. func (r *CreativeFieldValuesService) Update(profileId int64, creativeFieldId int64, creativefieldvalue *CreativeFieldValue) *CreativeFieldValuesUpdateCall {
  21187. c := &CreativeFieldValuesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21188. c.profileId = profileId
  21189. c.creativeFieldId = creativeFieldId
  21190. c.creativefieldvalue = creativefieldvalue
  21191. return c
  21192. }
  21193. // Fields allows partial responses to be retrieved. See
  21194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21195. // for more information.
  21196. func (c *CreativeFieldValuesUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldValuesUpdateCall {
  21197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21198. return c
  21199. }
  21200. // Context sets the context to be used in this call's Do method. Any
  21201. // pending HTTP request will be aborted if the provided context is
  21202. // canceled.
  21203. func (c *CreativeFieldValuesUpdateCall) Context(ctx context.Context) *CreativeFieldValuesUpdateCall {
  21204. c.ctx_ = ctx
  21205. return c
  21206. }
  21207. // Header returns an http.Header that can be modified by the caller to
  21208. // add HTTP headers to the request.
  21209. func (c *CreativeFieldValuesUpdateCall) Header() http.Header {
  21210. if c.header_ == nil {
  21211. c.header_ = make(http.Header)
  21212. }
  21213. return c.header_
  21214. }
  21215. func (c *CreativeFieldValuesUpdateCall) doRequest(alt string) (*http.Response, error) {
  21216. reqHeaders := make(http.Header)
  21217. for k, v := range c.header_ {
  21218. reqHeaders[k] = v
  21219. }
  21220. reqHeaders.Set("User-Agent", c.s.userAgent())
  21221. var body io.Reader = nil
  21222. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefieldvalue)
  21223. if err != nil {
  21224. return nil, err
  21225. }
  21226. reqHeaders.Set("Content-Type", "application/json")
  21227. c.urlParams_.Set("alt", alt)
  21228. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{creativeFieldId}/creativeFieldValues")
  21229. urls += "?" + c.urlParams_.Encode()
  21230. req, _ := http.NewRequest("PUT", urls, body)
  21231. req.Header = reqHeaders
  21232. googleapi.Expand(req.URL, map[string]string{
  21233. "profileId": strconv.FormatInt(c.profileId, 10),
  21234. "creativeFieldId": strconv.FormatInt(c.creativeFieldId, 10),
  21235. })
  21236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21237. }
  21238. // Do executes the "dfareporting.creativeFieldValues.update" call.
  21239. // Exactly one of *CreativeFieldValue or error will be non-nil. Any
  21240. // non-2xx status code is an error. Response headers are in either
  21241. // *CreativeFieldValue.ServerResponse.Header or (if a response was
  21242. // returned at all) in error.(*googleapi.Error).Header. Use
  21243. // googleapi.IsNotModified to check whether the returned error was
  21244. // because http.StatusNotModified was returned.
  21245. func (c *CreativeFieldValuesUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeFieldValue, error) {
  21246. gensupport.SetOptions(c.urlParams_, opts...)
  21247. res, err := c.doRequest("json")
  21248. if res != nil && res.StatusCode == http.StatusNotModified {
  21249. if res.Body != nil {
  21250. res.Body.Close()
  21251. }
  21252. return nil, &googleapi.Error{
  21253. Code: res.StatusCode,
  21254. Header: res.Header,
  21255. }
  21256. }
  21257. if err != nil {
  21258. return nil, err
  21259. }
  21260. defer googleapi.CloseBody(res)
  21261. if err := googleapi.CheckResponse(res); err != nil {
  21262. return nil, err
  21263. }
  21264. ret := &CreativeFieldValue{
  21265. ServerResponse: googleapi.ServerResponse{
  21266. Header: res.Header,
  21267. HTTPStatusCode: res.StatusCode,
  21268. },
  21269. }
  21270. target := &ret
  21271. if err := gensupport.DecodeResponse(target, res); err != nil {
  21272. return nil, err
  21273. }
  21274. return ret, nil
  21275. // {
  21276. // "description": "Updates an existing creative field value.",
  21277. // "httpMethod": "PUT",
  21278. // "id": "dfareporting.creativeFieldValues.update",
  21279. // "parameterOrder": [
  21280. // "profileId",
  21281. // "creativeFieldId"
  21282. // ],
  21283. // "parameters": {
  21284. // "creativeFieldId": {
  21285. // "description": "Creative field ID for this creative field value.",
  21286. // "format": "int64",
  21287. // "location": "path",
  21288. // "required": true,
  21289. // "type": "string"
  21290. // },
  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}/creativeFields/{creativeFieldId}/creativeFieldValues",
  21300. // "request": {
  21301. // "$ref": "CreativeFieldValue"
  21302. // },
  21303. // "response": {
  21304. // "$ref": "CreativeFieldValue"
  21305. // },
  21306. // "scopes": [
  21307. // "https://www.googleapis.com/auth/dfatrafficking"
  21308. // ]
  21309. // }
  21310. }
  21311. // method id "dfareporting.creativeFields.delete":
  21312. type CreativeFieldsDeleteCall struct {
  21313. s *Service
  21314. profileId int64
  21315. id int64
  21316. urlParams_ gensupport.URLParams
  21317. ctx_ context.Context
  21318. header_ http.Header
  21319. }
  21320. // Delete: Deletes an existing creative field.
  21321. func (r *CreativeFieldsService) Delete(profileId int64, id int64) *CreativeFieldsDeleteCall {
  21322. c := &CreativeFieldsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21323. c.profileId = profileId
  21324. c.id = id
  21325. return c
  21326. }
  21327. // Fields allows partial responses to be retrieved. See
  21328. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21329. // for more information.
  21330. func (c *CreativeFieldsDeleteCall) Fields(s ...googleapi.Field) *CreativeFieldsDeleteCall {
  21331. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21332. return c
  21333. }
  21334. // Context sets the context to be used in this call's Do method. Any
  21335. // pending HTTP request will be aborted if the provided context is
  21336. // canceled.
  21337. func (c *CreativeFieldsDeleteCall) Context(ctx context.Context) *CreativeFieldsDeleteCall {
  21338. c.ctx_ = ctx
  21339. return c
  21340. }
  21341. // Header returns an http.Header that can be modified by the caller to
  21342. // add HTTP headers to the request.
  21343. func (c *CreativeFieldsDeleteCall) Header() http.Header {
  21344. if c.header_ == nil {
  21345. c.header_ = make(http.Header)
  21346. }
  21347. return c.header_
  21348. }
  21349. func (c *CreativeFieldsDeleteCall) doRequest(alt string) (*http.Response, error) {
  21350. reqHeaders := make(http.Header)
  21351. for k, v := range c.header_ {
  21352. reqHeaders[k] = v
  21353. }
  21354. reqHeaders.Set("User-Agent", c.s.userAgent())
  21355. var body io.Reader = nil
  21356. c.urlParams_.Set("alt", alt)
  21357. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  21358. urls += "?" + c.urlParams_.Encode()
  21359. req, _ := http.NewRequest("DELETE", urls, body)
  21360. req.Header = reqHeaders
  21361. googleapi.Expand(req.URL, map[string]string{
  21362. "profileId": strconv.FormatInt(c.profileId, 10),
  21363. "id": strconv.FormatInt(c.id, 10),
  21364. })
  21365. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21366. }
  21367. // Do executes the "dfareporting.creativeFields.delete" call.
  21368. func (c *CreativeFieldsDeleteCall) Do(opts ...googleapi.CallOption) error {
  21369. gensupport.SetOptions(c.urlParams_, opts...)
  21370. res, err := c.doRequest("json")
  21371. if err != nil {
  21372. return err
  21373. }
  21374. defer googleapi.CloseBody(res)
  21375. if err := googleapi.CheckResponse(res); err != nil {
  21376. return err
  21377. }
  21378. return nil
  21379. // {
  21380. // "description": "Deletes an existing creative field.",
  21381. // "httpMethod": "DELETE",
  21382. // "id": "dfareporting.creativeFields.delete",
  21383. // "parameterOrder": [
  21384. // "profileId",
  21385. // "id"
  21386. // ],
  21387. // "parameters": {
  21388. // "id": {
  21389. // "description": "Creative Field ID",
  21390. // "format": "int64",
  21391. // "location": "path",
  21392. // "required": true,
  21393. // "type": "string"
  21394. // },
  21395. // "profileId": {
  21396. // "description": "User profile ID associated with this request.",
  21397. // "format": "int64",
  21398. // "location": "path",
  21399. // "required": true,
  21400. // "type": "string"
  21401. // }
  21402. // },
  21403. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  21404. // "scopes": [
  21405. // "https://www.googleapis.com/auth/dfatrafficking"
  21406. // ]
  21407. // }
  21408. }
  21409. // method id "dfareporting.creativeFields.get":
  21410. type CreativeFieldsGetCall struct {
  21411. s *Service
  21412. profileId int64
  21413. id int64
  21414. urlParams_ gensupport.URLParams
  21415. ifNoneMatch_ string
  21416. ctx_ context.Context
  21417. header_ http.Header
  21418. }
  21419. // Get: Gets one creative field by ID.
  21420. func (r *CreativeFieldsService) Get(profileId int64, id int64) *CreativeFieldsGetCall {
  21421. c := &CreativeFieldsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21422. c.profileId = profileId
  21423. c.id = id
  21424. return c
  21425. }
  21426. // Fields allows partial responses to be retrieved. See
  21427. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21428. // for more information.
  21429. func (c *CreativeFieldsGetCall) Fields(s ...googleapi.Field) *CreativeFieldsGetCall {
  21430. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21431. return c
  21432. }
  21433. // IfNoneMatch sets the optional parameter which makes the operation
  21434. // fail if the object's ETag matches the given value. This is useful for
  21435. // getting updates only after the object has changed since the last
  21436. // request. Use googleapi.IsNotModified to check whether the response
  21437. // error from Do is the result of In-None-Match.
  21438. func (c *CreativeFieldsGetCall) IfNoneMatch(entityTag string) *CreativeFieldsGetCall {
  21439. c.ifNoneMatch_ = entityTag
  21440. return c
  21441. }
  21442. // Context sets the context to be used in this call's Do method. Any
  21443. // pending HTTP request will be aborted if the provided context is
  21444. // canceled.
  21445. func (c *CreativeFieldsGetCall) Context(ctx context.Context) *CreativeFieldsGetCall {
  21446. c.ctx_ = ctx
  21447. return c
  21448. }
  21449. // Header returns an http.Header that can be modified by the caller to
  21450. // add HTTP headers to the request.
  21451. func (c *CreativeFieldsGetCall) Header() http.Header {
  21452. if c.header_ == nil {
  21453. c.header_ = make(http.Header)
  21454. }
  21455. return c.header_
  21456. }
  21457. func (c *CreativeFieldsGetCall) doRequest(alt string) (*http.Response, error) {
  21458. reqHeaders := make(http.Header)
  21459. for k, v := range c.header_ {
  21460. reqHeaders[k] = v
  21461. }
  21462. reqHeaders.Set("User-Agent", c.s.userAgent())
  21463. if c.ifNoneMatch_ != "" {
  21464. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21465. }
  21466. var body io.Reader = nil
  21467. c.urlParams_.Set("alt", alt)
  21468. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields/{id}")
  21469. urls += "?" + c.urlParams_.Encode()
  21470. req, _ := http.NewRequest("GET", urls, body)
  21471. req.Header = reqHeaders
  21472. googleapi.Expand(req.URL, map[string]string{
  21473. "profileId": strconv.FormatInt(c.profileId, 10),
  21474. "id": strconv.FormatInt(c.id, 10),
  21475. })
  21476. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21477. }
  21478. // Do executes the "dfareporting.creativeFields.get" call.
  21479. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  21480. // status code is an error. Response headers are in either
  21481. // *CreativeField.ServerResponse.Header or (if a response was returned
  21482. // at all) in error.(*googleapi.Error).Header. Use
  21483. // googleapi.IsNotModified to check whether the returned error was
  21484. // because http.StatusNotModified was returned.
  21485. func (c *CreativeFieldsGetCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  21486. gensupport.SetOptions(c.urlParams_, opts...)
  21487. res, err := c.doRequest("json")
  21488. if res != nil && res.StatusCode == http.StatusNotModified {
  21489. if res.Body != nil {
  21490. res.Body.Close()
  21491. }
  21492. return nil, &googleapi.Error{
  21493. Code: res.StatusCode,
  21494. Header: res.Header,
  21495. }
  21496. }
  21497. if err != nil {
  21498. return nil, err
  21499. }
  21500. defer googleapi.CloseBody(res)
  21501. if err := googleapi.CheckResponse(res); err != nil {
  21502. return nil, err
  21503. }
  21504. ret := &CreativeField{
  21505. ServerResponse: googleapi.ServerResponse{
  21506. Header: res.Header,
  21507. HTTPStatusCode: res.StatusCode,
  21508. },
  21509. }
  21510. target := &ret
  21511. if err := gensupport.DecodeResponse(target, res); err != nil {
  21512. return nil, err
  21513. }
  21514. return ret, nil
  21515. // {
  21516. // "description": "Gets one creative field by ID.",
  21517. // "httpMethod": "GET",
  21518. // "id": "dfareporting.creativeFields.get",
  21519. // "parameterOrder": [
  21520. // "profileId",
  21521. // "id"
  21522. // ],
  21523. // "parameters": {
  21524. // "id": {
  21525. // "description": "Creative Field ID",
  21526. // "format": "int64",
  21527. // "location": "path",
  21528. // "required": true,
  21529. // "type": "string"
  21530. // },
  21531. // "profileId": {
  21532. // "description": "User profile ID associated with this request.",
  21533. // "format": "int64",
  21534. // "location": "path",
  21535. // "required": true,
  21536. // "type": "string"
  21537. // }
  21538. // },
  21539. // "path": "userprofiles/{profileId}/creativeFields/{id}",
  21540. // "response": {
  21541. // "$ref": "CreativeField"
  21542. // },
  21543. // "scopes": [
  21544. // "https://www.googleapis.com/auth/dfatrafficking"
  21545. // ]
  21546. // }
  21547. }
  21548. // method id "dfareporting.creativeFields.insert":
  21549. type CreativeFieldsInsertCall struct {
  21550. s *Service
  21551. profileId int64
  21552. creativefield *CreativeField
  21553. urlParams_ gensupport.URLParams
  21554. ctx_ context.Context
  21555. header_ http.Header
  21556. }
  21557. // Insert: Inserts a new creative field.
  21558. func (r *CreativeFieldsService) Insert(profileId int64, creativefield *CreativeField) *CreativeFieldsInsertCall {
  21559. c := &CreativeFieldsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21560. c.profileId = profileId
  21561. c.creativefield = creativefield
  21562. return c
  21563. }
  21564. // Fields allows partial responses to be retrieved. See
  21565. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21566. // for more information.
  21567. func (c *CreativeFieldsInsertCall) Fields(s ...googleapi.Field) *CreativeFieldsInsertCall {
  21568. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21569. return c
  21570. }
  21571. // Context sets the context to be used in this call's Do method. Any
  21572. // pending HTTP request will be aborted if the provided context is
  21573. // canceled.
  21574. func (c *CreativeFieldsInsertCall) Context(ctx context.Context) *CreativeFieldsInsertCall {
  21575. c.ctx_ = ctx
  21576. return c
  21577. }
  21578. // Header returns an http.Header that can be modified by the caller to
  21579. // add HTTP headers to the request.
  21580. func (c *CreativeFieldsInsertCall) Header() http.Header {
  21581. if c.header_ == nil {
  21582. c.header_ = make(http.Header)
  21583. }
  21584. return c.header_
  21585. }
  21586. func (c *CreativeFieldsInsertCall) doRequest(alt string) (*http.Response, error) {
  21587. reqHeaders := make(http.Header)
  21588. for k, v := range c.header_ {
  21589. reqHeaders[k] = v
  21590. }
  21591. reqHeaders.Set("User-Agent", c.s.userAgent())
  21592. var body io.Reader = nil
  21593. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  21594. if err != nil {
  21595. return nil, err
  21596. }
  21597. reqHeaders.Set("Content-Type", "application/json")
  21598. c.urlParams_.Set("alt", alt)
  21599. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  21600. urls += "?" + c.urlParams_.Encode()
  21601. req, _ := http.NewRequest("POST", urls, body)
  21602. req.Header = reqHeaders
  21603. googleapi.Expand(req.URL, map[string]string{
  21604. "profileId": strconv.FormatInt(c.profileId, 10),
  21605. })
  21606. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21607. }
  21608. // Do executes the "dfareporting.creativeFields.insert" call.
  21609. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  21610. // status code is an error. Response headers are in either
  21611. // *CreativeField.ServerResponse.Header or (if a response was returned
  21612. // at all) in error.(*googleapi.Error).Header. Use
  21613. // googleapi.IsNotModified to check whether the returned error was
  21614. // because http.StatusNotModified was returned.
  21615. func (c *CreativeFieldsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  21616. gensupport.SetOptions(c.urlParams_, opts...)
  21617. res, err := c.doRequest("json")
  21618. if res != nil && res.StatusCode == http.StatusNotModified {
  21619. if res.Body != nil {
  21620. res.Body.Close()
  21621. }
  21622. return nil, &googleapi.Error{
  21623. Code: res.StatusCode,
  21624. Header: res.Header,
  21625. }
  21626. }
  21627. if err != nil {
  21628. return nil, err
  21629. }
  21630. defer googleapi.CloseBody(res)
  21631. if err := googleapi.CheckResponse(res); err != nil {
  21632. return nil, err
  21633. }
  21634. ret := &CreativeField{
  21635. ServerResponse: googleapi.ServerResponse{
  21636. Header: res.Header,
  21637. HTTPStatusCode: res.StatusCode,
  21638. },
  21639. }
  21640. target := &ret
  21641. if err := gensupport.DecodeResponse(target, res); err != nil {
  21642. return nil, err
  21643. }
  21644. return ret, nil
  21645. // {
  21646. // "description": "Inserts a new creative field.",
  21647. // "httpMethod": "POST",
  21648. // "id": "dfareporting.creativeFields.insert",
  21649. // "parameterOrder": [
  21650. // "profileId"
  21651. // ],
  21652. // "parameters": {
  21653. // "profileId": {
  21654. // "description": "User profile ID associated with this request.",
  21655. // "format": "int64",
  21656. // "location": "path",
  21657. // "required": true,
  21658. // "type": "string"
  21659. // }
  21660. // },
  21661. // "path": "userprofiles/{profileId}/creativeFields",
  21662. // "request": {
  21663. // "$ref": "CreativeField"
  21664. // },
  21665. // "response": {
  21666. // "$ref": "CreativeField"
  21667. // },
  21668. // "scopes": [
  21669. // "https://www.googleapis.com/auth/dfatrafficking"
  21670. // ]
  21671. // }
  21672. }
  21673. // method id "dfareporting.creativeFields.list":
  21674. type CreativeFieldsListCall struct {
  21675. s *Service
  21676. profileId int64
  21677. urlParams_ gensupport.URLParams
  21678. ifNoneMatch_ string
  21679. ctx_ context.Context
  21680. header_ http.Header
  21681. }
  21682. // List: Retrieves a list of creative fields, possibly filtered. This
  21683. // method supports paging.
  21684. func (r *CreativeFieldsService) List(profileId int64) *CreativeFieldsListCall {
  21685. c := &CreativeFieldsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21686. c.profileId = profileId
  21687. return c
  21688. }
  21689. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  21690. // only creative fields that belong to these advertisers.
  21691. func (c *CreativeFieldsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeFieldsListCall {
  21692. var advertiserIds_ []string
  21693. for _, v := range advertiserIds {
  21694. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  21695. }
  21696. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  21697. return c
  21698. }
  21699. // Ids sets the optional parameter "ids": Select only creative fields
  21700. // with these IDs.
  21701. func (c *CreativeFieldsListCall) Ids(ids ...int64) *CreativeFieldsListCall {
  21702. var ids_ []string
  21703. for _, v := range ids {
  21704. ids_ = append(ids_, fmt.Sprint(v))
  21705. }
  21706. c.urlParams_.SetMulti("ids", ids_)
  21707. return c
  21708. }
  21709. // MaxResults sets the optional parameter "maxResults": Maximum number
  21710. // of results to return.
  21711. func (c *CreativeFieldsListCall) MaxResults(maxResults int64) *CreativeFieldsListCall {
  21712. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  21713. return c
  21714. }
  21715. // PageToken sets the optional parameter "pageToken": Value of the
  21716. // nextPageToken from the previous result page.
  21717. func (c *CreativeFieldsListCall) PageToken(pageToken string) *CreativeFieldsListCall {
  21718. c.urlParams_.Set("pageToken", pageToken)
  21719. return c
  21720. }
  21721. // SearchString sets the optional parameter "searchString": Allows
  21722. // searching for creative fields by name or ID. Wildcards (*) are
  21723. // allowed. For example, "creativefield*2015" will return creative
  21724. // fields with names like "creativefield June 2015", "creativefield
  21725. // April 2015", or simply "creativefield 2015". Most of the searches
  21726. // also add wild-cards implicitly at the start and the end of the search
  21727. // string. For example, a search string of "creativefield" will match
  21728. // creative fields with the name "my creativefield", "creativefield
  21729. // 2015", or simply "creativefield".
  21730. func (c *CreativeFieldsListCall) SearchString(searchString string) *CreativeFieldsListCall {
  21731. c.urlParams_.Set("searchString", searchString)
  21732. return c
  21733. }
  21734. // SortField sets the optional parameter "sortField": Field by which to
  21735. // sort the list.
  21736. //
  21737. // Possible values:
  21738. // "ID" (default)
  21739. // "NAME"
  21740. func (c *CreativeFieldsListCall) SortField(sortField string) *CreativeFieldsListCall {
  21741. c.urlParams_.Set("sortField", sortField)
  21742. return c
  21743. }
  21744. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  21745. // results.
  21746. //
  21747. // Possible values:
  21748. // "ASCENDING" (default)
  21749. // "DESCENDING"
  21750. func (c *CreativeFieldsListCall) SortOrder(sortOrder string) *CreativeFieldsListCall {
  21751. c.urlParams_.Set("sortOrder", sortOrder)
  21752. return c
  21753. }
  21754. // Fields allows partial responses to be retrieved. See
  21755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21756. // for more information.
  21757. func (c *CreativeFieldsListCall) Fields(s ...googleapi.Field) *CreativeFieldsListCall {
  21758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21759. return c
  21760. }
  21761. // IfNoneMatch sets the optional parameter which makes the operation
  21762. // fail if the object's ETag matches the given value. This is useful for
  21763. // getting updates only after the object has changed since the last
  21764. // request. Use googleapi.IsNotModified to check whether the response
  21765. // error from Do is the result of In-None-Match.
  21766. func (c *CreativeFieldsListCall) IfNoneMatch(entityTag string) *CreativeFieldsListCall {
  21767. c.ifNoneMatch_ = entityTag
  21768. return c
  21769. }
  21770. // Context sets the context to be used in this call's Do method. Any
  21771. // pending HTTP request will be aborted if the provided context is
  21772. // canceled.
  21773. func (c *CreativeFieldsListCall) Context(ctx context.Context) *CreativeFieldsListCall {
  21774. c.ctx_ = ctx
  21775. return c
  21776. }
  21777. // Header returns an http.Header that can be modified by the caller to
  21778. // add HTTP headers to the request.
  21779. func (c *CreativeFieldsListCall) Header() http.Header {
  21780. if c.header_ == nil {
  21781. c.header_ = make(http.Header)
  21782. }
  21783. return c.header_
  21784. }
  21785. func (c *CreativeFieldsListCall) doRequest(alt string) (*http.Response, error) {
  21786. reqHeaders := make(http.Header)
  21787. for k, v := range c.header_ {
  21788. reqHeaders[k] = v
  21789. }
  21790. reqHeaders.Set("User-Agent", c.s.userAgent())
  21791. if c.ifNoneMatch_ != "" {
  21792. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  21793. }
  21794. var body io.Reader = nil
  21795. c.urlParams_.Set("alt", alt)
  21796. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  21797. urls += "?" + c.urlParams_.Encode()
  21798. req, _ := http.NewRequest("GET", urls, body)
  21799. req.Header = reqHeaders
  21800. googleapi.Expand(req.URL, map[string]string{
  21801. "profileId": strconv.FormatInt(c.profileId, 10),
  21802. })
  21803. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  21804. }
  21805. // Do executes the "dfareporting.creativeFields.list" call.
  21806. // Exactly one of *CreativeFieldsListResponse or error will be non-nil.
  21807. // Any non-2xx status code is an error. Response headers are in either
  21808. // *CreativeFieldsListResponse.ServerResponse.Header or (if a response
  21809. // was returned at all) in error.(*googleapi.Error).Header. Use
  21810. // googleapi.IsNotModified to check whether the returned error was
  21811. // because http.StatusNotModified was returned.
  21812. func (c *CreativeFieldsListCall) Do(opts ...googleapi.CallOption) (*CreativeFieldsListResponse, error) {
  21813. gensupport.SetOptions(c.urlParams_, opts...)
  21814. res, err := c.doRequest("json")
  21815. if res != nil && res.StatusCode == http.StatusNotModified {
  21816. if res.Body != nil {
  21817. res.Body.Close()
  21818. }
  21819. return nil, &googleapi.Error{
  21820. Code: res.StatusCode,
  21821. Header: res.Header,
  21822. }
  21823. }
  21824. if err != nil {
  21825. return nil, err
  21826. }
  21827. defer googleapi.CloseBody(res)
  21828. if err := googleapi.CheckResponse(res); err != nil {
  21829. return nil, err
  21830. }
  21831. ret := &CreativeFieldsListResponse{
  21832. ServerResponse: googleapi.ServerResponse{
  21833. Header: res.Header,
  21834. HTTPStatusCode: res.StatusCode,
  21835. },
  21836. }
  21837. target := &ret
  21838. if err := gensupport.DecodeResponse(target, res); err != nil {
  21839. return nil, err
  21840. }
  21841. return ret, nil
  21842. // {
  21843. // "description": "Retrieves a list of creative fields, possibly filtered. This method supports paging.",
  21844. // "httpMethod": "GET",
  21845. // "id": "dfareporting.creativeFields.list",
  21846. // "parameterOrder": [
  21847. // "profileId"
  21848. // ],
  21849. // "parameters": {
  21850. // "advertiserIds": {
  21851. // "description": "Select only creative fields that belong to these advertisers.",
  21852. // "format": "int64",
  21853. // "location": "query",
  21854. // "repeated": true,
  21855. // "type": "string"
  21856. // },
  21857. // "ids": {
  21858. // "description": "Select only creative fields with these IDs.",
  21859. // "format": "int64",
  21860. // "location": "query",
  21861. // "repeated": true,
  21862. // "type": "string"
  21863. // },
  21864. // "maxResults": {
  21865. // "default": "1000",
  21866. // "description": "Maximum number of results to return.",
  21867. // "format": "int32",
  21868. // "location": "query",
  21869. // "maximum": "1000",
  21870. // "minimum": "0",
  21871. // "type": "integer"
  21872. // },
  21873. // "pageToken": {
  21874. // "description": "Value of the nextPageToken from the previous result page.",
  21875. // "location": "query",
  21876. // "type": "string"
  21877. // },
  21878. // "profileId": {
  21879. // "description": "User profile ID associated with this request.",
  21880. // "format": "int64",
  21881. // "location": "path",
  21882. // "required": true,
  21883. // "type": "string"
  21884. // },
  21885. // "searchString": {
  21886. // "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\".",
  21887. // "location": "query",
  21888. // "type": "string"
  21889. // },
  21890. // "sortField": {
  21891. // "default": "ID",
  21892. // "description": "Field by which to sort the list.",
  21893. // "enum": [
  21894. // "ID",
  21895. // "NAME"
  21896. // ],
  21897. // "enumDescriptions": [
  21898. // "",
  21899. // ""
  21900. // ],
  21901. // "location": "query",
  21902. // "type": "string"
  21903. // },
  21904. // "sortOrder": {
  21905. // "default": "ASCENDING",
  21906. // "description": "Order of sorted results.",
  21907. // "enum": [
  21908. // "ASCENDING",
  21909. // "DESCENDING"
  21910. // ],
  21911. // "enumDescriptions": [
  21912. // "",
  21913. // ""
  21914. // ],
  21915. // "location": "query",
  21916. // "type": "string"
  21917. // }
  21918. // },
  21919. // "path": "userprofiles/{profileId}/creativeFields",
  21920. // "response": {
  21921. // "$ref": "CreativeFieldsListResponse"
  21922. // },
  21923. // "scopes": [
  21924. // "https://www.googleapis.com/auth/dfatrafficking"
  21925. // ]
  21926. // }
  21927. }
  21928. // Pages invokes f for each page of results.
  21929. // A non-nil error returned from f will halt the iteration.
  21930. // The provided context supersedes any context provided to the Context method.
  21931. func (c *CreativeFieldsListCall) Pages(ctx context.Context, f func(*CreativeFieldsListResponse) error) error {
  21932. c.ctx_ = ctx
  21933. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  21934. for {
  21935. x, err := c.Do()
  21936. if err != nil {
  21937. return err
  21938. }
  21939. if err := f(x); err != nil {
  21940. return err
  21941. }
  21942. if x.NextPageToken == "" {
  21943. return nil
  21944. }
  21945. c.PageToken(x.NextPageToken)
  21946. }
  21947. }
  21948. // method id "dfareporting.creativeFields.patch":
  21949. type CreativeFieldsPatchCall struct {
  21950. s *Service
  21951. profileId int64
  21952. creativefield *CreativeField
  21953. urlParams_ gensupport.URLParams
  21954. ctx_ context.Context
  21955. header_ http.Header
  21956. }
  21957. // Patch: Updates an existing creative field. This method supports patch
  21958. // semantics.
  21959. func (r *CreativeFieldsService) Patch(profileId int64, id int64, creativefield *CreativeField) *CreativeFieldsPatchCall {
  21960. c := &CreativeFieldsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  21961. c.profileId = profileId
  21962. c.urlParams_.Set("id", fmt.Sprint(id))
  21963. c.creativefield = creativefield
  21964. return c
  21965. }
  21966. // Fields allows partial responses to be retrieved. See
  21967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  21968. // for more information.
  21969. func (c *CreativeFieldsPatchCall) Fields(s ...googleapi.Field) *CreativeFieldsPatchCall {
  21970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  21971. return c
  21972. }
  21973. // Context sets the context to be used in this call's Do method. Any
  21974. // pending HTTP request will be aborted if the provided context is
  21975. // canceled.
  21976. func (c *CreativeFieldsPatchCall) Context(ctx context.Context) *CreativeFieldsPatchCall {
  21977. c.ctx_ = ctx
  21978. return c
  21979. }
  21980. // Header returns an http.Header that can be modified by the caller to
  21981. // add HTTP headers to the request.
  21982. func (c *CreativeFieldsPatchCall) Header() http.Header {
  21983. if c.header_ == nil {
  21984. c.header_ = make(http.Header)
  21985. }
  21986. return c.header_
  21987. }
  21988. func (c *CreativeFieldsPatchCall) doRequest(alt string) (*http.Response, error) {
  21989. reqHeaders := make(http.Header)
  21990. for k, v := range c.header_ {
  21991. reqHeaders[k] = v
  21992. }
  21993. reqHeaders.Set("User-Agent", c.s.userAgent())
  21994. var body io.Reader = nil
  21995. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  21996. if err != nil {
  21997. return nil, err
  21998. }
  21999. reqHeaders.Set("Content-Type", "application/json")
  22000. c.urlParams_.Set("alt", alt)
  22001. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  22002. urls += "?" + c.urlParams_.Encode()
  22003. req, _ := http.NewRequest("PATCH", urls, body)
  22004. req.Header = reqHeaders
  22005. googleapi.Expand(req.URL, map[string]string{
  22006. "profileId": strconv.FormatInt(c.profileId, 10),
  22007. })
  22008. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22009. }
  22010. // Do executes the "dfareporting.creativeFields.patch" call.
  22011. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  22012. // status code is an error. Response headers are in either
  22013. // *CreativeField.ServerResponse.Header or (if a response was returned
  22014. // at all) in error.(*googleapi.Error).Header. Use
  22015. // googleapi.IsNotModified to check whether the returned error was
  22016. // because http.StatusNotModified was returned.
  22017. func (c *CreativeFieldsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  22018. gensupport.SetOptions(c.urlParams_, opts...)
  22019. res, err := c.doRequest("json")
  22020. if res != nil && res.StatusCode == http.StatusNotModified {
  22021. if res.Body != nil {
  22022. res.Body.Close()
  22023. }
  22024. return nil, &googleapi.Error{
  22025. Code: res.StatusCode,
  22026. Header: res.Header,
  22027. }
  22028. }
  22029. if err != nil {
  22030. return nil, err
  22031. }
  22032. defer googleapi.CloseBody(res)
  22033. if err := googleapi.CheckResponse(res); err != nil {
  22034. return nil, err
  22035. }
  22036. ret := &CreativeField{
  22037. ServerResponse: googleapi.ServerResponse{
  22038. Header: res.Header,
  22039. HTTPStatusCode: res.StatusCode,
  22040. },
  22041. }
  22042. target := &ret
  22043. if err := gensupport.DecodeResponse(target, res); err != nil {
  22044. return nil, err
  22045. }
  22046. return ret, nil
  22047. // {
  22048. // "description": "Updates an existing creative field. This method supports patch semantics.",
  22049. // "httpMethod": "PATCH",
  22050. // "id": "dfareporting.creativeFields.patch",
  22051. // "parameterOrder": [
  22052. // "profileId",
  22053. // "id"
  22054. // ],
  22055. // "parameters": {
  22056. // "id": {
  22057. // "description": "Creative Field ID",
  22058. // "format": "int64",
  22059. // "location": "query",
  22060. // "required": true,
  22061. // "type": "string"
  22062. // },
  22063. // "profileId": {
  22064. // "description": "User profile ID associated with this request.",
  22065. // "format": "int64",
  22066. // "location": "path",
  22067. // "required": true,
  22068. // "type": "string"
  22069. // }
  22070. // },
  22071. // "path": "userprofiles/{profileId}/creativeFields",
  22072. // "request": {
  22073. // "$ref": "CreativeField"
  22074. // },
  22075. // "response": {
  22076. // "$ref": "CreativeField"
  22077. // },
  22078. // "scopes": [
  22079. // "https://www.googleapis.com/auth/dfatrafficking"
  22080. // ]
  22081. // }
  22082. }
  22083. // method id "dfareporting.creativeFields.update":
  22084. type CreativeFieldsUpdateCall struct {
  22085. s *Service
  22086. profileId int64
  22087. creativefield *CreativeField
  22088. urlParams_ gensupport.URLParams
  22089. ctx_ context.Context
  22090. header_ http.Header
  22091. }
  22092. // Update: Updates an existing creative field.
  22093. func (r *CreativeFieldsService) Update(profileId int64, creativefield *CreativeField) *CreativeFieldsUpdateCall {
  22094. c := &CreativeFieldsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22095. c.profileId = profileId
  22096. c.creativefield = creativefield
  22097. return c
  22098. }
  22099. // Fields allows partial responses to be retrieved. See
  22100. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22101. // for more information.
  22102. func (c *CreativeFieldsUpdateCall) Fields(s ...googleapi.Field) *CreativeFieldsUpdateCall {
  22103. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22104. return c
  22105. }
  22106. // Context sets the context to be used in this call's Do method. Any
  22107. // pending HTTP request will be aborted if the provided context is
  22108. // canceled.
  22109. func (c *CreativeFieldsUpdateCall) Context(ctx context.Context) *CreativeFieldsUpdateCall {
  22110. c.ctx_ = ctx
  22111. return c
  22112. }
  22113. // Header returns an http.Header that can be modified by the caller to
  22114. // add HTTP headers to the request.
  22115. func (c *CreativeFieldsUpdateCall) Header() http.Header {
  22116. if c.header_ == nil {
  22117. c.header_ = make(http.Header)
  22118. }
  22119. return c.header_
  22120. }
  22121. func (c *CreativeFieldsUpdateCall) doRequest(alt string) (*http.Response, error) {
  22122. reqHeaders := make(http.Header)
  22123. for k, v := range c.header_ {
  22124. reqHeaders[k] = v
  22125. }
  22126. reqHeaders.Set("User-Agent", c.s.userAgent())
  22127. var body io.Reader = nil
  22128. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativefield)
  22129. if err != nil {
  22130. return nil, err
  22131. }
  22132. reqHeaders.Set("Content-Type", "application/json")
  22133. c.urlParams_.Set("alt", alt)
  22134. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeFields")
  22135. urls += "?" + c.urlParams_.Encode()
  22136. req, _ := http.NewRequest("PUT", urls, body)
  22137. req.Header = reqHeaders
  22138. googleapi.Expand(req.URL, map[string]string{
  22139. "profileId": strconv.FormatInt(c.profileId, 10),
  22140. })
  22141. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22142. }
  22143. // Do executes the "dfareporting.creativeFields.update" call.
  22144. // Exactly one of *CreativeField or error will be non-nil. Any non-2xx
  22145. // status code is an error. Response headers are in either
  22146. // *CreativeField.ServerResponse.Header or (if a response was returned
  22147. // at all) in error.(*googleapi.Error).Header. Use
  22148. // googleapi.IsNotModified to check whether the returned error was
  22149. // because http.StatusNotModified was returned.
  22150. func (c *CreativeFieldsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeField, error) {
  22151. gensupport.SetOptions(c.urlParams_, opts...)
  22152. res, err := c.doRequest("json")
  22153. if res != nil && res.StatusCode == http.StatusNotModified {
  22154. if res.Body != nil {
  22155. res.Body.Close()
  22156. }
  22157. return nil, &googleapi.Error{
  22158. Code: res.StatusCode,
  22159. Header: res.Header,
  22160. }
  22161. }
  22162. if err != nil {
  22163. return nil, err
  22164. }
  22165. defer googleapi.CloseBody(res)
  22166. if err := googleapi.CheckResponse(res); err != nil {
  22167. return nil, err
  22168. }
  22169. ret := &CreativeField{
  22170. ServerResponse: googleapi.ServerResponse{
  22171. Header: res.Header,
  22172. HTTPStatusCode: res.StatusCode,
  22173. },
  22174. }
  22175. target := &ret
  22176. if err := gensupport.DecodeResponse(target, res); err != nil {
  22177. return nil, err
  22178. }
  22179. return ret, nil
  22180. // {
  22181. // "description": "Updates an existing creative field.",
  22182. // "httpMethod": "PUT",
  22183. // "id": "dfareporting.creativeFields.update",
  22184. // "parameterOrder": [
  22185. // "profileId"
  22186. // ],
  22187. // "parameters": {
  22188. // "profileId": {
  22189. // "description": "User profile ID associated with this request.",
  22190. // "format": "int64",
  22191. // "location": "path",
  22192. // "required": true,
  22193. // "type": "string"
  22194. // }
  22195. // },
  22196. // "path": "userprofiles/{profileId}/creativeFields",
  22197. // "request": {
  22198. // "$ref": "CreativeField"
  22199. // },
  22200. // "response": {
  22201. // "$ref": "CreativeField"
  22202. // },
  22203. // "scopes": [
  22204. // "https://www.googleapis.com/auth/dfatrafficking"
  22205. // ]
  22206. // }
  22207. }
  22208. // method id "dfareporting.creativeGroups.get":
  22209. type CreativeGroupsGetCall struct {
  22210. s *Service
  22211. profileId int64
  22212. id int64
  22213. urlParams_ gensupport.URLParams
  22214. ifNoneMatch_ string
  22215. ctx_ context.Context
  22216. header_ http.Header
  22217. }
  22218. // Get: Gets one creative group by ID.
  22219. func (r *CreativeGroupsService) Get(profileId int64, id int64) *CreativeGroupsGetCall {
  22220. c := &CreativeGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22221. c.profileId = profileId
  22222. c.id = id
  22223. return c
  22224. }
  22225. // Fields allows partial responses to be retrieved. See
  22226. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22227. // for more information.
  22228. func (c *CreativeGroupsGetCall) Fields(s ...googleapi.Field) *CreativeGroupsGetCall {
  22229. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22230. return c
  22231. }
  22232. // IfNoneMatch sets the optional parameter which makes the operation
  22233. // fail if the object's ETag matches the given value. This is useful for
  22234. // getting updates only after the object has changed since the last
  22235. // request. Use googleapi.IsNotModified to check whether the response
  22236. // error from Do is the result of In-None-Match.
  22237. func (c *CreativeGroupsGetCall) IfNoneMatch(entityTag string) *CreativeGroupsGetCall {
  22238. c.ifNoneMatch_ = entityTag
  22239. return c
  22240. }
  22241. // Context sets the context to be used in this call's Do method. Any
  22242. // pending HTTP request will be aborted if the provided context is
  22243. // canceled.
  22244. func (c *CreativeGroupsGetCall) Context(ctx context.Context) *CreativeGroupsGetCall {
  22245. c.ctx_ = ctx
  22246. return c
  22247. }
  22248. // Header returns an http.Header that can be modified by the caller to
  22249. // add HTTP headers to the request.
  22250. func (c *CreativeGroupsGetCall) Header() http.Header {
  22251. if c.header_ == nil {
  22252. c.header_ = make(http.Header)
  22253. }
  22254. return c.header_
  22255. }
  22256. func (c *CreativeGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  22257. reqHeaders := make(http.Header)
  22258. for k, v := range c.header_ {
  22259. reqHeaders[k] = v
  22260. }
  22261. reqHeaders.Set("User-Agent", c.s.userAgent())
  22262. if c.ifNoneMatch_ != "" {
  22263. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22264. }
  22265. var body io.Reader = nil
  22266. c.urlParams_.Set("alt", alt)
  22267. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups/{id}")
  22268. urls += "?" + c.urlParams_.Encode()
  22269. req, _ := http.NewRequest("GET", urls, body)
  22270. req.Header = reqHeaders
  22271. googleapi.Expand(req.URL, map[string]string{
  22272. "profileId": strconv.FormatInt(c.profileId, 10),
  22273. "id": strconv.FormatInt(c.id, 10),
  22274. })
  22275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22276. }
  22277. // Do executes the "dfareporting.creativeGroups.get" call.
  22278. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  22279. // status code is an error. Response headers are in either
  22280. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  22281. // at all) in error.(*googleapi.Error).Header. Use
  22282. // googleapi.IsNotModified to check whether the returned error was
  22283. // because http.StatusNotModified was returned.
  22284. func (c *CreativeGroupsGetCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  22285. gensupport.SetOptions(c.urlParams_, opts...)
  22286. res, err := c.doRequest("json")
  22287. if res != nil && res.StatusCode == http.StatusNotModified {
  22288. if res.Body != nil {
  22289. res.Body.Close()
  22290. }
  22291. return nil, &googleapi.Error{
  22292. Code: res.StatusCode,
  22293. Header: res.Header,
  22294. }
  22295. }
  22296. if err != nil {
  22297. return nil, err
  22298. }
  22299. defer googleapi.CloseBody(res)
  22300. if err := googleapi.CheckResponse(res); err != nil {
  22301. return nil, err
  22302. }
  22303. ret := &CreativeGroup{
  22304. ServerResponse: googleapi.ServerResponse{
  22305. Header: res.Header,
  22306. HTTPStatusCode: res.StatusCode,
  22307. },
  22308. }
  22309. target := &ret
  22310. if err := gensupport.DecodeResponse(target, res); err != nil {
  22311. return nil, err
  22312. }
  22313. return ret, nil
  22314. // {
  22315. // "description": "Gets one creative group by ID.",
  22316. // "httpMethod": "GET",
  22317. // "id": "dfareporting.creativeGroups.get",
  22318. // "parameterOrder": [
  22319. // "profileId",
  22320. // "id"
  22321. // ],
  22322. // "parameters": {
  22323. // "id": {
  22324. // "description": "Creative group ID.",
  22325. // "format": "int64",
  22326. // "location": "path",
  22327. // "required": true,
  22328. // "type": "string"
  22329. // },
  22330. // "profileId": {
  22331. // "description": "User profile ID associated with this request.",
  22332. // "format": "int64",
  22333. // "location": "path",
  22334. // "required": true,
  22335. // "type": "string"
  22336. // }
  22337. // },
  22338. // "path": "userprofiles/{profileId}/creativeGroups/{id}",
  22339. // "response": {
  22340. // "$ref": "CreativeGroup"
  22341. // },
  22342. // "scopes": [
  22343. // "https://www.googleapis.com/auth/dfatrafficking"
  22344. // ]
  22345. // }
  22346. }
  22347. // method id "dfareporting.creativeGroups.insert":
  22348. type CreativeGroupsInsertCall struct {
  22349. s *Service
  22350. profileId int64
  22351. creativegroup *CreativeGroup
  22352. urlParams_ gensupport.URLParams
  22353. ctx_ context.Context
  22354. header_ http.Header
  22355. }
  22356. // Insert: Inserts a new creative group.
  22357. func (r *CreativeGroupsService) Insert(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsInsertCall {
  22358. c := &CreativeGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22359. c.profileId = profileId
  22360. c.creativegroup = creativegroup
  22361. return c
  22362. }
  22363. // Fields allows partial responses to be retrieved. See
  22364. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22365. // for more information.
  22366. func (c *CreativeGroupsInsertCall) Fields(s ...googleapi.Field) *CreativeGroupsInsertCall {
  22367. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22368. return c
  22369. }
  22370. // Context sets the context to be used in this call's Do method. Any
  22371. // pending HTTP request will be aborted if the provided context is
  22372. // canceled.
  22373. func (c *CreativeGroupsInsertCall) Context(ctx context.Context) *CreativeGroupsInsertCall {
  22374. c.ctx_ = ctx
  22375. return c
  22376. }
  22377. // Header returns an http.Header that can be modified by the caller to
  22378. // add HTTP headers to the request.
  22379. func (c *CreativeGroupsInsertCall) Header() http.Header {
  22380. if c.header_ == nil {
  22381. c.header_ = make(http.Header)
  22382. }
  22383. return c.header_
  22384. }
  22385. func (c *CreativeGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  22386. reqHeaders := make(http.Header)
  22387. for k, v := range c.header_ {
  22388. reqHeaders[k] = v
  22389. }
  22390. reqHeaders.Set("User-Agent", c.s.userAgent())
  22391. var body io.Reader = nil
  22392. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  22393. if err != nil {
  22394. return nil, err
  22395. }
  22396. reqHeaders.Set("Content-Type", "application/json")
  22397. c.urlParams_.Set("alt", alt)
  22398. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  22399. urls += "?" + c.urlParams_.Encode()
  22400. req, _ := http.NewRequest("POST", urls, body)
  22401. req.Header = reqHeaders
  22402. googleapi.Expand(req.URL, map[string]string{
  22403. "profileId": strconv.FormatInt(c.profileId, 10),
  22404. })
  22405. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22406. }
  22407. // Do executes the "dfareporting.creativeGroups.insert" call.
  22408. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  22409. // status code is an error. Response headers are in either
  22410. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  22411. // at all) in error.(*googleapi.Error).Header. Use
  22412. // googleapi.IsNotModified to check whether the returned error was
  22413. // because http.StatusNotModified was returned.
  22414. func (c *CreativeGroupsInsertCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  22415. gensupport.SetOptions(c.urlParams_, opts...)
  22416. res, err := c.doRequest("json")
  22417. if res != nil && res.StatusCode == http.StatusNotModified {
  22418. if res.Body != nil {
  22419. res.Body.Close()
  22420. }
  22421. return nil, &googleapi.Error{
  22422. Code: res.StatusCode,
  22423. Header: res.Header,
  22424. }
  22425. }
  22426. if err != nil {
  22427. return nil, err
  22428. }
  22429. defer googleapi.CloseBody(res)
  22430. if err := googleapi.CheckResponse(res); err != nil {
  22431. return nil, err
  22432. }
  22433. ret := &CreativeGroup{
  22434. ServerResponse: googleapi.ServerResponse{
  22435. Header: res.Header,
  22436. HTTPStatusCode: res.StatusCode,
  22437. },
  22438. }
  22439. target := &ret
  22440. if err := gensupport.DecodeResponse(target, res); err != nil {
  22441. return nil, err
  22442. }
  22443. return ret, nil
  22444. // {
  22445. // "description": "Inserts a new creative group.",
  22446. // "httpMethod": "POST",
  22447. // "id": "dfareporting.creativeGroups.insert",
  22448. // "parameterOrder": [
  22449. // "profileId"
  22450. // ],
  22451. // "parameters": {
  22452. // "profileId": {
  22453. // "description": "User profile ID associated with this request.",
  22454. // "format": "int64",
  22455. // "location": "path",
  22456. // "required": true,
  22457. // "type": "string"
  22458. // }
  22459. // },
  22460. // "path": "userprofiles/{profileId}/creativeGroups",
  22461. // "request": {
  22462. // "$ref": "CreativeGroup"
  22463. // },
  22464. // "response": {
  22465. // "$ref": "CreativeGroup"
  22466. // },
  22467. // "scopes": [
  22468. // "https://www.googleapis.com/auth/dfatrafficking"
  22469. // ]
  22470. // }
  22471. }
  22472. // method id "dfareporting.creativeGroups.list":
  22473. type CreativeGroupsListCall struct {
  22474. s *Service
  22475. profileId int64
  22476. urlParams_ gensupport.URLParams
  22477. ifNoneMatch_ string
  22478. ctx_ context.Context
  22479. header_ http.Header
  22480. }
  22481. // List: Retrieves a list of creative groups, possibly filtered. This
  22482. // method supports paging.
  22483. func (r *CreativeGroupsService) List(profileId int64) *CreativeGroupsListCall {
  22484. c := &CreativeGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22485. c.profileId = profileId
  22486. return c
  22487. }
  22488. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  22489. // only creative groups that belong to these advertisers.
  22490. func (c *CreativeGroupsListCall) AdvertiserIds(advertiserIds ...int64) *CreativeGroupsListCall {
  22491. var advertiserIds_ []string
  22492. for _, v := range advertiserIds {
  22493. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  22494. }
  22495. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  22496. return c
  22497. }
  22498. // GroupNumber sets the optional parameter "groupNumber": Select only
  22499. // creative groups that belong to this subgroup.
  22500. func (c *CreativeGroupsListCall) GroupNumber(groupNumber int64) *CreativeGroupsListCall {
  22501. c.urlParams_.Set("groupNumber", fmt.Sprint(groupNumber))
  22502. return c
  22503. }
  22504. // Ids sets the optional parameter "ids": Select only creative groups
  22505. // with these IDs.
  22506. func (c *CreativeGroupsListCall) Ids(ids ...int64) *CreativeGroupsListCall {
  22507. var ids_ []string
  22508. for _, v := range ids {
  22509. ids_ = append(ids_, fmt.Sprint(v))
  22510. }
  22511. c.urlParams_.SetMulti("ids", ids_)
  22512. return c
  22513. }
  22514. // MaxResults sets the optional parameter "maxResults": Maximum number
  22515. // of results to return.
  22516. func (c *CreativeGroupsListCall) MaxResults(maxResults int64) *CreativeGroupsListCall {
  22517. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  22518. return c
  22519. }
  22520. // PageToken sets the optional parameter "pageToken": Value of the
  22521. // nextPageToken from the previous result page.
  22522. func (c *CreativeGroupsListCall) PageToken(pageToken string) *CreativeGroupsListCall {
  22523. c.urlParams_.Set("pageToken", pageToken)
  22524. return c
  22525. }
  22526. // SearchString sets the optional parameter "searchString": Allows
  22527. // searching for creative groups by name or ID. Wildcards (*) are
  22528. // allowed. For example, "creativegroup*2015" will return creative
  22529. // groups with names like "creativegroup June 2015", "creativegroup
  22530. // April 2015", or simply "creativegroup 2015". Most of the searches
  22531. // also add wild-cards implicitly at the start and the end of the search
  22532. // string. For example, a search string of "creativegroup" will match
  22533. // creative groups with the name "my creativegroup", "creativegroup
  22534. // 2015", or simply "creativegroup".
  22535. func (c *CreativeGroupsListCall) SearchString(searchString string) *CreativeGroupsListCall {
  22536. c.urlParams_.Set("searchString", searchString)
  22537. return c
  22538. }
  22539. // SortField sets the optional parameter "sortField": Field by which to
  22540. // sort the list.
  22541. //
  22542. // Possible values:
  22543. // "ID" (default)
  22544. // "NAME"
  22545. func (c *CreativeGroupsListCall) SortField(sortField string) *CreativeGroupsListCall {
  22546. c.urlParams_.Set("sortField", sortField)
  22547. return c
  22548. }
  22549. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  22550. // results.
  22551. //
  22552. // Possible values:
  22553. // "ASCENDING" (default)
  22554. // "DESCENDING"
  22555. func (c *CreativeGroupsListCall) SortOrder(sortOrder string) *CreativeGroupsListCall {
  22556. c.urlParams_.Set("sortOrder", sortOrder)
  22557. return c
  22558. }
  22559. // Fields allows partial responses to be retrieved. See
  22560. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22561. // for more information.
  22562. func (c *CreativeGroupsListCall) Fields(s ...googleapi.Field) *CreativeGroupsListCall {
  22563. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22564. return c
  22565. }
  22566. // IfNoneMatch sets the optional parameter which makes the operation
  22567. // fail if the object's ETag matches the given value. This is useful for
  22568. // getting updates only after the object has changed since the last
  22569. // request. Use googleapi.IsNotModified to check whether the response
  22570. // error from Do is the result of In-None-Match.
  22571. func (c *CreativeGroupsListCall) IfNoneMatch(entityTag string) *CreativeGroupsListCall {
  22572. c.ifNoneMatch_ = entityTag
  22573. return c
  22574. }
  22575. // Context sets the context to be used in this call's Do method. Any
  22576. // pending HTTP request will be aborted if the provided context is
  22577. // canceled.
  22578. func (c *CreativeGroupsListCall) Context(ctx context.Context) *CreativeGroupsListCall {
  22579. c.ctx_ = ctx
  22580. return c
  22581. }
  22582. // Header returns an http.Header that can be modified by the caller to
  22583. // add HTTP headers to the request.
  22584. func (c *CreativeGroupsListCall) Header() http.Header {
  22585. if c.header_ == nil {
  22586. c.header_ = make(http.Header)
  22587. }
  22588. return c.header_
  22589. }
  22590. func (c *CreativeGroupsListCall) doRequest(alt string) (*http.Response, error) {
  22591. reqHeaders := make(http.Header)
  22592. for k, v := range c.header_ {
  22593. reqHeaders[k] = v
  22594. }
  22595. reqHeaders.Set("User-Agent", c.s.userAgent())
  22596. if c.ifNoneMatch_ != "" {
  22597. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  22598. }
  22599. var body io.Reader = nil
  22600. c.urlParams_.Set("alt", alt)
  22601. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  22602. urls += "?" + c.urlParams_.Encode()
  22603. req, _ := http.NewRequest("GET", urls, body)
  22604. req.Header = reqHeaders
  22605. googleapi.Expand(req.URL, map[string]string{
  22606. "profileId": strconv.FormatInt(c.profileId, 10),
  22607. })
  22608. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22609. }
  22610. // Do executes the "dfareporting.creativeGroups.list" call.
  22611. // Exactly one of *CreativeGroupsListResponse or error will be non-nil.
  22612. // Any non-2xx status code is an error. Response headers are in either
  22613. // *CreativeGroupsListResponse.ServerResponse.Header or (if a response
  22614. // was returned at all) in error.(*googleapi.Error).Header. Use
  22615. // googleapi.IsNotModified to check whether the returned error was
  22616. // because http.StatusNotModified was returned.
  22617. func (c *CreativeGroupsListCall) Do(opts ...googleapi.CallOption) (*CreativeGroupsListResponse, error) {
  22618. gensupport.SetOptions(c.urlParams_, opts...)
  22619. res, err := c.doRequest("json")
  22620. if res != nil && res.StatusCode == http.StatusNotModified {
  22621. if res.Body != nil {
  22622. res.Body.Close()
  22623. }
  22624. return nil, &googleapi.Error{
  22625. Code: res.StatusCode,
  22626. Header: res.Header,
  22627. }
  22628. }
  22629. if err != nil {
  22630. return nil, err
  22631. }
  22632. defer googleapi.CloseBody(res)
  22633. if err := googleapi.CheckResponse(res); err != nil {
  22634. return nil, err
  22635. }
  22636. ret := &CreativeGroupsListResponse{
  22637. ServerResponse: googleapi.ServerResponse{
  22638. Header: res.Header,
  22639. HTTPStatusCode: res.StatusCode,
  22640. },
  22641. }
  22642. target := &ret
  22643. if err := gensupport.DecodeResponse(target, res); err != nil {
  22644. return nil, err
  22645. }
  22646. return ret, nil
  22647. // {
  22648. // "description": "Retrieves a list of creative groups, possibly filtered. This method supports paging.",
  22649. // "httpMethod": "GET",
  22650. // "id": "dfareporting.creativeGroups.list",
  22651. // "parameterOrder": [
  22652. // "profileId"
  22653. // ],
  22654. // "parameters": {
  22655. // "advertiserIds": {
  22656. // "description": "Select only creative groups that belong to these advertisers.",
  22657. // "format": "int64",
  22658. // "location": "query",
  22659. // "repeated": true,
  22660. // "type": "string"
  22661. // },
  22662. // "groupNumber": {
  22663. // "description": "Select only creative groups that belong to this subgroup.",
  22664. // "format": "int32",
  22665. // "location": "query",
  22666. // "maximum": "2",
  22667. // "minimum": "1",
  22668. // "type": "integer"
  22669. // },
  22670. // "ids": {
  22671. // "description": "Select only creative groups with these IDs.",
  22672. // "format": "int64",
  22673. // "location": "query",
  22674. // "repeated": true,
  22675. // "type": "string"
  22676. // },
  22677. // "maxResults": {
  22678. // "default": "1000",
  22679. // "description": "Maximum number of results to return.",
  22680. // "format": "int32",
  22681. // "location": "query",
  22682. // "maximum": "1000",
  22683. // "minimum": "0",
  22684. // "type": "integer"
  22685. // },
  22686. // "pageToken": {
  22687. // "description": "Value of the nextPageToken from the previous result page.",
  22688. // "location": "query",
  22689. // "type": "string"
  22690. // },
  22691. // "profileId": {
  22692. // "description": "User profile ID associated with this request.",
  22693. // "format": "int64",
  22694. // "location": "path",
  22695. // "required": true,
  22696. // "type": "string"
  22697. // },
  22698. // "searchString": {
  22699. // "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\".",
  22700. // "location": "query",
  22701. // "type": "string"
  22702. // },
  22703. // "sortField": {
  22704. // "default": "ID",
  22705. // "description": "Field by which to sort the list.",
  22706. // "enum": [
  22707. // "ID",
  22708. // "NAME"
  22709. // ],
  22710. // "enumDescriptions": [
  22711. // "",
  22712. // ""
  22713. // ],
  22714. // "location": "query",
  22715. // "type": "string"
  22716. // },
  22717. // "sortOrder": {
  22718. // "default": "ASCENDING",
  22719. // "description": "Order of sorted results.",
  22720. // "enum": [
  22721. // "ASCENDING",
  22722. // "DESCENDING"
  22723. // ],
  22724. // "enumDescriptions": [
  22725. // "",
  22726. // ""
  22727. // ],
  22728. // "location": "query",
  22729. // "type": "string"
  22730. // }
  22731. // },
  22732. // "path": "userprofiles/{profileId}/creativeGroups",
  22733. // "response": {
  22734. // "$ref": "CreativeGroupsListResponse"
  22735. // },
  22736. // "scopes": [
  22737. // "https://www.googleapis.com/auth/dfatrafficking"
  22738. // ]
  22739. // }
  22740. }
  22741. // Pages invokes f for each page of results.
  22742. // A non-nil error returned from f will halt the iteration.
  22743. // The provided context supersedes any context provided to the Context method.
  22744. func (c *CreativeGroupsListCall) Pages(ctx context.Context, f func(*CreativeGroupsListResponse) error) error {
  22745. c.ctx_ = ctx
  22746. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  22747. for {
  22748. x, err := c.Do()
  22749. if err != nil {
  22750. return err
  22751. }
  22752. if err := f(x); err != nil {
  22753. return err
  22754. }
  22755. if x.NextPageToken == "" {
  22756. return nil
  22757. }
  22758. c.PageToken(x.NextPageToken)
  22759. }
  22760. }
  22761. // method id "dfareporting.creativeGroups.patch":
  22762. type CreativeGroupsPatchCall struct {
  22763. s *Service
  22764. profileId int64
  22765. creativegroup *CreativeGroup
  22766. urlParams_ gensupport.URLParams
  22767. ctx_ context.Context
  22768. header_ http.Header
  22769. }
  22770. // Patch: Updates an existing creative group. This method supports patch
  22771. // semantics.
  22772. func (r *CreativeGroupsService) Patch(profileId int64, id int64, creativegroup *CreativeGroup) *CreativeGroupsPatchCall {
  22773. c := &CreativeGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22774. c.profileId = profileId
  22775. c.urlParams_.Set("id", fmt.Sprint(id))
  22776. c.creativegroup = creativegroup
  22777. return c
  22778. }
  22779. // Fields allows partial responses to be retrieved. See
  22780. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22781. // for more information.
  22782. func (c *CreativeGroupsPatchCall) Fields(s ...googleapi.Field) *CreativeGroupsPatchCall {
  22783. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22784. return c
  22785. }
  22786. // Context sets the context to be used in this call's Do method. Any
  22787. // pending HTTP request will be aborted if the provided context is
  22788. // canceled.
  22789. func (c *CreativeGroupsPatchCall) Context(ctx context.Context) *CreativeGroupsPatchCall {
  22790. c.ctx_ = ctx
  22791. return c
  22792. }
  22793. // Header returns an http.Header that can be modified by the caller to
  22794. // add HTTP headers to the request.
  22795. func (c *CreativeGroupsPatchCall) Header() http.Header {
  22796. if c.header_ == nil {
  22797. c.header_ = make(http.Header)
  22798. }
  22799. return c.header_
  22800. }
  22801. func (c *CreativeGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  22802. reqHeaders := make(http.Header)
  22803. for k, v := range c.header_ {
  22804. reqHeaders[k] = v
  22805. }
  22806. reqHeaders.Set("User-Agent", c.s.userAgent())
  22807. var body io.Reader = nil
  22808. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  22809. if err != nil {
  22810. return nil, err
  22811. }
  22812. reqHeaders.Set("Content-Type", "application/json")
  22813. c.urlParams_.Set("alt", alt)
  22814. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  22815. urls += "?" + c.urlParams_.Encode()
  22816. req, _ := http.NewRequest("PATCH", urls, body)
  22817. req.Header = reqHeaders
  22818. googleapi.Expand(req.URL, map[string]string{
  22819. "profileId": strconv.FormatInt(c.profileId, 10),
  22820. })
  22821. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22822. }
  22823. // Do executes the "dfareporting.creativeGroups.patch" call.
  22824. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  22825. // status code is an error. Response headers are in either
  22826. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  22827. // at all) in error.(*googleapi.Error).Header. Use
  22828. // googleapi.IsNotModified to check whether the returned error was
  22829. // because http.StatusNotModified was returned.
  22830. func (c *CreativeGroupsPatchCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  22831. gensupport.SetOptions(c.urlParams_, opts...)
  22832. res, err := c.doRequest("json")
  22833. if res != nil && res.StatusCode == http.StatusNotModified {
  22834. if res.Body != nil {
  22835. res.Body.Close()
  22836. }
  22837. return nil, &googleapi.Error{
  22838. Code: res.StatusCode,
  22839. Header: res.Header,
  22840. }
  22841. }
  22842. if err != nil {
  22843. return nil, err
  22844. }
  22845. defer googleapi.CloseBody(res)
  22846. if err := googleapi.CheckResponse(res); err != nil {
  22847. return nil, err
  22848. }
  22849. ret := &CreativeGroup{
  22850. ServerResponse: googleapi.ServerResponse{
  22851. Header: res.Header,
  22852. HTTPStatusCode: res.StatusCode,
  22853. },
  22854. }
  22855. target := &ret
  22856. if err := gensupport.DecodeResponse(target, res); err != nil {
  22857. return nil, err
  22858. }
  22859. return ret, nil
  22860. // {
  22861. // "description": "Updates an existing creative group. This method supports patch semantics.",
  22862. // "httpMethod": "PATCH",
  22863. // "id": "dfareporting.creativeGroups.patch",
  22864. // "parameterOrder": [
  22865. // "profileId",
  22866. // "id"
  22867. // ],
  22868. // "parameters": {
  22869. // "id": {
  22870. // "description": "Creative group ID.",
  22871. // "format": "int64",
  22872. // "location": "query",
  22873. // "required": true,
  22874. // "type": "string"
  22875. // },
  22876. // "profileId": {
  22877. // "description": "User profile ID associated with this request.",
  22878. // "format": "int64",
  22879. // "location": "path",
  22880. // "required": true,
  22881. // "type": "string"
  22882. // }
  22883. // },
  22884. // "path": "userprofiles/{profileId}/creativeGroups",
  22885. // "request": {
  22886. // "$ref": "CreativeGroup"
  22887. // },
  22888. // "response": {
  22889. // "$ref": "CreativeGroup"
  22890. // },
  22891. // "scopes": [
  22892. // "https://www.googleapis.com/auth/dfatrafficking"
  22893. // ]
  22894. // }
  22895. }
  22896. // method id "dfareporting.creativeGroups.update":
  22897. type CreativeGroupsUpdateCall struct {
  22898. s *Service
  22899. profileId int64
  22900. creativegroup *CreativeGroup
  22901. urlParams_ gensupport.URLParams
  22902. ctx_ context.Context
  22903. header_ http.Header
  22904. }
  22905. // Update: Updates an existing creative group.
  22906. func (r *CreativeGroupsService) Update(profileId int64, creativegroup *CreativeGroup) *CreativeGroupsUpdateCall {
  22907. c := &CreativeGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  22908. c.profileId = profileId
  22909. c.creativegroup = creativegroup
  22910. return c
  22911. }
  22912. // Fields allows partial responses to be retrieved. See
  22913. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  22914. // for more information.
  22915. func (c *CreativeGroupsUpdateCall) Fields(s ...googleapi.Field) *CreativeGroupsUpdateCall {
  22916. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  22917. return c
  22918. }
  22919. // Context sets the context to be used in this call's Do method. Any
  22920. // pending HTTP request will be aborted if the provided context is
  22921. // canceled.
  22922. func (c *CreativeGroupsUpdateCall) Context(ctx context.Context) *CreativeGroupsUpdateCall {
  22923. c.ctx_ = ctx
  22924. return c
  22925. }
  22926. // Header returns an http.Header that can be modified by the caller to
  22927. // add HTTP headers to the request.
  22928. func (c *CreativeGroupsUpdateCall) Header() http.Header {
  22929. if c.header_ == nil {
  22930. c.header_ = make(http.Header)
  22931. }
  22932. return c.header_
  22933. }
  22934. func (c *CreativeGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  22935. reqHeaders := make(http.Header)
  22936. for k, v := range c.header_ {
  22937. reqHeaders[k] = v
  22938. }
  22939. reqHeaders.Set("User-Agent", c.s.userAgent())
  22940. var body io.Reader = nil
  22941. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creativegroup)
  22942. if err != nil {
  22943. return nil, err
  22944. }
  22945. reqHeaders.Set("Content-Type", "application/json")
  22946. c.urlParams_.Set("alt", alt)
  22947. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creativeGroups")
  22948. urls += "?" + c.urlParams_.Encode()
  22949. req, _ := http.NewRequest("PUT", urls, body)
  22950. req.Header = reqHeaders
  22951. googleapi.Expand(req.URL, map[string]string{
  22952. "profileId": strconv.FormatInt(c.profileId, 10),
  22953. })
  22954. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  22955. }
  22956. // Do executes the "dfareporting.creativeGroups.update" call.
  22957. // Exactly one of *CreativeGroup or error will be non-nil. Any non-2xx
  22958. // status code is an error. Response headers are in either
  22959. // *CreativeGroup.ServerResponse.Header or (if a response was returned
  22960. // at all) in error.(*googleapi.Error).Header. Use
  22961. // googleapi.IsNotModified to check whether the returned error was
  22962. // because http.StatusNotModified was returned.
  22963. func (c *CreativeGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*CreativeGroup, error) {
  22964. gensupport.SetOptions(c.urlParams_, opts...)
  22965. res, err := c.doRequest("json")
  22966. if res != nil && res.StatusCode == http.StatusNotModified {
  22967. if res.Body != nil {
  22968. res.Body.Close()
  22969. }
  22970. return nil, &googleapi.Error{
  22971. Code: res.StatusCode,
  22972. Header: res.Header,
  22973. }
  22974. }
  22975. if err != nil {
  22976. return nil, err
  22977. }
  22978. defer googleapi.CloseBody(res)
  22979. if err := googleapi.CheckResponse(res); err != nil {
  22980. return nil, err
  22981. }
  22982. ret := &CreativeGroup{
  22983. ServerResponse: googleapi.ServerResponse{
  22984. Header: res.Header,
  22985. HTTPStatusCode: res.StatusCode,
  22986. },
  22987. }
  22988. target := &ret
  22989. if err := gensupport.DecodeResponse(target, res); err != nil {
  22990. return nil, err
  22991. }
  22992. return ret, nil
  22993. // {
  22994. // "description": "Updates an existing creative group.",
  22995. // "httpMethod": "PUT",
  22996. // "id": "dfareporting.creativeGroups.update",
  22997. // "parameterOrder": [
  22998. // "profileId"
  22999. // ],
  23000. // "parameters": {
  23001. // "profileId": {
  23002. // "description": "User profile ID associated with this request.",
  23003. // "format": "int64",
  23004. // "location": "path",
  23005. // "required": true,
  23006. // "type": "string"
  23007. // }
  23008. // },
  23009. // "path": "userprofiles/{profileId}/creativeGroups",
  23010. // "request": {
  23011. // "$ref": "CreativeGroup"
  23012. // },
  23013. // "response": {
  23014. // "$ref": "CreativeGroup"
  23015. // },
  23016. // "scopes": [
  23017. // "https://www.googleapis.com/auth/dfatrafficking"
  23018. // ]
  23019. // }
  23020. }
  23021. // method id "dfareporting.creatives.get":
  23022. type CreativesGetCall struct {
  23023. s *Service
  23024. profileId int64
  23025. id int64
  23026. urlParams_ gensupport.URLParams
  23027. ifNoneMatch_ string
  23028. ctx_ context.Context
  23029. header_ http.Header
  23030. }
  23031. // Get: Gets one creative by ID.
  23032. func (r *CreativesService) Get(profileId int64, id int64) *CreativesGetCall {
  23033. c := &CreativesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23034. c.profileId = profileId
  23035. c.id = id
  23036. return c
  23037. }
  23038. // Fields allows partial responses to be retrieved. See
  23039. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23040. // for more information.
  23041. func (c *CreativesGetCall) Fields(s ...googleapi.Field) *CreativesGetCall {
  23042. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23043. return c
  23044. }
  23045. // IfNoneMatch sets the optional parameter which makes the operation
  23046. // fail if the object's ETag matches the given value. This is useful for
  23047. // getting updates only after the object has changed since the last
  23048. // request. Use googleapi.IsNotModified to check whether the response
  23049. // error from Do is the result of In-None-Match.
  23050. func (c *CreativesGetCall) IfNoneMatch(entityTag string) *CreativesGetCall {
  23051. c.ifNoneMatch_ = entityTag
  23052. return c
  23053. }
  23054. // Context sets the context to be used in this call's Do method. Any
  23055. // pending HTTP request will be aborted if the provided context is
  23056. // canceled.
  23057. func (c *CreativesGetCall) Context(ctx context.Context) *CreativesGetCall {
  23058. c.ctx_ = ctx
  23059. return c
  23060. }
  23061. // Header returns an http.Header that can be modified by the caller to
  23062. // add HTTP headers to the request.
  23063. func (c *CreativesGetCall) Header() http.Header {
  23064. if c.header_ == nil {
  23065. c.header_ = make(http.Header)
  23066. }
  23067. return c.header_
  23068. }
  23069. func (c *CreativesGetCall) doRequest(alt string) (*http.Response, error) {
  23070. reqHeaders := make(http.Header)
  23071. for k, v := range c.header_ {
  23072. reqHeaders[k] = v
  23073. }
  23074. reqHeaders.Set("User-Agent", c.s.userAgent())
  23075. if c.ifNoneMatch_ != "" {
  23076. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23077. }
  23078. var body io.Reader = nil
  23079. c.urlParams_.Set("alt", alt)
  23080. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives/{id}")
  23081. urls += "?" + c.urlParams_.Encode()
  23082. req, _ := http.NewRequest("GET", urls, body)
  23083. req.Header = reqHeaders
  23084. googleapi.Expand(req.URL, map[string]string{
  23085. "profileId": strconv.FormatInt(c.profileId, 10),
  23086. "id": strconv.FormatInt(c.id, 10),
  23087. })
  23088. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23089. }
  23090. // Do executes the "dfareporting.creatives.get" call.
  23091. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  23092. // code is an error. Response headers are in either
  23093. // *Creative.ServerResponse.Header or (if a response was returned at
  23094. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23095. // to check whether the returned error was because
  23096. // http.StatusNotModified was returned.
  23097. func (c *CreativesGetCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  23098. gensupport.SetOptions(c.urlParams_, opts...)
  23099. res, err := c.doRequest("json")
  23100. if res != nil && res.StatusCode == http.StatusNotModified {
  23101. if res.Body != nil {
  23102. res.Body.Close()
  23103. }
  23104. return nil, &googleapi.Error{
  23105. Code: res.StatusCode,
  23106. Header: res.Header,
  23107. }
  23108. }
  23109. if err != nil {
  23110. return nil, err
  23111. }
  23112. defer googleapi.CloseBody(res)
  23113. if err := googleapi.CheckResponse(res); err != nil {
  23114. return nil, err
  23115. }
  23116. ret := &Creative{
  23117. ServerResponse: googleapi.ServerResponse{
  23118. Header: res.Header,
  23119. HTTPStatusCode: res.StatusCode,
  23120. },
  23121. }
  23122. target := &ret
  23123. if err := gensupport.DecodeResponse(target, res); err != nil {
  23124. return nil, err
  23125. }
  23126. return ret, nil
  23127. // {
  23128. // "description": "Gets one creative by ID.",
  23129. // "httpMethod": "GET",
  23130. // "id": "dfareporting.creatives.get",
  23131. // "parameterOrder": [
  23132. // "profileId",
  23133. // "id"
  23134. // ],
  23135. // "parameters": {
  23136. // "id": {
  23137. // "description": "Creative ID.",
  23138. // "format": "int64",
  23139. // "location": "path",
  23140. // "required": true,
  23141. // "type": "string"
  23142. // },
  23143. // "profileId": {
  23144. // "description": "User profile ID associated with this request.",
  23145. // "format": "int64",
  23146. // "location": "path",
  23147. // "required": true,
  23148. // "type": "string"
  23149. // }
  23150. // },
  23151. // "path": "userprofiles/{profileId}/creatives/{id}",
  23152. // "response": {
  23153. // "$ref": "Creative"
  23154. // },
  23155. // "scopes": [
  23156. // "https://www.googleapis.com/auth/dfatrafficking"
  23157. // ]
  23158. // }
  23159. }
  23160. // method id "dfareporting.creatives.insert":
  23161. type CreativesInsertCall struct {
  23162. s *Service
  23163. profileId int64
  23164. creative *Creative
  23165. urlParams_ gensupport.URLParams
  23166. ctx_ context.Context
  23167. header_ http.Header
  23168. }
  23169. // Insert: Inserts a new creative.
  23170. func (r *CreativesService) Insert(profileId int64, creative *Creative) *CreativesInsertCall {
  23171. c := &CreativesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23172. c.profileId = profileId
  23173. c.creative = creative
  23174. return c
  23175. }
  23176. // Fields allows partial responses to be retrieved. See
  23177. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23178. // for more information.
  23179. func (c *CreativesInsertCall) Fields(s ...googleapi.Field) *CreativesInsertCall {
  23180. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23181. return c
  23182. }
  23183. // Context sets the context to be used in this call's Do method. Any
  23184. // pending HTTP request will be aborted if the provided context is
  23185. // canceled.
  23186. func (c *CreativesInsertCall) Context(ctx context.Context) *CreativesInsertCall {
  23187. c.ctx_ = ctx
  23188. return c
  23189. }
  23190. // Header returns an http.Header that can be modified by the caller to
  23191. // add HTTP headers to the request.
  23192. func (c *CreativesInsertCall) Header() http.Header {
  23193. if c.header_ == nil {
  23194. c.header_ = make(http.Header)
  23195. }
  23196. return c.header_
  23197. }
  23198. func (c *CreativesInsertCall) doRequest(alt string) (*http.Response, error) {
  23199. reqHeaders := make(http.Header)
  23200. for k, v := range c.header_ {
  23201. reqHeaders[k] = v
  23202. }
  23203. reqHeaders.Set("User-Agent", c.s.userAgent())
  23204. var body io.Reader = nil
  23205. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  23206. if err != nil {
  23207. return nil, err
  23208. }
  23209. reqHeaders.Set("Content-Type", "application/json")
  23210. c.urlParams_.Set("alt", alt)
  23211. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  23212. urls += "?" + c.urlParams_.Encode()
  23213. req, _ := http.NewRequest("POST", urls, body)
  23214. req.Header = reqHeaders
  23215. googleapi.Expand(req.URL, map[string]string{
  23216. "profileId": strconv.FormatInt(c.profileId, 10),
  23217. })
  23218. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23219. }
  23220. // Do executes the "dfareporting.creatives.insert" call.
  23221. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  23222. // code is an error. Response headers are in either
  23223. // *Creative.ServerResponse.Header or (if a response was returned at
  23224. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23225. // to check whether the returned error was because
  23226. // http.StatusNotModified was returned.
  23227. func (c *CreativesInsertCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  23228. gensupport.SetOptions(c.urlParams_, opts...)
  23229. res, err := c.doRequest("json")
  23230. if res != nil && res.StatusCode == http.StatusNotModified {
  23231. if res.Body != nil {
  23232. res.Body.Close()
  23233. }
  23234. return nil, &googleapi.Error{
  23235. Code: res.StatusCode,
  23236. Header: res.Header,
  23237. }
  23238. }
  23239. if err != nil {
  23240. return nil, err
  23241. }
  23242. defer googleapi.CloseBody(res)
  23243. if err := googleapi.CheckResponse(res); err != nil {
  23244. return nil, err
  23245. }
  23246. ret := &Creative{
  23247. ServerResponse: googleapi.ServerResponse{
  23248. Header: res.Header,
  23249. HTTPStatusCode: res.StatusCode,
  23250. },
  23251. }
  23252. target := &ret
  23253. if err := gensupport.DecodeResponse(target, res); err != nil {
  23254. return nil, err
  23255. }
  23256. return ret, nil
  23257. // {
  23258. // "description": "Inserts a new creative.",
  23259. // "httpMethod": "POST",
  23260. // "id": "dfareporting.creatives.insert",
  23261. // "parameterOrder": [
  23262. // "profileId"
  23263. // ],
  23264. // "parameters": {
  23265. // "profileId": {
  23266. // "description": "User profile ID associated with this request.",
  23267. // "format": "int64",
  23268. // "location": "path",
  23269. // "required": true,
  23270. // "type": "string"
  23271. // }
  23272. // },
  23273. // "path": "userprofiles/{profileId}/creatives",
  23274. // "request": {
  23275. // "$ref": "Creative"
  23276. // },
  23277. // "response": {
  23278. // "$ref": "Creative"
  23279. // },
  23280. // "scopes": [
  23281. // "https://www.googleapis.com/auth/dfatrafficking"
  23282. // ]
  23283. // }
  23284. }
  23285. // method id "dfareporting.creatives.list":
  23286. type CreativesListCall struct {
  23287. s *Service
  23288. profileId int64
  23289. urlParams_ gensupport.URLParams
  23290. ifNoneMatch_ string
  23291. ctx_ context.Context
  23292. header_ http.Header
  23293. }
  23294. // List: Retrieves a list of creatives, possibly filtered. This method
  23295. // supports paging.
  23296. func (r *CreativesService) List(profileId int64) *CreativesListCall {
  23297. c := &CreativesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23298. c.profileId = profileId
  23299. return c
  23300. }
  23301. // Active sets the optional parameter "active": Select only active
  23302. // creatives. Leave blank to select active and inactive creatives.
  23303. func (c *CreativesListCall) Active(active bool) *CreativesListCall {
  23304. c.urlParams_.Set("active", fmt.Sprint(active))
  23305. return c
  23306. }
  23307. // AdvertiserId sets the optional parameter "advertiserId": Select only
  23308. // creatives with this advertiser ID.
  23309. func (c *CreativesListCall) AdvertiserId(advertiserId int64) *CreativesListCall {
  23310. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  23311. return c
  23312. }
  23313. // Archived sets the optional parameter "archived": Select only archived
  23314. // creatives. Leave blank to select archived and unarchived creatives.
  23315. func (c *CreativesListCall) Archived(archived bool) *CreativesListCall {
  23316. c.urlParams_.Set("archived", fmt.Sprint(archived))
  23317. return c
  23318. }
  23319. // CampaignId sets the optional parameter "campaignId": Select only
  23320. // creatives with this campaign ID.
  23321. func (c *CreativesListCall) CampaignId(campaignId int64) *CreativesListCall {
  23322. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  23323. return c
  23324. }
  23325. // CompanionCreativeIds sets the optional parameter
  23326. // "companionCreativeIds": Select only in-stream video creatives with
  23327. // these companion IDs.
  23328. func (c *CreativesListCall) CompanionCreativeIds(companionCreativeIds ...int64) *CreativesListCall {
  23329. var companionCreativeIds_ []string
  23330. for _, v := range companionCreativeIds {
  23331. companionCreativeIds_ = append(companionCreativeIds_, fmt.Sprint(v))
  23332. }
  23333. c.urlParams_.SetMulti("companionCreativeIds", companionCreativeIds_)
  23334. return c
  23335. }
  23336. // CreativeFieldIds sets the optional parameter "creativeFieldIds":
  23337. // Select only creatives with these creative field IDs.
  23338. func (c *CreativesListCall) CreativeFieldIds(creativeFieldIds ...int64) *CreativesListCall {
  23339. var creativeFieldIds_ []string
  23340. for _, v := range creativeFieldIds {
  23341. creativeFieldIds_ = append(creativeFieldIds_, fmt.Sprint(v))
  23342. }
  23343. c.urlParams_.SetMulti("creativeFieldIds", creativeFieldIds_)
  23344. return c
  23345. }
  23346. // Ids sets the optional parameter "ids": Select only creatives with
  23347. // these IDs.
  23348. func (c *CreativesListCall) Ids(ids ...int64) *CreativesListCall {
  23349. var ids_ []string
  23350. for _, v := range ids {
  23351. ids_ = append(ids_, fmt.Sprint(v))
  23352. }
  23353. c.urlParams_.SetMulti("ids", ids_)
  23354. return c
  23355. }
  23356. // MaxResults sets the optional parameter "maxResults": Maximum number
  23357. // of results to return.
  23358. func (c *CreativesListCall) MaxResults(maxResults int64) *CreativesListCall {
  23359. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  23360. return c
  23361. }
  23362. // PageToken sets the optional parameter "pageToken": Value of the
  23363. // nextPageToken from the previous result page.
  23364. func (c *CreativesListCall) PageToken(pageToken string) *CreativesListCall {
  23365. c.urlParams_.Set("pageToken", pageToken)
  23366. return c
  23367. }
  23368. // RenderingIds sets the optional parameter "renderingIds": Select only
  23369. // creatives with these rendering IDs.
  23370. func (c *CreativesListCall) RenderingIds(renderingIds ...int64) *CreativesListCall {
  23371. var renderingIds_ []string
  23372. for _, v := range renderingIds {
  23373. renderingIds_ = append(renderingIds_, fmt.Sprint(v))
  23374. }
  23375. c.urlParams_.SetMulti("renderingIds", renderingIds_)
  23376. return c
  23377. }
  23378. // SearchString sets the optional parameter "searchString": Allows
  23379. // searching for objects by name or ID. Wildcards (*) are allowed. For
  23380. // example, "creative*2015" will return objects with names like
  23381. // "creative June 2015", "creative April 2015", or simply "creative
  23382. // 2015". Most of the searches also add wildcards implicitly at the
  23383. // start and the end of the search string. For example, a search string
  23384. // of "creative" will match objects with name "my creative", "creative
  23385. // 2015", or simply "creative".
  23386. func (c *CreativesListCall) SearchString(searchString string) *CreativesListCall {
  23387. c.urlParams_.Set("searchString", searchString)
  23388. return c
  23389. }
  23390. // SizeIds sets the optional parameter "sizeIds": Select only creatives
  23391. // with these size IDs.
  23392. func (c *CreativesListCall) SizeIds(sizeIds ...int64) *CreativesListCall {
  23393. var sizeIds_ []string
  23394. for _, v := range sizeIds {
  23395. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  23396. }
  23397. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  23398. return c
  23399. }
  23400. // SortField sets the optional parameter "sortField": Field by which to
  23401. // sort the list.
  23402. //
  23403. // Possible values:
  23404. // "ID" (default)
  23405. // "NAME"
  23406. func (c *CreativesListCall) SortField(sortField string) *CreativesListCall {
  23407. c.urlParams_.Set("sortField", sortField)
  23408. return c
  23409. }
  23410. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  23411. // results.
  23412. //
  23413. // Possible values:
  23414. // "ASCENDING" (default)
  23415. // "DESCENDING"
  23416. func (c *CreativesListCall) SortOrder(sortOrder string) *CreativesListCall {
  23417. c.urlParams_.Set("sortOrder", sortOrder)
  23418. return c
  23419. }
  23420. // StudioCreativeId sets the optional parameter "studioCreativeId":
  23421. // Select only creatives corresponding to this Studio creative ID.
  23422. func (c *CreativesListCall) StudioCreativeId(studioCreativeId int64) *CreativesListCall {
  23423. c.urlParams_.Set("studioCreativeId", fmt.Sprint(studioCreativeId))
  23424. return c
  23425. }
  23426. // Types sets the optional parameter "types": Select only creatives with
  23427. // these creative types.
  23428. //
  23429. // Possible values:
  23430. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO"
  23431. // "CUSTOM_DISPLAY"
  23432. // "CUSTOM_DISPLAY_INTERSTITIAL"
  23433. // "DISPLAY"
  23434. // "DISPLAY_IMAGE_GALLERY"
  23435. // "DISPLAY_REDIRECT"
  23436. // "FLASH_INPAGE"
  23437. // "HTML5_BANNER"
  23438. // "IMAGE"
  23439. // "INSTREAM_VIDEO"
  23440. // "INSTREAM_VIDEO_REDIRECT"
  23441. // "INTERNAL_REDIRECT"
  23442. // "INTERSTITIAL_INTERNAL_REDIRECT"
  23443. // "RICH_MEDIA_DISPLAY_BANNER"
  23444. // "RICH_MEDIA_DISPLAY_EXPANDING"
  23445. // "RICH_MEDIA_DISPLAY_INTERSTITIAL"
  23446. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL"
  23447. // "RICH_MEDIA_IM_EXPAND"
  23448. // "RICH_MEDIA_INPAGE_FLOATING"
  23449. // "RICH_MEDIA_MOBILE_IN_APP"
  23450. // "RICH_MEDIA_PEEL_DOWN"
  23451. // "TRACKING_TEXT"
  23452. // "VPAID_LINEAR_VIDEO"
  23453. // "VPAID_NON_LINEAR_VIDEO"
  23454. func (c *CreativesListCall) Types(types ...string) *CreativesListCall {
  23455. c.urlParams_.SetMulti("types", append([]string{}, types...))
  23456. return c
  23457. }
  23458. // Fields allows partial responses to be retrieved. See
  23459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23460. // for more information.
  23461. func (c *CreativesListCall) Fields(s ...googleapi.Field) *CreativesListCall {
  23462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23463. return c
  23464. }
  23465. // IfNoneMatch sets the optional parameter which makes the operation
  23466. // fail if the object's ETag matches the given value. This is useful for
  23467. // getting updates only after the object has changed since the last
  23468. // request. Use googleapi.IsNotModified to check whether the response
  23469. // error from Do is the result of In-None-Match.
  23470. func (c *CreativesListCall) IfNoneMatch(entityTag string) *CreativesListCall {
  23471. c.ifNoneMatch_ = entityTag
  23472. return c
  23473. }
  23474. // Context sets the context to be used in this call's Do method. Any
  23475. // pending HTTP request will be aborted if the provided context is
  23476. // canceled.
  23477. func (c *CreativesListCall) Context(ctx context.Context) *CreativesListCall {
  23478. c.ctx_ = ctx
  23479. return c
  23480. }
  23481. // Header returns an http.Header that can be modified by the caller to
  23482. // add HTTP headers to the request.
  23483. func (c *CreativesListCall) Header() http.Header {
  23484. if c.header_ == nil {
  23485. c.header_ = make(http.Header)
  23486. }
  23487. return c.header_
  23488. }
  23489. func (c *CreativesListCall) doRequest(alt string) (*http.Response, error) {
  23490. reqHeaders := make(http.Header)
  23491. for k, v := range c.header_ {
  23492. reqHeaders[k] = v
  23493. }
  23494. reqHeaders.Set("User-Agent", c.s.userAgent())
  23495. if c.ifNoneMatch_ != "" {
  23496. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  23497. }
  23498. var body io.Reader = nil
  23499. c.urlParams_.Set("alt", alt)
  23500. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  23501. urls += "?" + c.urlParams_.Encode()
  23502. req, _ := http.NewRequest("GET", urls, body)
  23503. req.Header = reqHeaders
  23504. googleapi.Expand(req.URL, map[string]string{
  23505. "profileId": strconv.FormatInt(c.profileId, 10),
  23506. })
  23507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23508. }
  23509. // Do executes the "dfareporting.creatives.list" call.
  23510. // Exactly one of *CreativesListResponse or error will be non-nil. Any
  23511. // non-2xx status code is an error. Response headers are in either
  23512. // *CreativesListResponse.ServerResponse.Header or (if a response was
  23513. // returned at all) in error.(*googleapi.Error).Header. Use
  23514. // googleapi.IsNotModified to check whether the returned error was
  23515. // because http.StatusNotModified was returned.
  23516. func (c *CreativesListCall) Do(opts ...googleapi.CallOption) (*CreativesListResponse, error) {
  23517. gensupport.SetOptions(c.urlParams_, opts...)
  23518. res, err := c.doRequest("json")
  23519. if res != nil && res.StatusCode == http.StatusNotModified {
  23520. if res.Body != nil {
  23521. res.Body.Close()
  23522. }
  23523. return nil, &googleapi.Error{
  23524. Code: res.StatusCode,
  23525. Header: res.Header,
  23526. }
  23527. }
  23528. if err != nil {
  23529. return nil, err
  23530. }
  23531. defer googleapi.CloseBody(res)
  23532. if err := googleapi.CheckResponse(res); err != nil {
  23533. return nil, err
  23534. }
  23535. ret := &CreativesListResponse{
  23536. ServerResponse: googleapi.ServerResponse{
  23537. Header: res.Header,
  23538. HTTPStatusCode: res.StatusCode,
  23539. },
  23540. }
  23541. target := &ret
  23542. if err := gensupport.DecodeResponse(target, res); err != nil {
  23543. return nil, err
  23544. }
  23545. return ret, nil
  23546. // {
  23547. // "description": "Retrieves a list of creatives, possibly filtered. This method supports paging.",
  23548. // "httpMethod": "GET",
  23549. // "id": "dfareporting.creatives.list",
  23550. // "parameterOrder": [
  23551. // "profileId"
  23552. // ],
  23553. // "parameters": {
  23554. // "active": {
  23555. // "description": "Select only active creatives. Leave blank to select active and inactive creatives.",
  23556. // "location": "query",
  23557. // "type": "boolean"
  23558. // },
  23559. // "advertiserId": {
  23560. // "description": "Select only creatives with this advertiser ID.",
  23561. // "format": "int64",
  23562. // "location": "query",
  23563. // "type": "string"
  23564. // },
  23565. // "archived": {
  23566. // "description": "Select only archived creatives. Leave blank to select archived and unarchived creatives.",
  23567. // "location": "query",
  23568. // "type": "boolean"
  23569. // },
  23570. // "campaignId": {
  23571. // "description": "Select only creatives with this campaign ID.",
  23572. // "format": "int64",
  23573. // "location": "query",
  23574. // "type": "string"
  23575. // },
  23576. // "companionCreativeIds": {
  23577. // "description": "Select only in-stream video creatives with these companion IDs.",
  23578. // "format": "int64",
  23579. // "location": "query",
  23580. // "repeated": true,
  23581. // "type": "string"
  23582. // },
  23583. // "creativeFieldIds": {
  23584. // "description": "Select only creatives with these creative field IDs.",
  23585. // "format": "int64",
  23586. // "location": "query",
  23587. // "repeated": true,
  23588. // "type": "string"
  23589. // },
  23590. // "ids": {
  23591. // "description": "Select only creatives with these IDs.",
  23592. // "format": "int64",
  23593. // "location": "query",
  23594. // "repeated": true,
  23595. // "type": "string"
  23596. // },
  23597. // "maxResults": {
  23598. // "default": "1000",
  23599. // "description": "Maximum number of results to return.",
  23600. // "format": "int32",
  23601. // "location": "query",
  23602. // "maximum": "1000",
  23603. // "minimum": "0",
  23604. // "type": "integer"
  23605. // },
  23606. // "pageToken": {
  23607. // "description": "Value of the nextPageToken from the previous result page.",
  23608. // "location": "query",
  23609. // "type": "string"
  23610. // },
  23611. // "profileId": {
  23612. // "description": "User profile ID associated with this request.",
  23613. // "format": "int64",
  23614. // "location": "path",
  23615. // "required": true,
  23616. // "type": "string"
  23617. // },
  23618. // "renderingIds": {
  23619. // "description": "Select only creatives with these rendering IDs.",
  23620. // "format": "int64",
  23621. // "location": "query",
  23622. // "repeated": true,
  23623. // "type": "string"
  23624. // },
  23625. // "searchString": {
  23626. // "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\".",
  23627. // "location": "query",
  23628. // "type": "string"
  23629. // },
  23630. // "sizeIds": {
  23631. // "description": "Select only creatives with these size IDs.",
  23632. // "format": "int64",
  23633. // "location": "query",
  23634. // "repeated": true,
  23635. // "type": "string"
  23636. // },
  23637. // "sortField": {
  23638. // "default": "ID",
  23639. // "description": "Field by which to sort the list.",
  23640. // "enum": [
  23641. // "ID",
  23642. // "NAME"
  23643. // ],
  23644. // "enumDescriptions": [
  23645. // "",
  23646. // ""
  23647. // ],
  23648. // "location": "query",
  23649. // "type": "string"
  23650. // },
  23651. // "sortOrder": {
  23652. // "default": "ASCENDING",
  23653. // "description": "Order of sorted results.",
  23654. // "enum": [
  23655. // "ASCENDING",
  23656. // "DESCENDING"
  23657. // ],
  23658. // "enumDescriptions": [
  23659. // "",
  23660. // ""
  23661. // ],
  23662. // "location": "query",
  23663. // "type": "string"
  23664. // },
  23665. // "studioCreativeId": {
  23666. // "description": "Select only creatives corresponding to this Studio creative ID.",
  23667. // "format": "int64",
  23668. // "location": "query",
  23669. // "type": "string"
  23670. // },
  23671. // "types": {
  23672. // "description": "Select only creatives with these creative types.",
  23673. // "enum": [
  23674. // "BRAND_SAFE_DEFAULT_INSTREAM_VIDEO",
  23675. // "CUSTOM_DISPLAY",
  23676. // "CUSTOM_DISPLAY_INTERSTITIAL",
  23677. // "DISPLAY",
  23678. // "DISPLAY_IMAGE_GALLERY",
  23679. // "DISPLAY_REDIRECT",
  23680. // "FLASH_INPAGE",
  23681. // "HTML5_BANNER",
  23682. // "IMAGE",
  23683. // "INSTREAM_VIDEO",
  23684. // "INSTREAM_VIDEO_REDIRECT",
  23685. // "INTERNAL_REDIRECT",
  23686. // "INTERSTITIAL_INTERNAL_REDIRECT",
  23687. // "RICH_MEDIA_DISPLAY_BANNER",
  23688. // "RICH_MEDIA_DISPLAY_EXPANDING",
  23689. // "RICH_MEDIA_DISPLAY_INTERSTITIAL",
  23690. // "RICH_MEDIA_DISPLAY_MULTI_FLOATING_INTERSTITIAL",
  23691. // "RICH_MEDIA_IM_EXPAND",
  23692. // "RICH_MEDIA_INPAGE_FLOATING",
  23693. // "RICH_MEDIA_MOBILE_IN_APP",
  23694. // "RICH_MEDIA_PEEL_DOWN",
  23695. // "TRACKING_TEXT",
  23696. // "VPAID_LINEAR_VIDEO",
  23697. // "VPAID_NON_LINEAR_VIDEO"
  23698. // ],
  23699. // "enumDescriptions": [
  23700. // "",
  23701. // "",
  23702. // "",
  23703. // "",
  23704. // "",
  23705. // "",
  23706. // "",
  23707. // "",
  23708. // "",
  23709. // "",
  23710. // "",
  23711. // "",
  23712. // "",
  23713. // "",
  23714. // "",
  23715. // "",
  23716. // "",
  23717. // "",
  23718. // "",
  23719. // "",
  23720. // "",
  23721. // "",
  23722. // "",
  23723. // ""
  23724. // ],
  23725. // "location": "query",
  23726. // "repeated": true,
  23727. // "type": "string"
  23728. // }
  23729. // },
  23730. // "path": "userprofiles/{profileId}/creatives",
  23731. // "response": {
  23732. // "$ref": "CreativesListResponse"
  23733. // },
  23734. // "scopes": [
  23735. // "https://www.googleapis.com/auth/dfatrafficking"
  23736. // ]
  23737. // }
  23738. }
  23739. // Pages invokes f for each page of results.
  23740. // A non-nil error returned from f will halt the iteration.
  23741. // The provided context supersedes any context provided to the Context method.
  23742. func (c *CreativesListCall) Pages(ctx context.Context, f func(*CreativesListResponse) error) error {
  23743. c.ctx_ = ctx
  23744. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  23745. for {
  23746. x, err := c.Do()
  23747. if err != nil {
  23748. return err
  23749. }
  23750. if err := f(x); err != nil {
  23751. return err
  23752. }
  23753. if x.NextPageToken == "" {
  23754. return nil
  23755. }
  23756. c.PageToken(x.NextPageToken)
  23757. }
  23758. }
  23759. // method id "dfareporting.creatives.patch":
  23760. type CreativesPatchCall struct {
  23761. s *Service
  23762. profileId int64
  23763. creative *Creative
  23764. urlParams_ gensupport.URLParams
  23765. ctx_ context.Context
  23766. header_ http.Header
  23767. }
  23768. // Patch: Updates an existing creative. This method supports patch
  23769. // semantics.
  23770. func (r *CreativesService) Patch(profileId int64, id int64, creative *Creative) *CreativesPatchCall {
  23771. c := &CreativesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23772. c.profileId = profileId
  23773. c.urlParams_.Set("id", fmt.Sprint(id))
  23774. c.creative = creative
  23775. return c
  23776. }
  23777. // Fields allows partial responses to be retrieved. See
  23778. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23779. // for more information.
  23780. func (c *CreativesPatchCall) Fields(s ...googleapi.Field) *CreativesPatchCall {
  23781. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23782. return c
  23783. }
  23784. // Context sets the context to be used in this call's Do method. Any
  23785. // pending HTTP request will be aborted if the provided context is
  23786. // canceled.
  23787. func (c *CreativesPatchCall) Context(ctx context.Context) *CreativesPatchCall {
  23788. c.ctx_ = ctx
  23789. return c
  23790. }
  23791. // Header returns an http.Header that can be modified by the caller to
  23792. // add HTTP headers to the request.
  23793. func (c *CreativesPatchCall) Header() http.Header {
  23794. if c.header_ == nil {
  23795. c.header_ = make(http.Header)
  23796. }
  23797. return c.header_
  23798. }
  23799. func (c *CreativesPatchCall) doRequest(alt string) (*http.Response, error) {
  23800. reqHeaders := make(http.Header)
  23801. for k, v := range c.header_ {
  23802. reqHeaders[k] = v
  23803. }
  23804. reqHeaders.Set("User-Agent", c.s.userAgent())
  23805. var body io.Reader = nil
  23806. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  23807. if err != nil {
  23808. return nil, err
  23809. }
  23810. reqHeaders.Set("Content-Type", "application/json")
  23811. c.urlParams_.Set("alt", alt)
  23812. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  23813. urls += "?" + c.urlParams_.Encode()
  23814. req, _ := http.NewRequest("PATCH", urls, body)
  23815. req.Header = reqHeaders
  23816. googleapi.Expand(req.URL, map[string]string{
  23817. "profileId": strconv.FormatInt(c.profileId, 10),
  23818. })
  23819. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23820. }
  23821. // Do executes the "dfareporting.creatives.patch" call.
  23822. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  23823. // code is an error. Response headers are in either
  23824. // *Creative.ServerResponse.Header or (if a response was returned at
  23825. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23826. // to check whether the returned error was because
  23827. // http.StatusNotModified was returned.
  23828. func (c *CreativesPatchCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  23829. gensupport.SetOptions(c.urlParams_, opts...)
  23830. res, err := c.doRequest("json")
  23831. if res != nil && res.StatusCode == http.StatusNotModified {
  23832. if res.Body != nil {
  23833. res.Body.Close()
  23834. }
  23835. return nil, &googleapi.Error{
  23836. Code: res.StatusCode,
  23837. Header: res.Header,
  23838. }
  23839. }
  23840. if err != nil {
  23841. return nil, err
  23842. }
  23843. defer googleapi.CloseBody(res)
  23844. if err := googleapi.CheckResponse(res); err != nil {
  23845. return nil, err
  23846. }
  23847. ret := &Creative{
  23848. ServerResponse: googleapi.ServerResponse{
  23849. Header: res.Header,
  23850. HTTPStatusCode: res.StatusCode,
  23851. },
  23852. }
  23853. target := &ret
  23854. if err := gensupport.DecodeResponse(target, res); err != nil {
  23855. return nil, err
  23856. }
  23857. return ret, nil
  23858. // {
  23859. // "description": "Updates an existing creative. This method supports patch semantics.",
  23860. // "httpMethod": "PATCH",
  23861. // "id": "dfareporting.creatives.patch",
  23862. // "parameterOrder": [
  23863. // "profileId",
  23864. // "id"
  23865. // ],
  23866. // "parameters": {
  23867. // "id": {
  23868. // "description": "Creative ID.",
  23869. // "format": "int64",
  23870. // "location": "query",
  23871. // "required": true,
  23872. // "type": "string"
  23873. // },
  23874. // "profileId": {
  23875. // "description": "User profile ID associated with this request.",
  23876. // "format": "int64",
  23877. // "location": "path",
  23878. // "required": true,
  23879. // "type": "string"
  23880. // }
  23881. // },
  23882. // "path": "userprofiles/{profileId}/creatives",
  23883. // "request": {
  23884. // "$ref": "Creative"
  23885. // },
  23886. // "response": {
  23887. // "$ref": "Creative"
  23888. // },
  23889. // "scopes": [
  23890. // "https://www.googleapis.com/auth/dfatrafficking"
  23891. // ]
  23892. // }
  23893. }
  23894. // method id "dfareporting.creatives.update":
  23895. type CreativesUpdateCall struct {
  23896. s *Service
  23897. profileId int64
  23898. creative *Creative
  23899. urlParams_ gensupport.URLParams
  23900. ctx_ context.Context
  23901. header_ http.Header
  23902. }
  23903. // Update: Updates an existing creative.
  23904. func (r *CreativesService) Update(profileId int64, creative *Creative) *CreativesUpdateCall {
  23905. c := &CreativesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  23906. c.profileId = profileId
  23907. c.creative = creative
  23908. return c
  23909. }
  23910. // Fields allows partial responses to be retrieved. See
  23911. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  23912. // for more information.
  23913. func (c *CreativesUpdateCall) Fields(s ...googleapi.Field) *CreativesUpdateCall {
  23914. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  23915. return c
  23916. }
  23917. // Context sets the context to be used in this call's Do method. Any
  23918. // pending HTTP request will be aborted if the provided context is
  23919. // canceled.
  23920. func (c *CreativesUpdateCall) Context(ctx context.Context) *CreativesUpdateCall {
  23921. c.ctx_ = ctx
  23922. return c
  23923. }
  23924. // Header returns an http.Header that can be modified by the caller to
  23925. // add HTTP headers to the request.
  23926. func (c *CreativesUpdateCall) Header() http.Header {
  23927. if c.header_ == nil {
  23928. c.header_ = make(http.Header)
  23929. }
  23930. return c.header_
  23931. }
  23932. func (c *CreativesUpdateCall) doRequest(alt string) (*http.Response, error) {
  23933. reqHeaders := make(http.Header)
  23934. for k, v := range c.header_ {
  23935. reqHeaders[k] = v
  23936. }
  23937. reqHeaders.Set("User-Agent", c.s.userAgent())
  23938. var body io.Reader = nil
  23939. body, err := googleapi.WithoutDataWrapper.JSONReader(c.creative)
  23940. if err != nil {
  23941. return nil, err
  23942. }
  23943. reqHeaders.Set("Content-Type", "application/json")
  23944. c.urlParams_.Set("alt", alt)
  23945. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/creatives")
  23946. urls += "?" + c.urlParams_.Encode()
  23947. req, _ := http.NewRequest("PUT", urls, body)
  23948. req.Header = reqHeaders
  23949. googleapi.Expand(req.URL, map[string]string{
  23950. "profileId": strconv.FormatInt(c.profileId, 10),
  23951. })
  23952. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  23953. }
  23954. // Do executes the "dfareporting.creatives.update" call.
  23955. // Exactly one of *Creative or error will be non-nil. Any non-2xx status
  23956. // code is an error. Response headers are in either
  23957. // *Creative.ServerResponse.Header or (if a response was returned at
  23958. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  23959. // to check whether the returned error was because
  23960. // http.StatusNotModified was returned.
  23961. func (c *CreativesUpdateCall) Do(opts ...googleapi.CallOption) (*Creative, error) {
  23962. gensupport.SetOptions(c.urlParams_, opts...)
  23963. res, err := c.doRequest("json")
  23964. if res != nil && res.StatusCode == http.StatusNotModified {
  23965. if res.Body != nil {
  23966. res.Body.Close()
  23967. }
  23968. return nil, &googleapi.Error{
  23969. Code: res.StatusCode,
  23970. Header: res.Header,
  23971. }
  23972. }
  23973. if err != nil {
  23974. return nil, err
  23975. }
  23976. defer googleapi.CloseBody(res)
  23977. if err := googleapi.CheckResponse(res); err != nil {
  23978. return nil, err
  23979. }
  23980. ret := &Creative{
  23981. ServerResponse: googleapi.ServerResponse{
  23982. Header: res.Header,
  23983. HTTPStatusCode: res.StatusCode,
  23984. },
  23985. }
  23986. target := &ret
  23987. if err := gensupport.DecodeResponse(target, res); err != nil {
  23988. return nil, err
  23989. }
  23990. return ret, nil
  23991. // {
  23992. // "description": "Updates an existing creative.",
  23993. // "httpMethod": "PUT",
  23994. // "id": "dfareporting.creatives.update",
  23995. // "parameterOrder": [
  23996. // "profileId"
  23997. // ],
  23998. // "parameters": {
  23999. // "profileId": {
  24000. // "description": "User profile ID associated with this request.",
  24001. // "format": "int64",
  24002. // "location": "path",
  24003. // "required": true,
  24004. // "type": "string"
  24005. // }
  24006. // },
  24007. // "path": "userprofiles/{profileId}/creatives",
  24008. // "request": {
  24009. // "$ref": "Creative"
  24010. // },
  24011. // "response": {
  24012. // "$ref": "Creative"
  24013. // },
  24014. // "scopes": [
  24015. // "https://www.googleapis.com/auth/dfatrafficking"
  24016. // ]
  24017. // }
  24018. }
  24019. // method id "dfareporting.dimensionValues.query":
  24020. type DimensionValuesQueryCall struct {
  24021. s *Service
  24022. profileId int64
  24023. dimensionvaluerequest *DimensionValueRequest
  24024. urlParams_ gensupport.URLParams
  24025. ctx_ context.Context
  24026. header_ http.Header
  24027. }
  24028. // Query: Retrieves list of report dimension values for a list of
  24029. // filters.
  24030. func (r *DimensionValuesService) Query(profileId int64, dimensionvaluerequest *DimensionValueRequest) *DimensionValuesQueryCall {
  24031. c := &DimensionValuesQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24032. c.profileId = profileId
  24033. c.dimensionvaluerequest = dimensionvaluerequest
  24034. return c
  24035. }
  24036. // MaxResults sets the optional parameter "maxResults": Maximum number
  24037. // of results to return.
  24038. func (c *DimensionValuesQueryCall) MaxResults(maxResults int64) *DimensionValuesQueryCall {
  24039. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24040. return c
  24041. }
  24042. // PageToken sets the optional parameter "pageToken": The value of the
  24043. // nextToken from the previous result page.
  24044. func (c *DimensionValuesQueryCall) PageToken(pageToken string) *DimensionValuesQueryCall {
  24045. c.urlParams_.Set("pageToken", pageToken)
  24046. return c
  24047. }
  24048. // Fields allows partial responses to be retrieved. See
  24049. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24050. // for more information.
  24051. func (c *DimensionValuesQueryCall) Fields(s ...googleapi.Field) *DimensionValuesQueryCall {
  24052. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24053. return c
  24054. }
  24055. // Context sets the context to be used in this call's Do method. Any
  24056. // pending HTTP request will be aborted if the provided context is
  24057. // canceled.
  24058. func (c *DimensionValuesQueryCall) Context(ctx context.Context) *DimensionValuesQueryCall {
  24059. c.ctx_ = ctx
  24060. return c
  24061. }
  24062. // Header returns an http.Header that can be modified by the caller to
  24063. // add HTTP headers to the request.
  24064. func (c *DimensionValuesQueryCall) Header() http.Header {
  24065. if c.header_ == nil {
  24066. c.header_ = make(http.Header)
  24067. }
  24068. return c.header_
  24069. }
  24070. func (c *DimensionValuesQueryCall) doRequest(alt string) (*http.Response, error) {
  24071. reqHeaders := make(http.Header)
  24072. for k, v := range c.header_ {
  24073. reqHeaders[k] = v
  24074. }
  24075. reqHeaders.Set("User-Agent", c.s.userAgent())
  24076. var body io.Reader = nil
  24077. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dimensionvaluerequest)
  24078. if err != nil {
  24079. return nil, err
  24080. }
  24081. reqHeaders.Set("Content-Type", "application/json")
  24082. c.urlParams_.Set("alt", alt)
  24083. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dimensionvalues/query")
  24084. urls += "?" + c.urlParams_.Encode()
  24085. req, _ := http.NewRequest("POST", urls, body)
  24086. req.Header = reqHeaders
  24087. googleapi.Expand(req.URL, map[string]string{
  24088. "profileId": strconv.FormatInt(c.profileId, 10),
  24089. })
  24090. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24091. }
  24092. // Do executes the "dfareporting.dimensionValues.query" call.
  24093. // Exactly one of *DimensionValueList or error will be non-nil. Any
  24094. // non-2xx status code is an error. Response headers are in either
  24095. // *DimensionValueList.ServerResponse.Header or (if a response was
  24096. // returned at all) in error.(*googleapi.Error).Header. Use
  24097. // googleapi.IsNotModified to check whether the returned error was
  24098. // because http.StatusNotModified was returned.
  24099. func (c *DimensionValuesQueryCall) Do(opts ...googleapi.CallOption) (*DimensionValueList, error) {
  24100. gensupport.SetOptions(c.urlParams_, opts...)
  24101. res, err := c.doRequest("json")
  24102. if res != nil && res.StatusCode == http.StatusNotModified {
  24103. if res.Body != nil {
  24104. res.Body.Close()
  24105. }
  24106. return nil, &googleapi.Error{
  24107. Code: res.StatusCode,
  24108. Header: res.Header,
  24109. }
  24110. }
  24111. if err != nil {
  24112. return nil, err
  24113. }
  24114. defer googleapi.CloseBody(res)
  24115. if err := googleapi.CheckResponse(res); err != nil {
  24116. return nil, err
  24117. }
  24118. ret := &DimensionValueList{
  24119. ServerResponse: googleapi.ServerResponse{
  24120. Header: res.Header,
  24121. HTTPStatusCode: res.StatusCode,
  24122. },
  24123. }
  24124. target := &ret
  24125. if err := gensupport.DecodeResponse(target, res); err != nil {
  24126. return nil, err
  24127. }
  24128. return ret, nil
  24129. // {
  24130. // "description": "Retrieves list of report dimension values for a list of filters.",
  24131. // "httpMethod": "POST",
  24132. // "id": "dfareporting.dimensionValues.query",
  24133. // "parameterOrder": [
  24134. // "profileId"
  24135. // ],
  24136. // "parameters": {
  24137. // "maxResults": {
  24138. // "default": "100",
  24139. // "description": "Maximum number of results to return.",
  24140. // "format": "int32",
  24141. // "location": "query",
  24142. // "maximum": "100",
  24143. // "minimum": "0",
  24144. // "type": "integer"
  24145. // },
  24146. // "pageToken": {
  24147. // "description": "The value of the nextToken from the previous result page.",
  24148. // "location": "query",
  24149. // "type": "string"
  24150. // },
  24151. // "profileId": {
  24152. // "description": "The DFA user profile ID.",
  24153. // "format": "int64",
  24154. // "location": "path",
  24155. // "required": true,
  24156. // "type": "string"
  24157. // }
  24158. // },
  24159. // "path": "userprofiles/{profileId}/dimensionvalues/query",
  24160. // "request": {
  24161. // "$ref": "DimensionValueRequest"
  24162. // },
  24163. // "response": {
  24164. // "$ref": "DimensionValueList"
  24165. // },
  24166. // "scopes": [
  24167. // "https://www.googleapis.com/auth/dfareporting"
  24168. // ]
  24169. // }
  24170. }
  24171. // Pages invokes f for each page of results.
  24172. // A non-nil error returned from f will halt the iteration.
  24173. // The provided context supersedes any context provided to the Context method.
  24174. func (c *DimensionValuesQueryCall) Pages(ctx context.Context, f func(*DimensionValueList) error) error {
  24175. c.ctx_ = ctx
  24176. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24177. for {
  24178. x, err := c.Do()
  24179. if err != nil {
  24180. return err
  24181. }
  24182. if err := f(x); err != nil {
  24183. return err
  24184. }
  24185. if x.NextPageToken == "" {
  24186. return nil
  24187. }
  24188. c.PageToken(x.NextPageToken)
  24189. }
  24190. }
  24191. // method id "dfareporting.directorySiteContacts.get":
  24192. type DirectorySiteContactsGetCall struct {
  24193. s *Service
  24194. profileId int64
  24195. id int64
  24196. urlParams_ gensupport.URLParams
  24197. ifNoneMatch_ string
  24198. ctx_ context.Context
  24199. header_ http.Header
  24200. }
  24201. // Get: Gets one directory site contact by ID.
  24202. func (r *DirectorySiteContactsService) Get(profileId int64, id int64) *DirectorySiteContactsGetCall {
  24203. c := &DirectorySiteContactsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24204. c.profileId = profileId
  24205. c.id = id
  24206. return c
  24207. }
  24208. // Fields allows partial responses to be retrieved. See
  24209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24210. // for more information.
  24211. func (c *DirectorySiteContactsGetCall) Fields(s ...googleapi.Field) *DirectorySiteContactsGetCall {
  24212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24213. return c
  24214. }
  24215. // IfNoneMatch sets the optional parameter which makes the operation
  24216. // fail if the object's ETag matches the given value. This is useful for
  24217. // getting updates only after the object has changed since the last
  24218. // request. Use googleapi.IsNotModified to check whether the response
  24219. // error from Do is the result of In-None-Match.
  24220. func (c *DirectorySiteContactsGetCall) IfNoneMatch(entityTag string) *DirectorySiteContactsGetCall {
  24221. c.ifNoneMatch_ = entityTag
  24222. return c
  24223. }
  24224. // Context sets the context to be used in this call's Do method. Any
  24225. // pending HTTP request will be aborted if the provided context is
  24226. // canceled.
  24227. func (c *DirectorySiteContactsGetCall) Context(ctx context.Context) *DirectorySiteContactsGetCall {
  24228. c.ctx_ = ctx
  24229. return c
  24230. }
  24231. // Header returns an http.Header that can be modified by the caller to
  24232. // add HTTP headers to the request.
  24233. func (c *DirectorySiteContactsGetCall) Header() http.Header {
  24234. if c.header_ == nil {
  24235. c.header_ = make(http.Header)
  24236. }
  24237. return c.header_
  24238. }
  24239. func (c *DirectorySiteContactsGetCall) doRequest(alt string) (*http.Response, error) {
  24240. reqHeaders := make(http.Header)
  24241. for k, v := range c.header_ {
  24242. reqHeaders[k] = v
  24243. }
  24244. reqHeaders.Set("User-Agent", c.s.userAgent())
  24245. if c.ifNoneMatch_ != "" {
  24246. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24247. }
  24248. var body io.Reader = nil
  24249. c.urlParams_.Set("alt", alt)
  24250. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts/{id}")
  24251. urls += "?" + c.urlParams_.Encode()
  24252. req, _ := http.NewRequest("GET", urls, body)
  24253. req.Header = reqHeaders
  24254. googleapi.Expand(req.URL, map[string]string{
  24255. "profileId": strconv.FormatInt(c.profileId, 10),
  24256. "id": strconv.FormatInt(c.id, 10),
  24257. })
  24258. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24259. }
  24260. // Do executes the "dfareporting.directorySiteContacts.get" call.
  24261. // Exactly one of *DirectorySiteContact or error will be non-nil. Any
  24262. // non-2xx status code is an error. Response headers are in either
  24263. // *DirectorySiteContact.ServerResponse.Header or (if a response was
  24264. // returned at all) in error.(*googleapi.Error).Header. Use
  24265. // googleapi.IsNotModified to check whether the returned error was
  24266. // because http.StatusNotModified was returned.
  24267. func (c *DirectorySiteContactsGetCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContact, error) {
  24268. gensupport.SetOptions(c.urlParams_, opts...)
  24269. res, err := c.doRequest("json")
  24270. if res != nil && res.StatusCode == http.StatusNotModified {
  24271. if res.Body != nil {
  24272. res.Body.Close()
  24273. }
  24274. return nil, &googleapi.Error{
  24275. Code: res.StatusCode,
  24276. Header: res.Header,
  24277. }
  24278. }
  24279. if err != nil {
  24280. return nil, err
  24281. }
  24282. defer googleapi.CloseBody(res)
  24283. if err := googleapi.CheckResponse(res); err != nil {
  24284. return nil, err
  24285. }
  24286. ret := &DirectorySiteContact{
  24287. ServerResponse: googleapi.ServerResponse{
  24288. Header: res.Header,
  24289. HTTPStatusCode: res.StatusCode,
  24290. },
  24291. }
  24292. target := &ret
  24293. if err := gensupport.DecodeResponse(target, res); err != nil {
  24294. return nil, err
  24295. }
  24296. return ret, nil
  24297. // {
  24298. // "description": "Gets one directory site contact by ID.",
  24299. // "httpMethod": "GET",
  24300. // "id": "dfareporting.directorySiteContacts.get",
  24301. // "parameterOrder": [
  24302. // "profileId",
  24303. // "id"
  24304. // ],
  24305. // "parameters": {
  24306. // "id": {
  24307. // "description": "Directory site contact ID.",
  24308. // "format": "int64",
  24309. // "location": "path",
  24310. // "required": true,
  24311. // "type": "string"
  24312. // },
  24313. // "profileId": {
  24314. // "description": "User profile ID associated with this request.",
  24315. // "format": "int64",
  24316. // "location": "path",
  24317. // "required": true,
  24318. // "type": "string"
  24319. // }
  24320. // },
  24321. // "path": "userprofiles/{profileId}/directorySiteContacts/{id}",
  24322. // "response": {
  24323. // "$ref": "DirectorySiteContact"
  24324. // },
  24325. // "scopes": [
  24326. // "https://www.googleapis.com/auth/dfatrafficking"
  24327. // ]
  24328. // }
  24329. }
  24330. // method id "dfareporting.directorySiteContacts.list":
  24331. type DirectorySiteContactsListCall struct {
  24332. s *Service
  24333. profileId int64
  24334. urlParams_ gensupport.URLParams
  24335. ifNoneMatch_ string
  24336. ctx_ context.Context
  24337. header_ http.Header
  24338. }
  24339. // List: Retrieves a list of directory site contacts, possibly filtered.
  24340. // This method supports paging.
  24341. func (r *DirectorySiteContactsService) List(profileId int64) *DirectorySiteContactsListCall {
  24342. c := &DirectorySiteContactsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24343. c.profileId = profileId
  24344. return c
  24345. }
  24346. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  24347. // Select only directory site contacts with these directory site IDs.
  24348. // This is a required field.
  24349. func (c *DirectorySiteContactsListCall) DirectorySiteIds(directorySiteIds ...int64) *DirectorySiteContactsListCall {
  24350. var directorySiteIds_ []string
  24351. for _, v := range directorySiteIds {
  24352. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  24353. }
  24354. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  24355. return c
  24356. }
  24357. // Ids sets the optional parameter "ids": Select only directory site
  24358. // contacts with these IDs.
  24359. func (c *DirectorySiteContactsListCall) Ids(ids ...int64) *DirectorySiteContactsListCall {
  24360. var ids_ []string
  24361. for _, v := range ids {
  24362. ids_ = append(ids_, fmt.Sprint(v))
  24363. }
  24364. c.urlParams_.SetMulti("ids", ids_)
  24365. return c
  24366. }
  24367. // MaxResults sets the optional parameter "maxResults": Maximum number
  24368. // of results to return.
  24369. func (c *DirectorySiteContactsListCall) MaxResults(maxResults int64) *DirectorySiteContactsListCall {
  24370. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24371. return c
  24372. }
  24373. // PageToken sets the optional parameter "pageToken": Value of the
  24374. // nextPageToken from the previous result page.
  24375. func (c *DirectorySiteContactsListCall) PageToken(pageToken string) *DirectorySiteContactsListCall {
  24376. c.urlParams_.Set("pageToken", pageToken)
  24377. return c
  24378. }
  24379. // SearchString sets the optional parameter "searchString": Allows
  24380. // searching for objects by name, ID or email. Wildcards (*) are
  24381. // allowed. For example, "directory site contact*2015" will return
  24382. // objects with names like "directory site contact June 2015",
  24383. // "directory site contact April 2015", or simply "directory site
  24384. // contact 2015". Most of the searches also add wildcards implicitly at
  24385. // the start and the end of the search string. For example, a search
  24386. // string of "directory site contact" will match objects with name "my
  24387. // directory site contact", "directory site contact 2015", or simply
  24388. // "directory site contact".
  24389. func (c *DirectorySiteContactsListCall) SearchString(searchString string) *DirectorySiteContactsListCall {
  24390. c.urlParams_.Set("searchString", searchString)
  24391. return c
  24392. }
  24393. // SortField sets the optional parameter "sortField": Field by which to
  24394. // sort the list.
  24395. //
  24396. // Possible values:
  24397. // "ID" (default)
  24398. // "NAME"
  24399. func (c *DirectorySiteContactsListCall) SortField(sortField string) *DirectorySiteContactsListCall {
  24400. c.urlParams_.Set("sortField", sortField)
  24401. return c
  24402. }
  24403. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24404. // results.
  24405. //
  24406. // Possible values:
  24407. // "ASCENDING" (default)
  24408. // "DESCENDING"
  24409. func (c *DirectorySiteContactsListCall) SortOrder(sortOrder string) *DirectorySiteContactsListCall {
  24410. c.urlParams_.Set("sortOrder", sortOrder)
  24411. return c
  24412. }
  24413. // Fields allows partial responses to be retrieved. See
  24414. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24415. // for more information.
  24416. func (c *DirectorySiteContactsListCall) Fields(s ...googleapi.Field) *DirectorySiteContactsListCall {
  24417. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24418. return c
  24419. }
  24420. // IfNoneMatch sets the optional parameter which makes the operation
  24421. // fail if the object's ETag matches the given value. This is useful for
  24422. // getting updates only after the object has changed since the last
  24423. // request. Use googleapi.IsNotModified to check whether the response
  24424. // error from Do is the result of In-None-Match.
  24425. func (c *DirectorySiteContactsListCall) IfNoneMatch(entityTag string) *DirectorySiteContactsListCall {
  24426. c.ifNoneMatch_ = entityTag
  24427. return c
  24428. }
  24429. // Context sets the context to be used in this call's Do method. Any
  24430. // pending HTTP request will be aborted if the provided context is
  24431. // canceled.
  24432. func (c *DirectorySiteContactsListCall) Context(ctx context.Context) *DirectorySiteContactsListCall {
  24433. c.ctx_ = ctx
  24434. return c
  24435. }
  24436. // Header returns an http.Header that can be modified by the caller to
  24437. // add HTTP headers to the request.
  24438. func (c *DirectorySiteContactsListCall) Header() http.Header {
  24439. if c.header_ == nil {
  24440. c.header_ = make(http.Header)
  24441. }
  24442. return c.header_
  24443. }
  24444. func (c *DirectorySiteContactsListCall) doRequest(alt string) (*http.Response, error) {
  24445. reqHeaders := make(http.Header)
  24446. for k, v := range c.header_ {
  24447. reqHeaders[k] = v
  24448. }
  24449. reqHeaders.Set("User-Agent", c.s.userAgent())
  24450. if c.ifNoneMatch_ != "" {
  24451. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24452. }
  24453. var body io.Reader = nil
  24454. c.urlParams_.Set("alt", alt)
  24455. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySiteContacts")
  24456. urls += "?" + c.urlParams_.Encode()
  24457. req, _ := http.NewRequest("GET", urls, body)
  24458. req.Header = reqHeaders
  24459. googleapi.Expand(req.URL, map[string]string{
  24460. "profileId": strconv.FormatInt(c.profileId, 10),
  24461. })
  24462. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24463. }
  24464. // Do executes the "dfareporting.directorySiteContacts.list" call.
  24465. // Exactly one of *DirectorySiteContactsListResponse or error will be
  24466. // non-nil. Any non-2xx status code is an error. Response headers are in
  24467. // either *DirectorySiteContactsListResponse.ServerResponse.Header or
  24468. // (if a response was returned at all) in
  24469. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  24470. // whether the returned error was because http.StatusNotModified was
  24471. // returned.
  24472. func (c *DirectorySiteContactsListCall) Do(opts ...googleapi.CallOption) (*DirectorySiteContactsListResponse, error) {
  24473. gensupport.SetOptions(c.urlParams_, opts...)
  24474. res, err := c.doRequest("json")
  24475. if res != nil && res.StatusCode == http.StatusNotModified {
  24476. if res.Body != nil {
  24477. res.Body.Close()
  24478. }
  24479. return nil, &googleapi.Error{
  24480. Code: res.StatusCode,
  24481. Header: res.Header,
  24482. }
  24483. }
  24484. if err != nil {
  24485. return nil, err
  24486. }
  24487. defer googleapi.CloseBody(res)
  24488. if err := googleapi.CheckResponse(res); err != nil {
  24489. return nil, err
  24490. }
  24491. ret := &DirectorySiteContactsListResponse{
  24492. ServerResponse: googleapi.ServerResponse{
  24493. Header: res.Header,
  24494. HTTPStatusCode: res.StatusCode,
  24495. },
  24496. }
  24497. target := &ret
  24498. if err := gensupport.DecodeResponse(target, res); err != nil {
  24499. return nil, err
  24500. }
  24501. return ret, nil
  24502. // {
  24503. // "description": "Retrieves a list of directory site contacts, possibly filtered. This method supports paging.",
  24504. // "httpMethod": "GET",
  24505. // "id": "dfareporting.directorySiteContacts.list",
  24506. // "parameterOrder": [
  24507. // "profileId"
  24508. // ],
  24509. // "parameters": {
  24510. // "directorySiteIds": {
  24511. // "description": "Select only directory site contacts with these directory site IDs. This is a required field.",
  24512. // "format": "int64",
  24513. // "location": "query",
  24514. // "repeated": true,
  24515. // "type": "string"
  24516. // },
  24517. // "ids": {
  24518. // "description": "Select only directory site contacts with these IDs.",
  24519. // "format": "int64",
  24520. // "location": "query",
  24521. // "repeated": true,
  24522. // "type": "string"
  24523. // },
  24524. // "maxResults": {
  24525. // "default": "1000",
  24526. // "description": "Maximum number of results to return.",
  24527. // "format": "int32",
  24528. // "location": "query",
  24529. // "maximum": "1000",
  24530. // "minimum": "0",
  24531. // "type": "integer"
  24532. // },
  24533. // "pageToken": {
  24534. // "description": "Value of the nextPageToken from the previous result page.",
  24535. // "location": "query",
  24536. // "type": "string"
  24537. // },
  24538. // "profileId": {
  24539. // "description": "User profile ID associated with this request.",
  24540. // "format": "int64",
  24541. // "location": "path",
  24542. // "required": true,
  24543. // "type": "string"
  24544. // },
  24545. // "searchString": {
  24546. // "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\".",
  24547. // "location": "query",
  24548. // "type": "string"
  24549. // },
  24550. // "sortField": {
  24551. // "default": "ID",
  24552. // "description": "Field by which to sort the list.",
  24553. // "enum": [
  24554. // "ID",
  24555. // "NAME"
  24556. // ],
  24557. // "enumDescriptions": [
  24558. // "",
  24559. // ""
  24560. // ],
  24561. // "location": "query",
  24562. // "type": "string"
  24563. // },
  24564. // "sortOrder": {
  24565. // "default": "ASCENDING",
  24566. // "description": "Order of sorted results.",
  24567. // "enum": [
  24568. // "ASCENDING",
  24569. // "DESCENDING"
  24570. // ],
  24571. // "enumDescriptions": [
  24572. // "",
  24573. // ""
  24574. // ],
  24575. // "location": "query",
  24576. // "type": "string"
  24577. // }
  24578. // },
  24579. // "path": "userprofiles/{profileId}/directorySiteContacts",
  24580. // "response": {
  24581. // "$ref": "DirectorySiteContactsListResponse"
  24582. // },
  24583. // "scopes": [
  24584. // "https://www.googleapis.com/auth/dfatrafficking"
  24585. // ]
  24586. // }
  24587. }
  24588. // Pages invokes f for each page of results.
  24589. // A non-nil error returned from f will halt the iteration.
  24590. // The provided context supersedes any context provided to the Context method.
  24591. func (c *DirectorySiteContactsListCall) Pages(ctx context.Context, f func(*DirectorySiteContactsListResponse) error) error {
  24592. c.ctx_ = ctx
  24593. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  24594. for {
  24595. x, err := c.Do()
  24596. if err != nil {
  24597. return err
  24598. }
  24599. if err := f(x); err != nil {
  24600. return err
  24601. }
  24602. if x.NextPageToken == "" {
  24603. return nil
  24604. }
  24605. c.PageToken(x.NextPageToken)
  24606. }
  24607. }
  24608. // method id "dfareporting.directorySites.get":
  24609. type DirectorySitesGetCall struct {
  24610. s *Service
  24611. profileId int64
  24612. id int64
  24613. urlParams_ gensupport.URLParams
  24614. ifNoneMatch_ string
  24615. ctx_ context.Context
  24616. header_ http.Header
  24617. }
  24618. // Get: Gets one directory site by ID.
  24619. func (r *DirectorySitesService) Get(profileId int64, id int64) *DirectorySitesGetCall {
  24620. c := &DirectorySitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24621. c.profileId = profileId
  24622. c.id = id
  24623. return c
  24624. }
  24625. // Fields allows partial responses to be retrieved. See
  24626. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24627. // for more information.
  24628. func (c *DirectorySitesGetCall) Fields(s ...googleapi.Field) *DirectorySitesGetCall {
  24629. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24630. return c
  24631. }
  24632. // IfNoneMatch sets the optional parameter which makes the operation
  24633. // fail if the object's ETag matches the given value. This is useful for
  24634. // getting updates only after the object has changed since the last
  24635. // request. Use googleapi.IsNotModified to check whether the response
  24636. // error from Do is the result of In-None-Match.
  24637. func (c *DirectorySitesGetCall) IfNoneMatch(entityTag string) *DirectorySitesGetCall {
  24638. c.ifNoneMatch_ = entityTag
  24639. return c
  24640. }
  24641. // Context sets the context to be used in this call's Do method. Any
  24642. // pending HTTP request will be aborted if the provided context is
  24643. // canceled.
  24644. func (c *DirectorySitesGetCall) Context(ctx context.Context) *DirectorySitesGetCall {
  24645. c.ctx_ = ctx
  24646. return c
  24647. }
  24648. // Header returns an http.Header that can be modified by the caller to
  24649. // add HTTP headers to the request.
  24650. func (c *DirectorySitesGetCall) Header() http.Header {
  24651. if c.header_ == nil {
  24652. c.header_ = make(http.Header)
  24653. }
  24654. return c.header_
  24655. }
  24656. func (c *DirectorySitesGetCall) doRequest(alt string) (*http.Response, error) {
  24657. reqHeaders := make(http.Header)
  24658. for k, v := range c.header_ {
  24659. reqHeaders[k] = v
  24660. }
  24661. reqHeaders.Set("User-Agent", c.s.userAgent())
  24662. if c.ifNoneMatch_ != "" {
  24663. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  24664. }
  24665. var body io.Reader = nil
  24666. c.urlParams_.Set("alt", alt)
  24667. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites/{id}")
  24668. urls += "?" + c.urlParams_.Encode()
  24669. req, _ := http.NewRequest("GET", urls, body)
  24670. req.Header = reqHeaders
  24671. googleapi.Expand(req.URL, map[string]string{
  24672. "profileId": strconv.FormatInt(c.profileId, 10),
  24673. "id": strconv.FormatInt(c.id, 10),
  24674. })
  24675. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24676. }
  24677. // Do executes the "dfareporting.directorySites.get" call.
  24678. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  24679. // status code is an error. Response headers are in either
  24680. // *DirectorySite.ServerResponse.Header or (if a response was returned
  24681. // at all) in error.(*googleapi.Error).Header. Use
  24682. // googleapi.IsNotModified to check whether the returned error was
  24683. // because http.StatusNotModified was returned.
  24684. func (c *DirectorySitesGetCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  24685. gensupport.SetOptions(c.urlParams_, opts...)
  24686. res, err := c.doRequest("json")
  24687. if res != nil && res.StatusCode == http.StatusNotModified {
  24688. if res.Body != nil {
  24689. res.Body.Close()
  24690. }
  24691. return nil, &googleapi.Error{
  24692. Code: res.StatusCode,
  24693. Header: res.Header,
  24694. }
  24695. }
  24696. if err != nil {
  24697. return nil, err
  24698. }
  24699. defer googleapi.CloseBody(res)
  24700. if err := googleapi.CheckResponse(res); err != nil {
  24701. return nil, err
  24702. }
  24703. ret := &DirectorySite{
  24704. ServerResponse: googleapi.ServerResponse{
  24705. Header: res.Header,
  24706. HTTPStatusCode: res.StatusCode,
  24707. },
  24708. }
  24709. target := &ret
  24710. if err := gensupport.DecodeResponse(target, res); err != nil {
  24711. return nil, err
  24712. }
  24713. return ret, nil
  24714. // {
  24715. // "description": "Gets one directory site by ID.",
  24716. // "httpMethod": "GET",
  24717. // "id": "dfareporting.directorySites.get",
  24718. // "parameterOrder": [
  24719. // "profileId",
  24720. // "id"
  24721. // ],
  24722. // "parameters": {
  24723. // "id": {
  24724. // "description": "Directory site ID.",
  24725. // "format": "int64",
  24726. // "location": "path",
  24727. // "required": true,
  24728. // "type": "string"
  24729. // },
  24730. // "profileId": {
  24731. // "description": "User profile ID associated with this request.",
  24732. // "format": "int64",
  24733. // "location": "path",
  24734. // "required": true,
  24735. // "type": "string"
  24736. // }
  24737. // },
  24738. // "path": "userprofiles/{profileId}/directorySites/{id}",
  24739. // "response": {
  24740. // "$ref": "DirectorySite"
  24741. // },
  24742. // "scopes": [
  24743. // "https://www.googleapis.com/auth/dfatrafficking"
  24744. // ]
  24745. // }
  24746. }
  24747. // method id "dfareporting.directorySites.insert":
  24748. type DirectorySitesInsertCall struct {
  24749. s *Service
  24750. profileId int64
  24751. directorysite *DirectorySite
  24752. urlParams_ gensupport.URLParams
  24753. ctx_ context.Context
  24754. header_ http.Header
  24755. }
  24756. // Insert: Inserts a new directory site.
  24757. func (r *DirectorySitesService) Insert(profileId int64, directorysite *DirectorySite) *DirectorySitesInsertCall {
  24758. c := &DirectorySitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24759. c.profileId = profileId
  24760. c.directorysite = directorysite
  24761. return c
  24762. }
  24763. // Fields allows partial responses to be retrieved. See
  24764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24765. // for more information.
  24766. func (c *DirectorySitesInsertCall) Fields(s ...googleapi.Field) *DirectorySitesInsertCall {
  24767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24768. return c
  24769. }
  24770. // Context sets the context to be used in this call's Do method. Any
  24771. // pending HTTP request will be aborted if the provided context is
  24772. // canceled.
  24773. func (c *DirectorySitesInsertCall) Context(ctx context.Context) *DirectorySitesInsertCall {
  24774. c.ctx_ = ctx
  24775. return c
  24776. }
  24777. // Header returns an http.Header that can be modified by the caller to
  24778. // add HTTP headers to the request.
  24779. func (c *DirectorySitesInsertCall) Header() http.Header {
  24780. if c.header_ == nil {
  24781. c.header_ = make(http.Header)
  24782. }
  24783. return c.header_
  24784. }
  24785. func (c *DirectorySitesInsertCall) doRequest(alt string) (*http.Response, error) {
  24786. reqHeaders := make(http.Header)
  24787. for k, v := range c.header_ {
  24788. reqHeaders[k] = v
  24789. }
  24790. reqHeaders.Set("User-Agent", c.s.userAgent())
  24791. var body io.Reader = nil
  24792. body, err := googleapi.WithoutDataWrapper.JSONReader(c.directorysite)
  24793. if err != nil {
  24794. return nil, err
  24795. }
  24796. reqHeaders.Set("Content-Type", "application/json")
  24797. c.urlParams_.Set("alt", alt)
  24798. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  24799. urls += "?" + c.urlParams_.Encode()
  24800. req, _ := http.NewRequest("POST", urls, body)
  24801. req.Header = reqHeaders
  24802. googleapi.Expand(req.URL, map[string]string{
  24803. "profileId": strconv.FormatInt(c.profileId, 10),
  24804. })
  24805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  24806. }
  24807. // Do executes the "dfareporting.directorySites.insert" call.
  24808. // Exactly one of *DirectorySite or error will be non-nil. Any non-2xx
  24809. // status code is an error. Response headers are in either
  24810. // *DirectorySite.ServerResponse.Header or (if a response was returned
  24811. // at all) in error.(*googleapi.Error).Header. Use
  24812. // googleapi.IsNotModified to check whether the returned error was
  24813. // because http.StatusNotModified was returned.
  24814. func (c *DirectorySitesInsertCall) Do(opts ...googleapi.CallOption) (*DirectorySite, error) {
  24815. gensupport.SetOptions(c.urlParams_, opts...)
  24816. res, err := c.doRequest("json")
  24817. if res != nil && res.StatusCode == http.StatusNotModified {
  24818. if res.Body != nil {
  24819. res.Body.Close()
  24820. }
  24821. return nil, &googleapi.Error{
  24822. Code: res.StatusCode,
  24823. Header: res.Header,
  24824. }
  24825. }
  24826. if err != nil {
  24827. return nil, err
  24828. }
  24829. defer googleapi.CloseBody(res)
  24830. if err := googleapi.CheckResponse(res); err != nil {
  24831. return nil, err
  24832. }
  24833. ret := &DirectorySite{
  24834. ServerResponse: googleapi.ServerResponse{
  24835. Header: res.Header,
  24836. HTTPStatusCode: res.StatusCode,
  24837. },
  24838. }
  24839. target := &ret
  24840. if err := gensupport.DecodeResponse(target, res); err != nil {
  24841. return nil, err
  24842. }
  24843. return ret, nil
  24844. // {
  24845. // "description": "Inserts a new directory site.",
  24846. // "httpMethod": "POST",
  24847. // "id": "dfareporting.directorySites.insert",
  24848. // "parameterOrder": [
  24849. // "profileId"
  24850. // ],
  24851. // "parameters": {
  24852. // "profileId": {
  24853. // "description": "User profile ID associated with this request.",
  24854. // "format": "int64",
  24855. // "location": "path",
  24856. // "required": true,
  24857. // "type": "string"
  24858. // }
  24859. // },
  24860. // "path": "userprofiles/{profileId}/directorySites",
  24861. // "request": {
  24862. // "$ref": "DirectorySite"
  24863. // },
  24864. // "response": {
  24865. // "$ref": "DirectorySite"
  24866. // },
  24867. // "scopes": [
  24868. // "https://www.googleapis.com/auth/dfatrafficking"
  24869. // ]
  24870. // }
  24871. }
  24872. // method id "dfareporting.directorySites.list":
  24873. type DirectorySitesListCall struct {
  24874. s *Service
  24875. profileId int64
  24876. urlParams_ gensupport.URLParams
  24877. ifNoneMatch_ string
  24878. ctx_ context.Context
  24879. header_ http.Header
  24880. }
  24881. // List: Retrieves a list of directory sites, possibly filtered. This
  24882. // method supports paging.
  24883. func (r *DirectorySitesService) List(profileId int64) *DirectorySitesListCall {
  24884. c := &DirectorySitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  24885. c.profileId = profileId
  24886. return c
  24887. }
  24888. // AcceptsInStreamVideoPlacements sets the optional parameter
  24889. // "acceptsInStreamVideoPlacements": This search filter is no longer
  24890. // supported and will have no effect on the results returned.
  24891. func (c *DirectorySitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *DirectorySitesListCall {
  24892. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  24893. return c
  24894. }
  24895. // AcceptsInterstitialPlacements sets the optional parameter
  24896. // "acceptsInterstitialPlacements": This search filter is no longer
  24897. // supported and will have no effect on the results returned.
  24898. func (c *DirectorySitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *DirectorySitesListCall {
  24899. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  24900. return c
  24901. }
  24902. // AcceptsPublisherPaidPlacements sets the optional parameter
  24903. // "acceptsPublisherPaidPlacements": Select only directory sites that
  24904. // accept publisher paid placements. This field can be left blank.
  24905. func (c *DirectorySitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *DirectorySitesListCall {
  24906. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  24907. return c
  24908. }
  24909. // Active sets the optional parameter "active": Select only active
  24910. // directory sites. Leave blank to retrieve both active and inactive
  24911. // directory sites.
  24912. func (c *DirectorySitesListCall) Active(active bool) *DirectorySitesListCall {
  24913. c.urlParams_.Set("active", fmt.Sprint(active))
  24914. return c
  24915. }
  24916. // CountryId sets the optional parameter "countryId": Select only
  24917. // directory sites with this country ID.
  24918. func (c *DirectorySitesListCall) CountryId(countryId int64) *DirectorySitesListCall {
  24919. c.urlParams_.Set("countryId", fmt.Sprint(countryId))
  24920. return c
  24921. }
  24922. // DfpNetworkCode sets the optional parameter "dfp_network_code": Select
  24923. // only directory sites with this DFP network code.
  24924. func (c *DirectorySitesListCall) DfpNetworkCode(dfpNetworkCode string) *DirectorySitesListCall {
  24925. c.urlParams_.Set("dfp_network_code", dfpNetworkCode)
  24926. return c
  24927. }
  24928. // Ids sets the optional parameter "ids": Select only directory sites
  24929. // with these IDs.
  24930. func (c *DirectorySitesListCall) Ids(ids ...int64) *DirectorySitesListCall {
  24931. var ids_ []string
  24932. for _, v := range ids {
  24933. ids_ = append(ids_, fmt.Sprint(v))
  24934. }
  24935. c.urlParams_.SetMulti("ids", ids_)
  24936. return c
  24937. }
  24938. // MaxResults sets the optional parameter "maxResults": Maximum number
  24939. // of results to return.
  24940. func (c *DirectorySitesListCall) MaxResults(maxResults int64) *DirectorySitesListCall {
  24941. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  24942. return c
  24943. }
  24944. // PageToken sets the optional parameter "pageToken": Value of the
  24945. // nextPageToken from the previous result page.
  24946. func (c *DirectorySitesListCall) PageToken(pageToken string) *DirectorySitesListCall {
  24947. c.urlParams_.Set("pageToken", pageToken)
  24948. return c
  24949. }
  24950. // ParentId sets the optional parameter "parentId": Select only
  24951. // directory sites with this parent ID.
  24952. func (c *DirectorySitesListCall) ParentId(parentId int64) *DirectorySitesListCall {
  24953. c.urlParams_.Set("parentId", fmt.Sprint(parentId))
  24954. return c
  24955. }
  24956. // SearchString sets the optional parameter "searchString": Allows
  24957. // searching for objects by name, ID or URL. Wildcards (*) are allowed.
  24958. // For example, "directory site*2015" will return objects with names
  24959. // like "directory site June 2015", "directory site April 2015", or
  24960. // simply "directory site 2015". Most of the searches also add wildcards
  24961. // implicitly at the start and the end of the search string. For
  24962. // example, a search string of "directory site" will match objects with
  24963. // name "my directory site", "directory site 2015" or simply, "directory
  24964. // site".
  24965. func (c *DirectorySitesListCall) SearchString(searchString string) *DirectorySitesListCall {
  24966. c.urlParams_.Set("searchString", searchString)
  24967. return c
  24968. }
  24969. // SortField sets the optional parameter "sortField": Field by which to
  24970. // sort the list.
  24971. //
  24972. // Possible values:
  24973. // "ID" (default)
  24974. // "NAME"
  24975. func (c *DirectorySitesListCall) SortField(sortField string) *DirectorySitesListCall {
  24976. c.urlParams_.Set("sortField", sortField)
  24977. return c
  24978. }
  24979. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  24980. // results.
  24981. //
  24982. // Possible values:
  24983. // "ASCENDING" (default)
  24984. // "DESCENDING"
  24985. func (c *DirectorySitesListCall) SortOrder(sortOrder string) *DirectorySitesListCall {
  24986. c.urlParams_.Set("sortOrder", sortOrder)
  24987. return c
  24988. }
  24989. // Fields allows partial responses to be retrieved. See
  24990. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  24991. // for more information.
  24992. func (c *DirectorySitesListCall) Fields(s ...googleapi.Field) *DirectorySitesListCall {
  24993. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  24994. return c
  24995. }
  24996. // IfNoneMatch sets the optional parameter which makes the operation
  24997. // fail if the object's ETag matches the given value. This is useful for
  24998. // getting updates only after the object has changed since the last
  24999. // request. Use googleapi.IsNotModified to check whether the response
  25000. // error from Do is the result of In-None-Match.
  25001. func (c *DirectorySitesListCall) IfNoneMatch(entityTag string) *DirectorySitesListCall {
  25002. c.ifNoneMatch_ = entityTag
  25003. return c
  25004. }
  25005. // Context sets the context to be used in this call's Do method. Any
  25006. // pending HTTP request will be aborted if the provided context is
  25007. // canceled.
  25008. func (c *DirectorySitesListCall) Context(ctx context.Context) *DirectorySitesListCall {
  25009. c.ctx_ = ctx
  25010. return c
  25011. }
  25012. // Header returns an http.Header that can be modified by the caller to
  25013. // add HTTP headers to the request.
  25014. func (c *DirectorySitesListCall) Header() http.Header {
  25015. if c.header_ == nil {
  25016. c.header_ = make(http.Header)
  25017. }
  25018. return c.header_
  25019. }
  25020. func (c *DirectorySitesListCall) doRequest(alt string) (*http.Response, error) {
  25021. reqHeaders := make(http.Header)
  25022. for k, v := range c.header_ {
  25023. reqHeaders[k] = v
  25024. }
  25025. reqHeaders.Set("User-Agent", c.s.userAgent())
  25026. if c.ifNoneMatch_ != "" {
  25027. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25028. }
  25029. var body io.Reader = nil
  25030. c.urlParams_.Set("alt", alt)
  25031. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/directorySites")
  25032. urls += "?" + c.urlParams_.Encode()
  25033. req, _ := http.NewRequest("GET", urls, body)
  25034. req.Header = reqHeaders
  25035. googleapi.Expand(req.URL, map[string]string{
  25036. "profileId": strconv.FormatInt(c.profileId, 10),
  25037. })
  25038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25039. }
  25040. // Do executes the "dfareporting.directorySites.list" call.
  25041. // Exactly one of *DirectorySitesListResponse or error will be non-nil.
  25042. // Any non-2xx status code is an error. Response headers are in either
  25043. // *DirectorySitesListResponse.ServerResponse.Header or (if a response
  25044. // was returned at all) in error.(*googleapi.Error).Header. Use
  25045. // googleapi.IsNotModified to check whether the returned error was
  25046. // because http.StatusNotModified was returned.
  25047. func (c *DirectorySitesListCall) Do(opts ...googleapi.CallOption) (*DirectorySitesListResponse, error) {
  25048. gensupport.SetOptions(c.urlParams_, opts...)
  25049. res, err := c.doRequest("json")
  25050. if res != nil && res.StatusCode == http.StatusNotModified {
  25051. if res.Body != nil {
  25052. res.Body.Close()
  25053. }
  25054. return nil, &googleapi.Error{
  25055. Code: res.StatusCode,
  25056. Header: res.Header,
  25057. }
  25058. }
  25059. if err != nil {
  25060. return nil, err
  25061. }
  25062. defer googleapi.CloseBody(res)
  25063. if err := googleapi.CheckResponse(res); err != nil {
  25064. return nil, err
  25065. }
  25066. ret := &DirectorySitesListResponse{
  25067. ServerResponse: googleapi.ServerResponse{
  25068. Header: res.Header,
  25069. HTTPStatusCode: res.StatusCode,
  25070. },
  25071. }
  25072. target := &ret
  25073. if err := gensupport.DecodeResponse(target, res); err != nil {
  25074. return nil, err
  25075. }
  25076. return ret, nil
  25077. // {
  25078. // "description": "Retrieves a list of directory sites, possibly filtered. This method supports paging.",
  25079. // "httpMethod": "GET",
  25080. // "id": "dfareporting.directorySites.list",
  25081. // "parameterOrder": [
  25082. // "profileId"
  25083. // ],
  25084. // "parameters": {
  25085. // "acceptsInStreamVideoPlacements": {
  25086. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  25087. // "location": "query",
  25088. // "type": "boolean"
  25089. // },
  25090. // "acceptsInterstitialPlacements": {
  25091. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  25092. // "location": "query",
  25093. // "type": "boolean"
  25094. // },
  25095. // "acceptsPublisherPaidPlacements": {
  25096. // "description": "Select only directory sites that accept publisher paid placements. This field can be left blank.",
  25097. // "location": "query",
  25098. // "type": "boolean"
  25099. // },
  25100. // "active": {
  25101. // "description": "Select only active directory sites. Leave blank to retrieve both active and inactive directory sites.",
  25102. // "location": "query",
  25103. // "type": "boolean"
  25104. // },
  25105. // "countryId": {
  25106. // "description": "Select only directory sites with this country ID.",
  25107. // "format": "int64",
  25108. // "location": "query",
  25109. // "type": "string"
  25110. // },
  25111. // "dfp_network_code": {
  25112. // "description": "Select only directory sites with this DFP network code.",
  25113. // "location": "query",
  25114. // "type": "string"
  25115. // },
  25116. // "ids": {
  25117. // "description": "Select only directory sites with these IDs.",
  25118. // "format": "int64",
  25119. // "location": "query",
  25120. // "repeated": true,
  25121. // "type": "string"
  25122. // },
  25123. // "maxResults": {
  25124. // "default": "1000",
  25125. // "description": "Maximum number of results to return.",
  25126. // "format": "int32",
  25127. // "location": "query",
  25128. // "maximum": "1000",
  25129. // "minimum": "0",
  25130. // "type": "integer"
  25131. // },
  25132. // "pageToken": {
  25133. // "description": "Value of the nextPageToken from the previous result page.",
  25134. // "location": "query",
  25135. // "type": "string"
  25136. // },
  25137. // "parentId": {
  25138. // "description": "Select only directory sites with this parent ID.",
  25139. // "format": "int64",
  25140. // "location": "query",
  25141. // "type": "string"
  25142. // },
  25143. // "profileId": {
  25144. // "description": "User profile ID associated with this request.",
  25145. // "format": "int64",
  25146. // "location": "path",
  25147. // "required": true,
  25148. // "type": "string"
  25149. // },
  25150. // "searchString": {
  25151. // "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\".",
  25152. // "location": "query",
  25153. // "type": "string"
  25154. // },
  25155. // "sortField": {
  25156. // "default": "ID",
  25157. // "description": "Field by which to sort the list.",
  25158. // "enum": [
  25159. // "ID",
  25160. // "NAME"
  25161. // ],
  25162. // "enumDescriptions": [
  25163. // "",
  25164. // ""
  25165. // ],
  25166. // "location": "query",
  25167. // "type": "string"
  25168. // },
  25169. // "sortOrder": {
  25170. // "default": "ASCENDING",
  25171. // "description": "Order of sorted results.",
  25172. // "enum": [
  25173. // "ASCENDING",
  25174. // "DESCENDING"
  25175. // ],
  25176. // "enumDescriptions": [
  25177. // "",
  25178. // ""
  25179. // ],
  25180. // "location": "query",
  25181. // "type": "string"
  25182. // }
  25183. // },
  25184. // "path": "userprofiles/{profileId}/directorySites",
  25185. // "response": {
  25186. // "$ref": "DirectorySitesListResponse"
  25187. // },
  25188. // "scopes": [
  25189. // "https://www.googleapis.com/auth/dfatrafficking"
  25190. // ]
  25191. // }
  25192. }
  25193. // Pages invokes f for each page of results.
  25194. // A non-nil error returned from f will halt the iteration.
  25195. // The provided context supersedes any context provided to the Context method.
  25196. func (c *DirectorySitesListCall) Pages(ctx context.Context, f func(*DirectorySitesListResponse) error) error {
  25197. c.ctx_ = ctx
  25198. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  25199. for {
  25200. x, err := c.Do()
  25201. if err != nil {
  25202. return err
  25203. }
  25204. if err := f(x); err != nil {
  25205. return err
  25206. }
  25207. if x.NextPageToken == "" {
  25208. return nil
  25209. }
  25210. c.PageToken(x.NextPageToken)
  25211. }
  25212. }
  25213. // method id "dfareporting.dynamicTargetingKeys.delete":
  25214. type DynamicTargetingKeysDeleteCall struct {
  25215. s *Service
  25216. profileId int64
  25217. objectId int64
  25218. urlParams_ gensupport.URLParams
  25219. ctx_ context.Context
  25220. header_ http.Header
  25221. }
  25222. // Delete: Deletes an existing dynamic targeting key.
  25223. func (r *DynamicTargetingKeysService) Delete(profileId int64, objectId int64, name string, objectType string) *DynamicTargetingKeysDeleteCall {
  25224. c := &DynamicTargetingKeysDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25225. c.profileId = profileId
  25226. c.objectId = objectId
  25227. c.urlParams_.Set("name", name)
  25228. c.urlParams_.Set("objectType", objectType)
  25229. return c
  25230. }
  25231. // Fields allows partial responses to be retrieved. See
  25232. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25233. // for more information.
  25234. func (c *DynamicTargetingKeysDeleteCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysDeleteCall {
  25235. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25236. return c
  25237. }
  25238. // Context sets the context to be used in this call's Do method. Any
  25239. // pending HTTP request will be aborted if the provided context is
  25240. // canceled.
  25241. func (c *DynamicTargetingKeysDeleteCall) Context(ctx context.Context) *DynamicTargetingKeysDeleteCall {
  25242. c.ctx_ = ctx
  25243. return c
  25244. }
  25245. // Header returns an http.Header that can be modified by the caller to
  25246. // add HTTP headers to the request.
  25247. func (c *DynamicTargetingKeysDeleteCall) Header() http.Header {
  25248. if c.header_ == nil {
  25249. c.header_ = make(http.Header)
  25250. }
  25251. return c.header_
  25252. }
  25253. func (c *DynamicTargetingKeysDeleteCall) doRequest(alt string) (*http.Response, error) {
  25254. reqHeaders := make(http.Header)
  25255. for k, v := range c.header_ {
  25256. reqHeaders[k] = v
  25257. }
  25258. reqHeaders.Set("User-Agent", c.s.userAgent())
  25259. var body io.Reader = nil
  25260. c.urlParams_.Set("alt", alt)
  25261. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}")
  25262. urls += "?" + c.urlParams_.Encode()
  25263. req, _ := http.NewRequest("DELETE", urls, body)
  25264. req.Header = reqHeaders
  25265. googleapi.Expand(req.URL, map[string]string{
  25266. "profileId": strconv.FormatInt(c.profileId, 10),
  25267. "objectId": strconv.FormatInt(c.objectId, 10),
  25268. })
  25269. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25270. }
  25271. // Do executes the "dfareporting.dynamicTargetingKeys.delete" call.
  25272. func (c *DynamicTargetingKeysDeleteCall) Do(opts ...googleapi.CallOption) error {
  25273. gensupport.SetOptions(c.urlParams_, opts...)
  25274. res, err := c.doRequest("json")
  25275. if err != nil {
  25276. return err
  25277. }
  25278. defer googleapi.CloseBody(res)
  25279. if err := googleapi.CheckResponse(res); err != nil {
  25280. return err
  25281. }
  25282. return nil
  25283. // {
  25284. // "description": "Deletes an existing dynamic targeting key.",
  25285. // "httpMethod": "DELETE",
  25286. // "id": "dfareporting.dynamicTargetingKeys.delete",
  25287. // "parameterOrder": [
  25288. // "profileId",
  25289. // "objectId",
  25290. // "name",
  25291. // "objectType"
  25292. // ],
  25293. // "parameters": {
  25294. // "name": {
  25295. // "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.",
  25296. // "location": "query",
  25297. // "required": true,
  25298. // "type": "string"
  25299. // },
  25300. // "objectId": {
  25301. // "description": "ID of the object of this dynamic targeting key. This is a required field.",
  25302. // "format": "int64",
  25303. // "location": "path",
  25304. // "required": true,
  25305. // "type": "string"
  25306. // },
  25307. // "objectType": {
  25308. // "description": "Type of the object of this dynamic targeting key. This is a required field.",
  25309. // "enum": [
  25310. // "OBJECT_AD",
  25311. // "OBJECT_ADVERTISER",
  25312. // "OBJECT_CREATIVE",
  25313. // "OBJECT_PLACEMENT"
  25314. // ],
  25315. // "enumDescriptions": [
  25316. // "",
  25317. // "",
  25318. // "",
  25319. // ""
  25320. // ],
  25321. // "location": "query",
  25322. // "required": true,
  25323. // "type": "string"
  25324. // },
  25325. // "profileId": {
  25326. // "description": "User profile ID associated with this request.",
  25327. // "format": "int64",
  25328. // "location": "path",
  25329. // "required": true,
  25330. // "type": "string"
  25331. // }
  25332. // },
  25333. // "path": "userprofiles/{profileId}/dynamicTargetingKeys/{objectId}",
  25334. // "scopes": [
  25335. // "https://www.googleapis.com/auth/dfatrafficking"
  25336. // ]
  25337. // }
  25338. }
  25339. // method id "dfareporting.dynamicTargetingKeys.insert":
  25340. type DynamicTargetingKeysInsertCall struct {
  25341. s *Service
  25342. profileId int64
  25343. dynamictargetingkey *DynamicTargetingKey
  25344. urlParams_ gensupport.URLParams
  25345. ctx_ context.Context
  25346. header_ http.Header
  25347. }
  25348. // Insert: Inserts a new dynamic targeting key. Keys must be created at
  25349. // the advertiser level before being assigned to the advertiser's ads,
  25350. // creatives, or placements. There is a maximum of 1000 keys per
  25351. // advertiser, out of which a maximum of 20 keys can be assigned per ad,
  25352. // creative, or placement.
  25353. func (r *DynamicTargetingKeysService) Insert(profileId int64, dynamictargetingkey *DynamicTargetingKey) *DynamicTargetingKeysInsertCall {
  25354. c := &DynamicTargetingKeysInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25355. c.profileId = profileId
  25356. c.dynamictargetingkey = dynamictargetingkey
  25357. return c
  25358. }
  25359. // Fields allows partial responses to be retrieved. See
  25360. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25361. // for more information.
  25362. func (c *DynamicTargetingKeysInsertCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysInsertCall {
  25363. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25364. return c
  25365. }
  25366. // Context sets the context to be used in this call's Do method. Any
  25367. // pending HTTP request will be aborted if the provided context is
  25368. // canceled.
  25369. func (c *DynamicTargetingKeysInsertCall) Context(ctx context.Context) *DynamicTargetingKeysInsertCall {
  25370. c.ctx_ = ctx
  25371. return c
  25372. }
  25373. // Header returns an http.Header that can be modified by the caller to
  25374. // add HTTP headers to the request.
  25375. func (c *DynamicTargetingKeysInsertCall) Header() http.Header {
  25376. if c.header_ == nil {
  25377. c.header_ = make(http.Header)
  25378. }
  25379. return c.header_
  25380. }
  25381. func (c *DynamicTargetingKeysInsertCall) doRequest(alt string) (*http.Response, error) {
  25382. reqHeaders := make(http.Header)
  25383. for k, v := range c.header_ {
  25384. reqHeaders[k] = v
  25385. }
  25386. reqHeaders.Set("User-Agent", c.s.userAgent())
  25387. var body io.Reader = nil
  25388. body, err := googleapi.WithoutDataWrapper.JSONReader(c.dynamictargetingkey)
  25389. if err != nil {
  25390. return nil, err
  25391. }
  25392. reqHeaders.Set("Content-Type", "application/json")
  25393. c.urlParams_.Set("alt", alt)
  25394. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  25395. urls += "?" + c.urlParams_.Encode()
  25396. req, _ := http.NewRequest("POST", urls, body)
  25397. req.Header = reqHeaders
  25398. googleapi.Expand(req.URL, map[string]string{
  25399. "profileId": strconv.FormatInt(c.profileId, 10),
  25400. })
  25401. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25402. }
  25403. // Do executes the "dfareporting.dynamicTargetingKeys.insert" call.
  25404. // Exactly one of *DynamicTargetingKey or error will be non-nil. Any
  25405. // non-2xx status code is an error. Response headers are in either
  25406. // *DynamicTargetingKey.ServerResponse.Header or (if a response was
  25407. // returned at all) in error.(*googleapi.Error).Header. Use
  25408. // googleapi.IsNotModified to check whether the returned error was
  25409. // because http.StatusNotModified was returned.
  25410. func (c *DynamicTargetingKeysInsertCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKey, error) {
  25411. gensupport.SetOptions(c.urlParams_, opts...)
  25412. res, err := c.doRequest("json")
  25413. if res != nil && res.StatusCode == http.StatusNotModified {
  25414. if res.Body != nil {
  25415. res.Body.Close()
  25416. }
  25417. return nil, &googleapi.Error{
  25418. Code: res.StatusCode,
  25419. Header: res.Header,
  25420. }
  25421. }
  25422. if err != nil {
  25423. return nil, err
  25424. }
  25425. defer googleapi.CloseBody(res)
  25426. if err := googleapi.CheckResponse(res); err != nil {
  25427. return nil, err
  25428. }
  25429. ret := &DynamicTargetingKey{
  25430. ServerResponse: googleapi.ServerResponse{
  25431. Header: res.Header,
  25432. HTTPStatusCode: res.StatusCode,
  25433. },
  25434. }
  25435. target := &ret
  25436. if err := gensupport.DecodeResponse(target, res); err != nil {
  25437. return nil, err
  25438. }
  25439. return ret, nil
  25440. // {
  25441. // "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.",
  25442. // "httpMethod": "POST",
  25443. // "id": "dfareporting.dynamicTargetingKeys.insert",
  25444. // "parameterOrder": [
  25445. // "profileId"
  25446. // ],
  25447. // "parameters": {
  25448. // "profileId": {
  25449. // "description": "User profile ID associated with this request.",
  25450. // "format": "int64",
  25451. // "location": "path",
  25452. // "required": true,
  25453. // "type": "string"
  25454. // }
  25455. // },
  25456. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  25457. // "request": {
  25458. // "$ref": "DynamicTargetingKey"
  25459. // },
  25460. // "response": {
  25461. // "$ref": "DynamicTargetingKey"
  25462. // },
  25463. // "scopes": [
  25464. // "https://www.googleapis.com/auth/dfatrafficking"
  25465. // ]
  25466. // }
  25467. }
  25468. // method id "dfareporting.dynamicTargetingKeys.list":
  25469. type DynamicTargetingKeysListCall struct {
  25470. s *Service
  25471. profileId int64
  25472. urlParams_ gensupport.URLParams
  25473. ifNoneMatch_ string
  25474. ctx_ context.Context
  25475. header_ http.Header
  25476. }
  25477. // List: Retrieves a list of dynamic targeting keys.
  25478. func (r *DynamicTargetingKeysService) List(profileId int64) *DynamicTargetingKeysListCall {
  25479. c := &DynamicTargetingKeysListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25480. c.profileId = profileId
  25481. return c
  25482. }
  25483. // AdvertiserId sets the optional parameter "advertiserId": Select only
  25484. // dynamic targeting keys whose object has this advertiser ID.
  25485. func (c *DynamicTargetingKeysListCall) AdvertiserId(advertiserId int64) *DynamicTargetingKeysListCall {
  25486. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  25487. return c
  25488. }
  25489. // Names sets the optional parameter "names": Select only dynamic
  25490. // targeting keys exactly matching these names.
  25491. func (c *DynamicTargetingKeysListCall) Names(names ...string) *DynamicTargetingKeysListCall {
  25492. c.urlParams_.SetMulti("names", append([]string{}, names...))
  25493. return c
  25494. }
  25495. // ObjectId sets the optional parameter "objectId": Select only dynamic
  25496. // targeting keys with this object ID.
  25497. func (c *DynamicTargetingKeysListCall) ObjectId(objectId int64) *DynamicTargetingKeysListCall {
  25498. c.urlParams_.Set("objectId", fmt.Sprint(objectId))
  25499. return c
  25500. }
  25501. // ObjectType sets the optional parameter "objectType": Select only
  25502. // dynamic targeting keys with this object type.
  25503. //
  25504. // Possible values:
  25505. // "OBJECT_AD"
  25506. // "OBJECT_ADVERTISER"
  25507. // "OBJECT_CREATIVE"
  25508. // "OBJECT_PLACEMENT"
  25509. func (c *DynamicTargetingKeysListCall) ObjectType(objectType string) *DynamicTargetingKeysListCall {
  25510. c.urlParams_.Set("objectType", objectType)
  25511. return c
  25512. }
  25513. // Fields allows partial responses to be retrieved. See
  25514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25515. // for more information.
  25516. func (c *DynamicTargetingKeysListCall) Fields(s ...googleapi.Field) *DynamicTargetingKeysListCall {
  25517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25518. return c
  25519. }
  25520. // IfNoneMatch sets the optional parameter which makes the operation
  25521. // fail if the object's ETag matches the given value. This is useful for
  25522. // getting updates only after the object has changed since the last
  25523. // request. Use googleapi.IsNotModified to check whether the response
  25524. // error from Do is the result of In-None-Match.
  25525. func (c *DynamicTargetingKeysListCall) IfNoneMatch(entityTag string) *DynamicTargetingKeysListCall {
  25526. c.ifNoneMatch_ = entityTag
  25527. return c
  25528. }
  25529. // Context sets the context to be used in this call's Do method. Any
  25530. // pending HTTP request will be aborted if the provided context is
  25531. // canceled.
  25532. func (c *DynamicTargetingKeysListCall) Context(ctx context.Context) *DynamicTargetingKeysListCall {
  25533. c.ctx_ = ctx
  25534. return c
  25535. }
  25536. // Header returns an http.Header that can be modified by the caller to
  25537. // add HTTP headers to the request.
  25538. func (c *DynamicTargetingKeysListCall) Header() http.Header {
  25539. if c.header_ == nil {
  25540. c.header_ = make(http.Header)
  25541. }
  25542. return c.header_
  25543. }
  25544. func (c *DynamicTargetingKeysListCall) doRequest(alt string) (*http.Response, error) {
  25545. reqHeaders := make(http.Header)
  25546. for k, v := range c.header_ {
  25547. reqHeaders[k] = v
  25548. }
  25549. reqHeaders.Set("User-Agent", c.s.userAgent())
  25550. if c.ifNoneMatch_ != "" {
  25551. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25552. }
  25553. var body io.Reader = nil
  25554. c.urlParams_.Set("alt", alt)
  25555. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/dynamicTargetingKeys")
  25556. urls += "?" + c.urlParams_.Encode()
  25557. req, _ := http.NewRequest("GET", urls, body)
  25558. req.Header = reqHeaders
  25559. googleapi.Expand(req.URL, map[string]string{
  25560. "profileId": strconv.FormatInt(c.profileId, 10),
  25561. })
  25562. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25563. }
  25564. // Do executes the "dfareporting.dynamicTargetingKeys.list" call.
  25565. // Exactly one of *DynamicTargetingKeysListResponse or error will be
  25566. // non-nil. Any non-2xx status code is an error. Response headers are in
  25567. // either *DynamicTargetingKeysListResponse.ServerResponse.Header or (if
  25568. // a response was returned at all) in error.(*googleapi.Error).Header.
  25569. // Use googleapi.IsNotModified to check whether the returned error was
  25570. // because http.StatusNotModified was returned.
  25571. func (c *DynamicTargetingKeysListCall) Do(opts ...googleapi.CallOption) (*DynamicTargetingKeysListResponse, error) {
  25572. gensupport.SetOptions(c.urlParams_, opts...)
  25573. res, err := c.doRequest("json")
  25574. if res != nil && res.StatusCode == http.StatusNotModified {
  25575. if res.Body != nil {
  25576. res.Body.Close()
  25577. }
  25578. return nil, &googleapi.Error{
  25579. Code: res.StatusCode,
  25580. Header: res.Header,
  25581. }
  25582. }
  25583. if err != nil {
  25584. return nil, err
  25585. }
  25586. defer googleapi.CloseBody(res)
  25587. if err := googleapi.CheckResponse(res); err != nil {
  25588. return nil, err
  25589. }
  25590. ret := &DynamicTargetingKeysListResponse{
  25591. ServerResponse: googleapi.ServerResponse{
  25592. Header: res.Header,
  25593. HTTPStatusCode: res.StatusCode,
  25594. },
  25595. }
  25596. target := &ret
  25597. if err := gensupport.DecodeResponse(target, res); err != nil {
  25598. return nil, err
  25599. }
  25600. return ret, nil
  25601. // {
  25602. // "description": "Retrieves a list of dynamic targeting keys.",
  25603. // "httpMethod": "GET",
  25604. // "id": "dfareporting.dynamicTargetingKeys.list",
  25605. // "parameterOrder": [
  25606. // "profileId"
  25607. // ],
  25608. // "parameters": {
  25609. // "advertiserId": {
  25610. // "description": "Select only dynamic targeting keys whose object has this advertiser ID.",
  25611. // "format": "int64",
  25612. // "location": "query",
  25613. // "type": "string"
  25614. // },
  25615. // "names": {
  25616. // "description": "Select only dynamic targeting keys exactly matching these names.",
  25617. // "location": "query",
  25618. // "repeated": true,
  25619. // "type": "string"
  25620. // },
  25621. // "objectId": {
  25622. // "description": "Select only dynamic targeting keys with this object ID.",
  25623. // "format": "int64",
  25624. // "location": "query",
  25625. // "type": "string"
  25626. // },
  25627. // "objectType": {
  25628. // "description": "Select only dynamic targeting keys with this object type.",
  25629. // "enum": [
  25630. // "OBJECT_AD",
  25631. // "OBJECT_ADVERTISER",
  25632. // "OBJECT_CREATIVE",
  25633. // "OBJECT_PLACEMENT"
  25634. // ],
  25635. // "enumDescriptions": [
  25636. // "",
  25637. // "",
  25638. // "",
  25639. // ""
  25640. // ],
  25641. // "location": "query",
  25642. // "type": "string"
  25643. // },
  25644. // "profileId": {
  25645. // "description": "User profile ID associated with this request.",
  25646. // "format": "int64",
  25647. // "location": "path",
  25648. // "required": true,
  25649. // "type": "string"
  25650. // }
  25651. // },
  25652. // "path": "userprofiles/{profileId}/dynamicTargetingKeys",
  25653. // "response": {
  25654. // "$ref": "DynamicTargetingKeysListResponse"
  25655. // },
  25656. // "scopes": [
  25657. // "https://www.googleapis.com/auth/dfatrafficking"
  25658. // ]
  25659. // }
  25660. }
  25661. // method id "dfareporting.eventTags.delete":
  25662. type EventTagsDeleteCall struct {
  25663. s *Service
  25664. profileId int64
  25665. id int64
  25666. urlParams_ gensupport.URLParams
  25667. ctx_ context.Context
  25668. header_ http.Header
  25669. }
  25670. // Delete: Deletes an existing event tag.
  25671. func (r *EventTagsService) Delete(profileId int64, id int64) *EventTagsDeleteCall {
  25672. c := &EventTagsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25673. c.profileId = profileId
  25674. c.id = id
  25675. return c
  25676. }
  25677. // Fields allows partial responses to be retrieved. See
  25678. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25679. // for more information.
  25680. func (c *EventTagsDeleteCall) Fields(s ...googleapi.Field) *EventTagsDeleteCall {
  25681. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25682. return c
  25683. }
  25684. // Context sets the context to be used in this call's Do method. Any
  25685. // pending HTTP request will be aborted if the provided context is
  25686. // canceled.
  25687. func (c *EventTagsDeleteCall) Context(ctx context.Context) *EventTagsDeleteCall {
  25688. c.ctx_ = ctx
  25689. return c
  25690. }
  25691. // Header returns an http.Header that can be modified by the caller to
  25692. // add HTTP headers to the request.
  25693. func (c *EventTagsDeleteCall) Header() http.Header {
  25694. if c.header_ == nil {
  25695. c.header_ = make(http.Header)
  25696. }
  25697. return c.header_
  25698. }
  25699. func (c *EventTagsDeleteCall) doRequest(alt string) (*http.Response, error) {
  25700. reqHeaders := make(http.Header)
  25701. for k, v := range c.header_ {
  25702. reqHeaders[k] = v
  25703. }
  25704. reqHeaders.Set("User-Agent", c.s.userAgent())
  25705. var body io.Reader = nil
  25706. c.urlParams_.Set("alt", alt)
  25707. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  25708. urls += "?" + c.urlParams_.Encode()
  25709. req, _ := http.NewRequest("DELETE", urls, body)
  25710. req.Header = reqHeaders
  25711. googleapi.Expand(req.URL, map[string]string{
  25712. "profileId": strconv.FormatInt(c.profileId, 10),
  25713. "id": strconv.FormatInt(c.id, 10),
  25714. })
  25715. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25716. }
  25717. // Do executes the "dfareporting.eventTags.delete" call.
  25718. func (c *EventTagsDeleteCall) Do(opts ...googleapi.CallOption) error {
  25719. gensupport.SetOptions(c.urlParams_, opts...)
  25720. res, err := c.doRequest("json")
  25721. if err != nil {
  25722. return err
  25723. }
  25724. defer googleapi.CloseBody(res)
  25725. if err := googleapi.CheckResponse(res); err != nil {
  25726. return err
  25727. }
  25728. return nil
  25729. // {
  25730. // "description": "Deletes an existing event tag.",
  25731. // "httpMethod": "DELETE",
  25732. // "id": "dfareporting.eventTags.delete",
  25733. // "parameterOrder": [
  25734. // "profileId",
  25735. // "id"
  25736. // ],
  25737. // "parameters": {
  25738. // "id": {
  25739. // "description": "Event tag ID.",
  25740. // "format": "int64",
  25741. // "location": "path",
  25742. // "required": true,
  25743. // "type": "string"
  25744. // },
  25745. // "profileId": {
  25746. // "description": "User profile ID associated with this request.",
  25747. // "format": "int64",
  25748. // "location": "path",
  25749. // "required": true,
  25750. // "type": "string"
  25751. // }
  25752. // },
  25753. // "path": "userprofiles/{profileId}/eventTags/{id}",
  25754. // "scopes": [
  25755. // "https://www.googleapis.com/auth/dfatrafficking"
  25756. // ]
  25757. // }
  25758. }
  25759. // method id "dfareporting.eventTags.get":
  25760. type EventTagsGetCall struct {
  25761. s *Service
  25762. profileId int64
  25763. id int64
  25764. urlParams_ gensupport.URLParams
  25765. ifNoneMatch_ string
  25766. ctx_ context.Context
  25767. header_ http.Header
  25768. }
  25769. // Get: Gets one event tag by ID.
  25770. func (r *EventTagsService) Get(profileId int64, id int64) *EventTagsGetCall {
  25771. c := &EventTagsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25772. c.profileId = profileId
  25773. c.id = id
  25774. return c
  25775. }
  25776. // Fields allows partial responses to be retrieved. See
  25777. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25778. // for more information.
  25779. func (c *EventTagsGetCall) Fields(s ...googleapi.Field) *EventTagsGetCall {
  25780. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25781. return c
  25782. }
  25783. // IfNoneMatch sets the optional parameter which makes the operation
  25784. // fail if the object's ETag matches the given value. This is useful for
  25785. // getting updates only after the object has changed since the last
  25786. // request. Use googleapi.IsNotModified to check whether the response
  25787. // error from Do is the result of In-None-Match.
  25788. func (c *EventTagsGetCall) IfNoneMatch(entityTag string) *EventTagsGetCall {
  25789. c.ifNoneMatch_ = entityTag
  25790. return c
  25791. }
  25792. // Context sets the context to be used in this call's Do method. Any
  25793. // pending HTTP request will be aborted if the provided context is
  25794. // canceled.
  25795. func (c *EventTagsGetCall) Context(ctx context.Context) *EventTagsGetCall {
  25796. c.ctx_ = ctx
  25797. return c
  25798. }
  25799. // Header returns an http.Header that can be modified by the caller to
  25800. // add HTTP headers to the request.
  25801. func (c *EventTagsGetCall) Header() http.Header {
  25802. if c.header_ == nil {
  25803. c.header_ = make(http.Header)
  25804. }
  25805. return c.header_
  25806. }
  25807. func (c *EventTagsGetCall) doRequest(alt string) (*http.Response, error) {
  25808. reqHeaders := make(http.Header)
  25809. for k, v := range c.header_ {
  25810. reqHeaders[k] = v
  25811. }
  25812. reqHeaders.Set("User-Agent", c.s.userAgent())
  25813. if c.ifNoneMatch_ != "" {
  25814. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  25815. }
  25816. var body io.Reader = nil
  25817. c.urlParams_.Set("alt", alt)
  25818. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags/{id}")
  25819. urls += "?" + c.urlParams_.Encode()
  25820. req, _ := http.NewRequest("GET", urls, body)
  25821. req.Header = reqHeaders
  25822. googleapi.Expand(req.URL, map[string]string{
  25823. "profileId": strconv.FormatInt(c.profileId, 10),
  25824. "id": strconv.FormatInt(c.id, 10),
  25825. })
  25826. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25827. }
  25828. // Do executes the "dfareporting.eventTags.get" call.
  25829. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  25830. // code is an error. Response headers are in either
  25831. // *EventTag.ServerResponse.Header or (if a response was returned at
  25832. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25833. // to check whether the returned error was because
  25834. // http.StatusNotModified was returned.
  25835. func (c *EventTagsGetCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  25836. gensupport.SetOptions(c.urlParams_, opts...)
  25837. res, err := c.doRequest("json")
  25838. if res != nil && res.StatusCode == http.StatusNotModified {
  25839. if res.Body != nil {
  25840. res.Body.Close()
  25841. }
  25842. return nil, &googleapi.Error{
  25843. Code: res.StatusCode,
  25844. Header: res.Header,
  25845. }
  25846. }
  25847. if err != nil {
  25848. return nil, err
  25849. }
  25850. defer googleapi.CloseBody(res)
  25851. if err := googleapi.CheckResponse(res); err != nil {
  25852. return nil, err
  25853. }
  25854. ret := &EventTag{
  25855. ServerResponse: googleapi.ServerResponse{
  25856. Header: res.Header,
  25857. HTTPStatusCode: res.StatusCode,
  25858. },
  25859. }
  25860. target := &ret
  25861. if err := gensupport.DecodeResponse(target, res); err != nil {
  25862. return nil, err
  25863. }
  25864. return ret, nil
  25865. // {
  25866. // "description": "Gets one event tag by ID.",
  25867. // "httpMethod": "GET",
  25868. // "id": "dfareporting.eventTags.get",
  25869. // "parameterOrder": [
  25870. // "profileId",
  25871. // "id"
  25872. // ],
  25873. // "parameters": {
  25874. // "id": {
  25875. // "description": "Event tag ID.",
  25876. // "format": "int64",
  25877. // "location": "path",
  25878. // "required": true,
  25879. // "type": "string"
  25880. // },
  25881. // "profileId": {
  25882. // "description": "User profile ID associated with this request.",
  25883. // "format": "int64",
  25884. // "location": "path",
  25885. // "required": true,
  25886. // "type": "string"
  25887. // }
  25888. // },
  25889. // "path": "userprofiles/{profileId}/eventTags/{id}",
  25890. // "response": {
  25891. // "$ref": "EventTag"
  25892. // },
  25893. // "scopes": [
  25894. // "https://www.googleapis.com/auth/dfatrafficking"
  25895. // ]
  25896. // }
  25897. }
  25898. // method id "dfareporting.eventTags.insert":
  25899. type EventTagsInsertCall struct {
  25900. s *Service
  25901. profileId int64
  25902. eventtag *EventTag
  25903. urlParams_ gensupport.URLParams
  25904. ctx_ context.Context
  25905. header_ http.Header
  25906. }
  25907. // Insert: Inserts a new event tag.
  25908. func (r *EventTagsService) Insert(profileId int64, eventtag *EventTag) *EventTagsInsertCall {
  25909. c := &EventTagsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  25910. c.profileId = profileId
  25911. c.eventtag = eventtag
  25912. return c
  25913. }
  25914. // Fields allows partial responses to be retrieved. See
  25915. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  25916. // for more information.
  25917. func (c *EventTagsInsertCall) Fields(s ...googleapi.Field) *EventTagsInsertCall {
  25918. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  25919. return c
  25920. }
  25921. // Context sets the context to be used in this call's Do method. Any
  25922. // pending HTTP request will be aborted if the provided context is
  25923. // canceled.
  25924. func (c *EventTagsInsertCall) Context(ctx context.Context) *EventTagsInsertCall {
  25925. c.ctx_ = ctx
  25926. return c
  25927. }
  25928. // Header returns an http.Header that can be modified by the caller to
  25929. // add HTTP headers to the request.
  25930. func (c *EventTagsInsertCall) Header() http.Header {
  25931. if c.header_ == nil {
  25932. c.header_ = make(http.Header)
  25933. }
  25934. return c.header_
  25935. }
  25936. func (c *EventTagsInsertCall) doRequest(alt string) (*http.Response, error) {
  25937. reqHeaders := make(http.Header)
  25938. for k, v := range c.header_ {
  25939. reqHeaders[k] = v
  25940. }
  25941. reqHeaders.Set("User-Agent", c.s.userAgent())
  25942. var body io.Reader = nil
  25943. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  25944. if err != nil {
  25945. return nil, err
  25946. }
  25947. reqHeaders.Set("Content-Type", "application/json")
  25948. c.urlParams_.Set("alt", alt)
  25949. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  25950. urls += "?" + c.urlParams_.Encode()
  25951. req, _ := http.NewRequest("POST", urls, body)
  25952. req.Header = reqHeaders
  25953. googleapi.Expand(req.URL, map[string]string{
  25954. "profileId": strconv.FormatInt(c.profileId, 10),
  25955. })
  25956. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  25957. }
  25958. // Do executes the "dfareporting.eventTags.insert" call.
  25959. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  25960. // code is an error. Response headers are in either
  25961. // *EventTag.ServerResponse.Header or (if a response was returned at
  25962. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  25963. // to check whether the returned error was because
  25964. // http.StatusNotModified was returned.
  25965. func (c *EventTagsInsertCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  25966. gensupport.SetOptions(c.urlParams_, opts...)
  25967. res, err := c.doRequest("json")
  25968. if res != nil && res.StatusCode == http.StatusNotModified {
  25969. if res.Body != nil {
  25970. res.Body.Close()
  25971. }
  25972. return nil, &googleapi.Error{
  25973. Code: res.StatusCode,
  25974. Header: res.Header,
  25975. }
  25976. }
  25977. if err != nil {
  25978. return nil, err
  25979. }
  25980. defer googleapi.CloseBody(res)
  25981. if err := googleapi.CheckResponse(res); err != nil {
  25982. return nil, err
  25983. }
  25984. ret := &EventTag{
  25985. ServerResponse: googleapi.ServerResponse{
  25986. Header: res.Header,
  25987. HTTPStatusCode: res.StatusCode,
  25988. },
  25989. }
  25990. target := &ret
  25991. if err := gensupport.DecodeResponse(target, res); err != nil {
  25992. return nil, err
  25993. }
  25994. return ret, nil
  25995. // {
  25996. // "description": "Inserts a new event tag.",
  25997. // "httpMethod": "POST",
  25998. // "id": "dfareporting.eventTags.insert",
  25999. // "parameterOrder": [
  26000. // "profileId"
  26001. // ],
  26002. // "parameters": {
  26003. // "profileId": {
  26004. // "description": "User profile ID associated with this request.",
  26005. // "format": "int64",
  26006. // "location": "path",
  26007. // "required": true,
  26008. // "type": "string"
  26009. // }
  26010. // },
  26011. // "path": "userprofiles/{profileId}/eventTags",
  26012. // "request": {
  26013. // "$ref": "EventTag"
  26014. // },
  26015. // "response": {
  26016. // "$ref": "EventTag"
  26017. // },
  26018. // "scopes": [
  26019. // "https://www.googleapis.com/auth/dfatrafficking"
  26020. // ]
  26021. // }
  26022. }
  26023. // method id "dfareporting.eventTags.list":
  26024. type EventTagsListCall struct {
  26025. s *Service
  26026. profileId int64
  26027. urlParams_ gensupport.URLParams
  26028. ifNoneMatch_ string
  26029. ctx_ context.Context
  26030. header_ http.Header
  26031. }
  26032. // List: Retrieves a list of event tags, possibly filtered.
  26033. func (r *EventTagsService) List(profileId int64) *EventTagsListCall {
  26034. c := &EventTagsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26035. c.profileId = profileId
  26036. return c
  26037. }
  26038. // AdId sets the optional parameter "adId": Select only event tags that
  26039. // belong to this ad.
  26040. func (c *EventTagsListCall) AdId(adId int64) *EventTagsListCall {
  26041. c.urlParams_.Set("adId", fmt.Sprint(adId))
  26042. return c
  26043. }
  26044. // AdvertiserId sets the optional parameter "advertiserId": Select only
  26045. // event tags that belong to this advertiser.
  26046. func (c *EventTagsListCall) AdvertiserId(advertiserId int64) *EventTagsListCall {
  26047. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  26048. return c
  26049. }
  26050. // CampaignId sets the optional parameter "campaignId": Select only
  26051. // event tags that belong to this campaign.
  26052. func (c *EventTagsListCall) CampaignId(campaignId int64) *EventTagsListCall {
  26053. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  26054. return c
  26055. }
  26056. // DefinitionsOnly sets the optional parameter "definitionsOnly":
  26057. // Examine only the specified campaign or advertiser's event tags for
  26058. // matching selector criteria. When set to false, the parent advertiser
  26059. // and parent campaign of the specified ad or campaign is examined as
  26060. // well. In addition, when set to false, the status field is examined as
  26061. // well, along with the enabledByDefault field. This parameter can not
  26062. // be set to true when adId is specified as ads do not define their own
  26063. // even tags.
  26064. func (c *EventTagsListCall) DefinitionsOnly(definitionsOnly bool) *EventTagsListCall {
  26065. c.urlParams_.Set("definitionsOnly", fmt.Sprint(definitionsOnly))
  26066. return c
  26067. }
  26068. // Enabled sets the optional parameter "enabled": Select only enabled
  26069. // event tags. What is considered enabled or disabled depends on the
  26070. // definitionsOnly parameter. When definitionsOnly is set to true, only
  26071. // the specified advertiser or campaign's event tags' enabledByDefault
  26072. // field is examined. When definitionsOnly is set to false, the
  26073. // specified ad or specified campaign's parent advertiser's or parent
  26074. // campaign's event tags' enabledByDefault and status fields are
  26075. // examined as well.
  26076. func (c *EventTagsListCall) Enabled(enabled bool) *EventTagsListCall {
  26077. c.urlParams_.Set("enabled", fmt.Sprint(enabled))
  26078. return c
  26079. }
  26080. // EventTagTypes sets the optional parameter "eventTagTypes": Select
  26081. // only event tags with the specified event tag types. Event tag types
  26082. // can be used to specify whether to use a third-party pixel, a
  26083. // third-party JavaScript URL, or a third-party click-through URL for
  26084. // either impression or click tracking.
  26085. //
  26086. // Possible values:
  26087. // "CLICK_THROUGH_EVENT_TAG"
  26088. // "IMPRESSION_IMAGE_EVENT_TAG"
  26089. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  26090. func (c *EventTagsListCall) EventTagTypes(eventTagTypes ...string) *EventTagsListCall {
  26091. c.urlParams_.SetMulti("eventTagTypes", append([]string{}, eventTagTypes...))
  26092. return c
  26093. }
  26094. // Ids sets the optional parameter "ids": Select only event tags with
  26095. // these IDs.
  26096. func (c *EventTagsListCall) Ids(ids ...int64) *EventTagsListCall {
  26097. var ids_ []string
  26098. for _, v := range ids {
  26099. ids_ = append(ids_, fmt.Sprint(v))
  26100. }
  26101. c.urlParams_.SetMulti("ids", ids_)
  26102. return c
  26103. }
  26104. // SearchString sets the optional parameter "searchString": Allows
  26105. // searching for objects by name or ID. Wildcards (*) are allowed. For
  26106. // example, "eventtag*2015" will return objects with names like
  26107. // "eventtag June 2015", "eventtag April 2015", or simply "eventtag
  26108. // 2015". Most of the searches also add wildcards implicitly at the
  26109. // start and the end of the search string. For example, a search string
  26110. // of "eventtag" will match objects with name "my eventtag", "eventtag
  26111. // 2015", or simply "eventtag".
  26112. func (c *EventTagsListCall) SearchString(searchString string) *EventTagsListCall {
  26113. c.urlParams_.Set("searchString", searchString)
  26114. return c
  26115. }
  26116. // SortField sets the optional parameter "sortField": Field by which to
  26117. // sort the list.
  26118. //
  26119. // Possible values:
  26120. // "ID" (default)
  26121. // "NAME"
  26122. func (c *EventTagsListCall) SortField(sortField string) *EventTagsListCall {
  26123. c.urlParams_.Set("sortField", sortField)
  26124. return c
  26125. }
  26126. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26127. // results.
  26128. //
  26129. // Possible values:
  26130. // "ASCENDING" (default)
  26131. // "DESCENDING"
  26132. func (c *EventTagsListCall) SortOrder(sortOrder string) *EventTagsListCall {
  26133. c.urlParams_.Set("sortOrder", sortOrder)
  26134. return c
  26135. }
  26136. // Fields allows partial responses to be retrieved. See
  26137. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26138. // for more information.
  26139. func (c *EventTagsListCall) Fields(s ...googleapi.Field) *EventTagsListCall {
  26140. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26141. return c
  26142. }
  26143. // IfNoneMatch sets the optional parameter which makes the operation
  26144. // fail if the object's ETag matches the given value. This is useful for
  26145. // getting updates only after the object has changed since the last
  26146. // request. Use googleapi.IsNotModified to check whether the response
  26147. // error from Do is the result of In-None-Match.
  26148. func (c *EventTagsListCall) IfNoneMatch(entityTag string) *EventTagsListCall {
  26149. c.ifNoneMatch_ = entityTag
  26150. return c
  26151. }
  26152. // Context sets the context to be used in this call's Do method. Any
  26153. // pending HTTP request will be aborted if the provided context is
  26154. // canceled.
  26155. func (c *EventTagsListCall) Context(ctx context.Context) *EventTagsListCall {
  26156. c.ctx_ = ctx
  26157. return c
  26158. }
  26159. // Header returns an http.Header that can be modified by the caller to
  26160. // add HTTP headers to the request.
  26161. func (c *EventTagsListCall) Header() http.Header {
  26162. if c.header_ == nil {
  26163. c.header_ = make(http.Header)
  26164. }
  26165. return c.header_
  26166. }
  26167. func (c *EventTagsListCall) doRequest(alt string) (*http.Response, error) {
  26168. reqHeaders := make(http.Header)
  26169. for k, v := range c.header_ {
  26170. reqHeaders[k] = v
  26171. }
  26172. reqHeaders.Set("User-Agent", c.s.userAgent())
  26173. if c.ifNoneMatch_ != "" {
  26174. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26175. }
  26176. var body io.Reader = nil
  26177. c.urlParams_.Set("alt", alt)
  26178. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  26179. urls += "?" + c.urlParams_.Encode()
  26180. req, _ := http.NewRequest("GET", urls, body)
  26181. req.Header = reqHeaders
  26182. googleapi.Expand(req.URL, map[string]string{
  26183. "profileId": strconv.FormatInt(c.profileId, 10),
  26184. })
  26185. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26186. }
  26187. // Do executes the "dfareporting.eventTags.list" call.
  26188. // Exactly one of *EventTagsListResponse or error will be non-nil. Any
  26189. // non-2xx status code is an error. Response headers are in either
  26190. // *EventTagsListResponse.ServerResponse.Header or (if a response was
  26191. // returned at all) in error.(*googleapi.Error).Header. Use
  26192. // googleapi.IsNotModified to check whether the returned error was
  26193. // because http.StatusNotModified was returned.
  26194. func (c *EventTagsListCall) Do(opts ...googleapi.CallOption) (*EventTagsListResponse, error) {
  26195. gensupport.SetOptions(c.urlParams_, opts...)
  26196. res, err := c.doRequest("json")
  26197. if res != nil && res.StatusCode == http.StatusNotModified {
  26198. if res.Body != nil {
  26199. res.Body.Close()
  26200. }
  26201. return nil, &googleapi.Error{
  26202. Code: res.StatusCode,
  26203. Header: res.Header,
  26204. }
  26205. }
  26206. if err != nil {
  26207. return nil, err
  26208. }
  26209. defer googleapi.CloseBody(res)
  26210. if err := googleapi.CheckResponse(res); err != nil {
  26211. return nil, err
  26212. }
  26213. ret := &EventTagsListResponse{
  26214. ServerResponse: googleapi.ServerResponse{
  26215. Header: res.Header,
  26216. HTTPStatusCode: res.StatusCode,
  26217. },
  26218. }
  26219. target := &ret
  26220. if err := gensupport.DecodeResponse(target, res); err != nil {
  26221. return nil, err
  26222. }
  26223. return ret, nil
  26224. // {
  26225. // "description": "Retrieves a list of event tags, possibly filtered.",
  26226. // "httpMethod": "GET",
  26227. // "id": "dfareporting.eventTags.list",
  26228. // "parameterOrder": [
  26229. // "profileId"
  26230. // ],
  26231. // "parameters": {
  26232. // "adId": {
  26233. // "description": "Select only event tags that belong to this ad.",
  26234. // "format": "int64",
  26235. // "location": "query",
  26236. // "type": "string"
  26237. // },
  26238. // "advertiserId": {
  26239. // "description": "Select only event tags that belong to this advertiser.",
  26240. // "format": "int64",
  26241. // "location": "query",
  26242. // "type": "string"
  26243. // },
  26244. // "campaignId": {
  26245. // "description": "Select only event tags that belong to this campaign.",
  26246. // "format": "int64",
  26247. // "location": "query",
  26248. // "type": "string"
  26249. // },
  26250. // "definitionsOnly": {
  26251. // "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.",
  26252. // "location": "query",
  26253. // "type": "boolean"
  26254. // },
  26255. // "enabled": {
  26256. // "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.",
  26257. // "location": "query",
  26258. // "type": "boolean"
  26259. // },
  26260. // "eventTagTypes": {
  26261. // "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.",
  26262. // "enum": [
  26263. // "CLICK_THROUGH_EVENT_TAG",
  26264. // "IMPRESSION_IMAGE_EVENT_TAG",
  26265. // "IMPRESSION_JAVASCRIPT_EVENT_TAG"
  26266. // ],
  26267. // "enumDescriptions": [
  26268. // "",
  26269. // "",
  26270. // ""
  26271. // ],
  26272. // "location": "query",
  26273. // "repeated": true,
  26274. // "type": "string"
  26275. // },
  26276. // "ids": {
  26277. // "description": "Select only event tags with these IDs.",
  26278. // "format": "int64",
  26279. // "location": "query",
  26280. // "repeated": true,
  26281. // "type": "string"
  26282. // },
  26283. // "profileId": {
  26284. // "description": "User profile ID associated with this request.",
  26285. // "format": "int64",
  26286. // "location": "path",
  26287. // "required": true,
  26288. // "type": "string"
  26289. // },
  26290. // "searchString": {
  26291. // "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\".",
  26292. // "location": "query",
  26293. // "type": "string"
  26294. // },
  26295. // "sortField": {
  26296. // "default": "ID",
  26297. // "description": "Field by which to sort the list.",
  26298. // "enum": [
  26299. // "ID",
  26300. // "NAME"
  26301. // ],
  26302. // "enumDescriptions": [
  26303. // "",
  26304. // ""
  26305. // ],
  26306. // "location": "query",
  26307. // "type": "string"
  26308. // },
  26309. // "sortOrder": {
  26310. // "default": "ASCENDING",
  26311. // "description": "Order of sorted results.",
  26312. // "enum": [
  26313. // "ASCENDING",
  26314. // "DESCENDING"
  26315. // ],
  26316. // "enumDescriptions": [
  26317. // "",
  26318. // ""
  26319. // ],
  26320. // "location": "query",
  26321. // "type": "string"
  26322. // }
  26323. // },
  26324. // "path": "userprofiles/{profileId}/eventTags",
  26325. // "response": {
  26326. // "$ref": "EventTagsListResponse"
  26327. // },
  26328. // "scopes": [
  26329. // "https://www.googleapis.com/auth/dfatrafficking"
  26330. // ]
  26331. // }
  26332. }
  26333. // method id "dfareporting.eventTags.patch":
  26334. type EventTagsPatchCall struct {
  26335. s *Service
  26336. profileId int64
  26337. eventtag *EventTag
  26338. urlParams_ gensupport.URLParams
  26339. ctx_ context.Context
  26340. header_ http.Header
  26341. }
  26342. // Patch: Updates an existing event tag. This method supports patch
  26343. // semantics.
  26344. func (r *EventTagsService) Patch(profileId int64, id int64, eventtag *EventTag) *EventTagsPatchCall {
  26345. c := &EventTagsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26346. c.profileId = profileId
  26347. c.urlParams_.Set("id", fmt.Sprint(id))
  26348. c.eventtag = eventtag
  26349. return c
  26350. }
  26351. // Fields allows partial responses to be retrieved. See
  26352. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26353. // for more information.
  26354. func (c *EventTagsPatchCall) Fields(s ...googleapi.Field) *EventTagsPatchCall {
  26355. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26356. return c
  26357. }
  26358. // Context sets the context to be used in this call's Do method. Any
  26359. // pending HTTP request will be aborted if the provided context is
  26360. // canceled.
  26361. func (c *EventTagsPatchCall) Context(ctx context.Context) *EventTagsPatchCall {
  26362. c.ctx_ = ctx
  26363. return c
  26364. }
  26365. // Header returns an http.Header that can be modified by the caller to
  26366. // add HTTP headers to the request.
  26367. func (c *EventTagsPatchCall) Header() http.Header {
  26368. if c.header_ == nil {
  26369. c.header_ = make(http.Header)
  26370. }
  26371. return c.header_
  26372. }
  26373. func (c *EventTagsPatchCall) doRequest(alt string) (*http.Response, error) {
  26374. reqHeaders := make(http.Header)
  26375. for k, v := range c.header_ {
  26376. reqHeaders[k] = v
  26377. }
  26378. reqHeaders.Set("User-Agent", c.s.userAgent())
  26379. var body io.Reader = nil
  26380. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  26381. if err != nil {
  26382. return nil, err
  26383. }
  26384. reqHeaders.Set("Content-Type", "application/json")
  26385. c.urlParams_.Set("alt", alt)
  26386. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  26387. urls += "?" + c.urlParams_.Encode()
  26388. req, _ := http.NewRequest("PATCH", urls, body)
  26389. req.Header = reqHeaders
  26390. googleapi.Expand(req.URL, map[string]string{
  26391. "profileId": strconv.FormatInt(c.profileId, 10),
  26392. })
  26393. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26394. }
  26395. // Do executes the "dfareporting.eventTags.patch" call.
  26396. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  26397. // code is an error. Response headers are in either
  26398. // *EventTag.ServerResponse.Header or (if a response was returned at
  26399. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26400. // to check whether the returned error was because
  26401. // http.StatusNotModified was returned.
  26402. func (c *EventTagsPatchCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  26403. gensupport.SetOptions(c.urlParams_, opts...)
  26404. res, err := c.doRequest("json")
  26405. if res != nil && res.StatusCode == http.StatusNotModified {
  26406. if res.Body != nil {
  26407. res.Body.Close()
  26408. }
  26409. return nil, &googleapi.Error{
  26410. Code: res.StatusCode,
  26411. Header: res.Header,
  26412. }
  26413. }
  26414. if err != nil {
  26415. return nil, err
  26416. }
  26417. defer googleapi.CloseBody(res)
  26418. if err := googleapi.CheckResponse(res); err != nil {
  26419. return nil, err
  26420. }
  26421. ret := &EventTag{
  26422. ServerResponse: googleapi.ServerResponse{
  26423. Header: res.Header,
  26424. HTTPStatusCode: res.StatusCode,
  26425. },
  26426. }
  26427. target := &ret
  26428. if err := gensupport.DecodeResponse(target, res); err != nil {
  26429. return nil, err
  26430. }
  26431. return ret, nil
  26432. // {
  26433. // "description": "Updates an existing event tag. This method supports patch semantics.",
  26434. // "httpMethod": "PATCH",
  26435. // "id": "dfareporting.eventTags.patch",
  26436. // "parameterOrder": [
  26437. // "profileId",
  26438. // "id"
  26439. // ],
  26440. // "parameters": {
  26441. // "id": {
  26442. // "description": "Event tag ID.",
  26443. // "format": "int64",
  26444. // "location": "query",
  26445. // "required": true,
  26446. // "type": "string"
  26447. // },
  26448. // "profileId": {
  26449. // "description": "User profile ID associated with this request.",
  26450. // "format": "int64",
  26451. // "location": "path",
  26452. // "required": true,
  26453. // "type": "string"
  26454. // }
  26455. // },
  26456. // "path": "userprofiles/{profileId}/eventTags",
  26457. // "request": {
  26458. // "$ref": "EventTag"
  26459. // },
  26460. // "response": {
  26461. // "$ref": "EventTag"
  26462. // },
  26463. // "scopes": [
  26464. // "https://www.googleapis.com/auth/dfatrafficking"
  26465. // ]
  26466. // }
  26467. }
  26468. // method id "dfareporting.eventTags.update":
  26469. type EventTagsUpdateCall struct {
  26470. s *Service
  26471. profileId int64
  26472. eventtag *EventTag
  26473. urlParams_ gensupport.URLParams
  26474. ctx_ context.Context
  26475. header_ http.Header
  26476. }
  26477. // Update: Updates an existing event tag.
  26478. func (r *EventTagsService) Update(profileId int64, eventtag *EventTag) *EventTagsUpdateCall {
  26479. c := &EventTagsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26480. c.profileId = profileId
  26481. c.eventtag = eventtag
  26482. return c
  26483. }
  26484. // Fields allows partial responses to be retrieved. See
  26485. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26486. // for more information.
  26487. func (c *EventTagsUpdateCall) Fields(s ...googleapi.Field) *EventTagsUpdateCall {
  26488. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26489. return c
  26490. }
  26491. // Context sets the context to be used in this call's Do method. Any
  26492. // pending HTTP request will be aborted if the provided context is
  26493. // canceled.
  26494. func (c *EventTagsUpdateCall) Context(ctx context.Context) *EventTagsUpdateCall {
  26495. c.ctx_ = ctx
  26496. return c
  26497. }
  26498. // Header returns an http.Header that can be modified by the caller to
  26499. // add HTTP headers to the request.
  26500. func (c *EventTagsUpdateCall) Header() http.Header {
  26501. if c.header_ == nil {
  26502. c.header_ = make(http.Header)
  26503. }
  26504. return c.header_
  26505. }
  26506. func (c *EventTagsUpdateCall) doRequest(alt string) (*http.Response, error) {
  26507. reqHeaders := make(http.Header)
  26508. for k, v := range c.header_ {
  26509. reqHeaders[k] = v
  26510. }
  26511. reqHeaders.Set("User-Agent", c.s.userAgent())
  26512. var body io.Reader = nil
  26513. body, err := googleapi.WithoutDataWrapper.JSONReader(c.eventtag)
  26514. if err != nil {
  26515. return nil, err
  26516. }
  26517. reqHeaders.Set("Content-Type", "application/json")
  26518. c.urlParams_.Set("alt", alt)
  26519. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/eventTags")
  26520. urls += "?" + c.urlParams_.Encode()
  26521. req, _ := http.NewRequest("PUT", urls, body)
  26522. req.Header = reqHeaders
  26523. googleapi.Expand(req.URL, map[string]string{
  26524. "profileId": strconv.FormatInt(c.profileId, 10),
  26525. })
  26526. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26527. }
  26528. // Do executes the "dfareporting.eventTags.update" call.
  26529. // Exactly one of *EventTag or error will be non-nil. Any non-2xx status
  26530. // code is an error. Response headers are in either
  26531. // *EventTag.ServerResponse.Header or (if a response was returned at
  26532. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26533. // to check whether the returned error was because
  26534. // http.StatusNotModified was returned.
  26535. func (c *EventTagsUpdateCall) Do(opts ...googleapi.CallOption) (*EventTag, error) {
  26536. gensupport.SetOptions(c.urlParams_, opts...)
  26537. res, err := c.doRequest("json")
  26538. if res != nil && res.StatusCode == http.StatusNotModified {
  26539. if res.Body != nil {
  26540. res.Body.Close()
  26541. }
  26542. return nil, &googleapi.Error{
  26543. Code: res.StatusCode,
  26544. Header: res.Header,
  26545. }
  26546. }
  26547. if err != nil {
  26548. return nil, err
  26549. }
  26550. defer googleapi.CloseBody(res)
  26551. if err := googleapi.CheckResponse(res); err != nil {
  26552. return nil, err
  26553. }
  26554. ret := &EventTag{
  26555. ServerResponse: googleapi.ServerResponse{
  26556. Header: res.Header,
  26557. HTTPStatusCode: res.StatusCode,
  26558. },
  26559. }
  26560. target := &ret
  26561. if err := gensupport.DecodeResponse(target, res); err != nil {
  26562. return nil, err
  26563. }
  26564. return ret, nil
  26565. // {
  26566. // "description": "Updates an existing event tag.",
  26567. // "httpMethod": "PUT",
  26568. // "id": "dfareporting.eventTags.update",
  26569. // "parameterOrder": [
  26570. // "profileId"
  26571. // ],
  26572. // "parameters": {
  26573. // "profileId": {
  26574. // "description": "User profile ID associated with this request.",
  26575. // "format": "int64",
  26576. // "location": "path",
  26577. // "required": true,
  26578. // "type": "string"
  26579. // }
  26580. // },
  26581. // "path": "userprofiles/{profileId}/eventTags",
  26582. // "request": {
  26583. // "$ref": "EventTag"
  26584. // },
  26585. // "response": {
  26586. // "$ref": "EventTag"
  26587. // },
  26588. // "scopes": [
  26589. // "https://www.googleapis.com/auth/dfatrafficking"
  26590. // ]
  26591. // }
  26592. }
  26593. // method id "dfareporting.files.get":
  26594. type FilesGetCall struct {
  26595. s *Service
  26596. reportId int64
  26597. fileId int64
  26598. urlParams_ gensupport.URLParams
  26599. ifNoneMatch_ string
  26600. ctx_ context.Context
  26601. header_ http.Header
  26602. }
  26603. // Get: Retrieves a report file by its report ID and file ID. This
  26604. // method supports media download.
  26605. func (r *FilesService) Get(reportId int64, fileId int64) *FilesGetCall {
  26606. c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26607. c.reportId = reportId
  26608. c.fileId = fileId
  26609. return c
  26610. }
  26611. // Fields allows partial responses to be retrieved. See
  26612. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26613. // for more information.
  26614. func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
  26615. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26616. return c
  26617. }
  26618. // IfNoneMatch sets the optional parameter which makes the operation
  26619. // fail if the object's ETag matches the given value. This is useful for
  26620. // getting updates only after the object has changed since the last
  26621. // request. Use googleapi.IsNotModified to check whether the response
  26622. // error from Do is the result of In-None-Match.
  26623. func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
  26624. c.ifNoneMatch_ = entityTag
  26625. return c
  26626. }
  26627. // Context sets the context to be used in this call's Do and Download
  26628. // methods. Any pending HTTP request will be aborted if the provided
  26629. // context is canceled.
  26630. func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
  26631. c.ctx_ = ctx
  26632. return c
  26633. }
  26634. // Header returns an http.Header that can be modified by the caller to
  26635. // add HTTP headers to the request.
  26636. func (c *FilesGetCall) Header() http.Header {
  26637. if c.header_ == nil {
  26638. c.header_ = make(http.Header)
  26639. }
  26640. return c.header_
  26641. }
  26642. func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
  26643. reqHeaders := make(http.Header)
  26644. for k, v := range c.header_ {
  26645. reqHeaders[k] = v
  26646. }
  26647. reqHeaders.Set("User-Agent", c.s.userAgent())
  26648. if c.ifNoneMatch_ != "" {
  26649. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26650. }
  26651. var body io.Reader = nil
  26652. c.urlParams_.Set("alt", alt)
  26653. urls := googleapi.ResolveRelative(c.s.BasePath, "reports/{reportId}/files/{fileId}")
  26654. urls += "?" + c.urlParams_.Encode()
  26655. req, _ := http.NewRequest("GET", urls, body)
  26656. req.Header = reqHeaders
  26657. googleapi.Expand(req.URL, map[string]string{
  26658. "reportId": strconv.FormatInt(c.reportId, 10),
  26659. "fileId": strconv.FormatInt(c.fileId, 10),
  26660. })
  26661. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26662. }
  26663. // Download fetches the API endpoint's "media" value, instead of the normal
  26664. // API response value. If the returned error is nil, the Response is guaranteed to
  26665. // have a 2xx status code. Callers must close the Response.Body as usual.
  26666. func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  26667. gensupport.SetOptions(c.urlParams_, opts...)
  26668. res, err := c.doRequest("media")
  26669. if err != nil {
  26670. return nil, err
  26671. }
  26672. if err := googleapi.CheckMediaResponse(res); err != nil {
  26673. res.Body.Close()
  26674. return nil, err
  26675. }
  26676. return res, nil
  26677. }
  26678. // Do executes the "dfareporting.files.get" call.
  26679. // Exactly one of *File or error will be non-nil. Any non-2xx status
  26680. // code is an error. Response headers are in either
  26681. // *File.ServerResponse.Header or (if a response was returned at all) in
  26682. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  26683. // whether the returned error was because http.StatusNotModified was
  26684. // returned.
  26685. func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  26686. gensupport.SetOptions(c.urlParams_, opts...)
  26687. res, err := c.doRequest("json")
  26688. if res != nil && res.StatusCode == http.StatusNotModified {
  26689. if res.Body != nil {
  26690. res.Body.Close()
  26691. }
  26692. return nil, &googleapi.Error{
  26693. Code: res.StatusCode,
  26694. Header: res.Header,
  26695. }
  26696. }
  26697. if err != nil {
  26698. return nil, err
  26699. }
  26700. defer googleapi.CloseBody(res)
  26701. if err := googleapi.CheckResponse(res); err != nil {
  26702. return nil, err
  26703. }
  26704. ret := &File{
  26705. ServerResponse: googleapi.ServerResponse{
  26706. Header: res.Header,
  26707. HTTPStatusCode: res.StatusCode,
  26708. },
  26709. }
  26710. target := &ret
  26711. if err := gensupport.DecodeResponse(target, res); err != nil {
  26712. return nil, err
  26713. }
  26714. return ret, nil
  26715. // {
  26716. // "description": "Retrieves a report file by its report ID and file ID. This method supports media download.",
  26717. // "httpMethod": "GET",
  26718. // "id": "dfareporting.files.get",
  26719. // "parameterOrder": [
  26720. // "reportId",
  26721. // "fileId"
  26722. // ],
  26723. // "parameters": {
  26724. // "fileId": {
  26725. // "description": "The ID of the report file.",
  26726. // "format": "int64",
  26727. // "location": "path",
  26728. // "required": true,
  26729. // "type": "string"
  26730. // },
  26731. // "reportId": {
  26732. // "description": "The ID of the report.",
  26733. // "format": "int64",
  26734. // "location": "path",
  26735. // "required": true,
  26736. // "type": "string"
  26737. // }
  26738. // },
  26739. // "path": "reports/{reportId}/files/{fileId}",
  26740. // "response": {
  26741. // "$ref": "File"
  26742. // },
  26743. // "scopes": [
  26744. // "https://www.googleapis.com/auth/dfareporting"
  26745. // ],
  26746. // "supportsMediaDownload": true
  26747. // }
  26748. }
  26749. // method id "dfareporting.files.list":
  26750. type FilesListCall struct {
  26751. s *Service
  26752. profileId int64
  26753. urlParams_ gensupport.URLParams
  26754. ifNoneMatch_ string
  26755. ctx_ context.Context
  26756. header_ http.Header
  26757. }
  26758. // List: Lists files for a user profile.
  26759. func (r *FilesService) List(profileId int64) *FilesListCall {
  26760. c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  26761. c.profileId = profileId
  26762. return c
  26763. }
  26764. // MaxResults sets the optional parameter "maxResults": Maximum number
  26765. // of results to return.
  26766. func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall {
  26767. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  26768. return c
  26769. }
  26770. // PageToken sets the optional parameter "pageToken": The value of the
  26771. // nextToken from the previous result page.
  26772. func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
  26773. c.urlParams_.Set("pageToken", pageToken)
  26774. return c
  26775. }
  26776. // Scope sets the optional parameter "scope": The scope that defines
  26777. // which results are returned.
  26778. //
  26779. // Possible values:
  26780. // "ALL" - All files in account.
  26781. // "MINE" (default) - My files.
  26782. // "SHARED_WITH_ME" - Files shared with me.
  26783. func (c *FilesListCall) Scope(scope string) *FilesListCall {
  26784. c.urlParams_.Set("scope", scope)
  26785. return c
  26786. }
  26787. // SortField sets the optional parameter "sortField": The field by which
  26788. // to sort the list.
  26789. //
  26790. // Possible values:
  26791. // "ID" - Sort by file ID.
  26792. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  26793. func (c *FilesListCall) SortField(sortField string) *FilesListCall {
  26794. c.urlParams_.Set("sortField", sortField)
  26795. return c
  26796. }
  26797. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  26798. // results.
  26799. //
  26800. // Possible values:
  26801. // "ASCENDING" - Ascending order.
  26802. // "DESCENDING" (default) - Descending order.
  26803. func (c *FilesListCall) SortOrder(sortOrder string) *FilesListCall {
  26804. c.urlParams_.Set("sortOrder", sortOrder)
  26805. return c
  26806. }
  26807. // Fields allows partial responses to be retrieved. See
  26808. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  26809. // for more information.
  26810. func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
  26811. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  26812. return c
  26813. }
  26814. // IfNoneMatch sets the optional parameter which makes the operation
  26815. // fail if the object's ETag matches the given value. This is useful for
  26816. // getting updates only after the object has changed since the last
  26817. // request. Use googleapi.IsNotModified to check whether the response
  26818. // error from Do is the result of In-None-Match.
  26819. func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
  26820. c.ifNoneMatch_ = entityTag
  26821. return c
  26822. }
  26823. // Context sets the context to be used in this call's Do method. Any
  26824. // pending HTTP request will be aborted if the provided context is
  26825. // canceled.
  26826. func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
  26827. c.ctx_ = ctx
  26828. return c
  26829. }
  26830. // Header returns an http.Header that can be modified by the caller to
  26831. // add HTTP headers to the request.
  26832. func (c *FilesListCall) Header() http.Header {
  26833. if c.header_ == nil {
  26834. c.header_ = make(http.Header)
  26835. }
  26836. return c.header_
  26837. }
  26838. func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
  26839. reqHeaders := make(http.Header)
  26840. for k, v := range c.header_ {
  26841. reqHeaders[k] = v
  26842. }
  26843. reqHeaders.Set("User-Agent", c.s.userAgent())
  26844. if c.ifNoneMatch_ != "" {
  26845. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  26846. }
  26847. var body io.Reader = nil
  26848. c.urlParams_.Set("alt", alt)
  26849. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/files")
  26850. urls += "?" + c.urlParams_.Encode()
  26851. req, _ := http.NewRequest("GET", urls, body)
  26852. req.Header = reqHeaders
  26853. googleapi.Expand(req.URL, map[string]string{
  26854. "profileId": strconv.FormatInt(c.profileId, 10),
  26855. })
  26856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  26857. }
  26858. // Do executes the "dfareporting.files.list" call.
  26859. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  26860. // code is an error. Response headers are in either
  26861. // *FileList.ServerResponse.Header or (if a response was returned at
  26862. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  26863. // to check whether the returned error was because
  26864. // http.StatusNotModified was returned.
  26865. func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  26866. gensupport.SetOptions(c.urlParams_, opts...)
  26867. res, err := c.doRequest("json")
  26868. if res != nil && res.StatusCode == http.StatusNotModified {
  26869. if res.Body != nil {
  26870. res.Body.Close()
  26871. }
  26872. return nil, &googleapi.Error{
  26873. Code: res.StatusCode,
  26874. Header: res.Header,
  26875. }
  26876. }
  26877. if err != nil {
  26878. return nil, err
  26879. }
  26880. defer googleapi.CloseBody(res)
  26881. if err := googleapi.CheckResponse(res); err != nil {
  26882. return nil, err
  26883. }
  26884. ret := &FileList{
  26885. ServerResponse: googleapi.ServerResponse{
  26886. Header: res.Header,
  26887. HTTPStatusCode: res.StatusCode,
  26888. },
  26889. }
  26890. target := &ret
  26891. if err := gensupport.DecodeResponse(target, res); err != nil {
  26892. return nil, err
  26893. }
  26894. return ret, nil
  26895. // {
  26896. // "description": "Lists files for a user profile.",
  26897. // "httpMethod": "GET",
  26898. // "id": "dfareporting.files.list",
  26899. // "parameterOrder": [
  26900. // "profileId"
  26901. // ],
  26902. // "parameters": {
  26903. // "maxResults": {
  26904. // "default": "10",
  26905. // "description": "Maximum number of results to return.",
  26906. // "format": "int32",
  26907. // "location": "query",
  26908. // "maximum": "10",
  26909. // "minimum": "0",
  26910. // "type": "integer"
  26911. // },
  26912. // "pageToken": {
  26913. // "description": "The value of the nextToken from the previous result page.",
  26914. // "location": "query",
  26915. // "type": "string"
  26916. // },
  26917. // "profileId": {
  26918. // "description": "The DFA profile ID.",
  26919. // "format": "int64",
  26920. // "location": "path",
  26921. // "required": true,
  26922. // "type": "string"
  26923. // },
  26924. // "scope": {
  26925. // "default": "MINE",
  26926. // "description": "The scope that defines which results are returned.",
  26927. // "enum": [
  26928. // "ALL",
  26929. // "MINE",
  26930. // "SHARED_WITH_ME"
  26931. // ],
  26932. // "enumDescriptions": [
  26933. // "All files in account.",
  26934. // "My files.",
  26935. // "Files shared with me."
  26936. // ],
  26937. // "location": "query",
  26938. // "type": "string"
  26939. // },
  26940. // "sortField": {
  26941. // "default": "LAST_MODIFIED_TIME",
  26942. // "description": "The field by which to sort the list.",
  26943. // "enum": [
  26944. // "ID",
  26945. // "LAST_MODIFIED_TIME"
  26946. // ],
  26947. // "enumDescriptions": [
  26948. // "Sort by file ID.",
  26949. // "Sort by 'lastmodifiedAt' field."
  26950. // ],
  26951. // "location": "query",
  26952. // "type": "string"
  26953. // },
  26954. // "sortOrder": {
  26955. // "default": "DESCENDING",
  26956. // "description": "Order of sorted results.",
  26957. // "enum": [
  26958. // "ASCENDING",
  26959. // "DESCENDING"
  26960. // ],
  26961. // "enumDescriptions": [
  26962. // "Ascending order.",
  26963. // "Descending order."
  26964. // ],
  26965. // "location": "query",
  26966. // "type": "string"
  26967. // }
  26968. // },
  26969. // "path": "userprofiles/{profileId}/files",
  26970. // "response": {
  26971. // "$ref": "FileList"
  26972. // },
  26973. // "scopes": [
  26974. // "https://www.googleapis.com/auth/dfareporting"
  26975. // ]
  26976. // }
  26977. }
  26978. // Pages invokes f for each page of results.
  26979. // A non-nil error returned from f will halt the iteration.
  26980. // The provided context supersedes any context provided to the Context method.
  26981. func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  26982. c.ctx_ = ctx
  26983. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  26984. for {
  26985. x, err := c.Do()
  26986. if err != nil {
  26987. return err
  26988. }
  26989. if err := f(x); err != nil {
  26990. return err
  26991. }
  26992. if x.NextPageToken == "" {
  26993. return nil
  26994. }
  26995. c.PageToken(x.NextPageToken)
  26996. }
  26997. }
  26998. // method id "dfareporting.floodlightActivities.delete":
  26999. type FloodlightActivitiesDeleteCall struct {
  27000. s *Service
  27001. profileId int64
  27002. id int64
  27003. urlParams_ gensupport.URLParams
  27004. ctx_ context.Context
  27005. header_ http.Header
  27006. }
  27007. // Delete: Deletes an existing floodlight activity.
  27008. func (r *FloodlightActivitiesService) Delete(profileId int64, id int64) *FloodlightActivitiesDeleteCall {
  27009. c := &FloodlightActivitiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27010. c.profileId = profileId
  27011. c.id = id
  27012. return c
  27013. }
  27014. // Fields allows partial responses to be retrieved. See
  27015. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27016. // for more information.
  27017. func (c *FloodlightActivitiesDeleteCall) Fields(s ...googleapi.Field) *FloodlightActivitiesDeleteCall {
  27018. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27019. return c
  27020. }
  27021. // Context sets the context to be used in this call's Do method. Any
  27022. // pending HTTP request will be aborted if the provided context is
  27023. // canceled.
  27024. func (c *FloodlightActivitiesDeleteCall) Context(ctx context.Context) *FloodlightActivitiesDeleteCall {
  27025. c.ctx_ = ctx
  27026. return c
  27027. }
  27028. // Header returns an http.Header that can be modified by the caller to
  27029. // add HTTP headers to the request.
  27030. func (c *FloodlightActivitiesDeleteCall) Header() http.Header {
  27031. if c.header_ == nil {
  27032. c.header_ = make(http.Header)
  27033. }
  27034. return c.header_
  27035. }
  27036. func (c *FloodlightActivitiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  27037. reqHeaders := make(http.Header)
  27038. for k, v := range c.header_ {
  27039. reqHeaders[k] = v
  27040. }
  27041. reqHeaders.Set("User-Agent", c.s.userAgent())
  27042. var body io.Reader = nil
  27043. c.urlParams_.Set("alt", alt)
  27044. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  27045. urls += "?" + c.urlParams_.Encode()
  27046. req, _ := http.NewRequest("DELETE", urls, body)
  27047. req.Header = reqHeaders
  27048. googleapi.Expand(req.URL, map[string]string{
  27049. "profileId": strconv.FormatInt(c.profileId, 10),
  27050. "id": strconv.FormatInt(c.id, 10),
  27051. })
  27052. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27053. }
  27054. // Do executes the "dfareporting.floodlightActivities.delete" call.
  27055. func (c *FloodlightActivitiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  27056. gensupport.SetOptions(c.urlParams_, opts...)
  27057. res, err := c.doRequest("json")
  27058. if err != nil {
  27059. return err
  27060. }
  27061. defer googleapi.CloseBody(res)
  27062. if err := googleapi.CheckResponse(res); err != nil {
  27063. return err
  27064. }
  27065. return nil
  27066. // {
  27067. // "description": "Deletes an existing floodlight activity.",
  27068. // "httpMethod": "DELETE",
  27069. // "id": "dfareporting.floodlightActivities.delete",
  27070. // "parameterOrder": [
  27071. // "profileId",
  27072. // "id"
  27073. // ],
  27074. // "parameters": {
  27075. // "id": {
  27076. // "description": "Floodlight activity ID.",
  27077. // "format": "int64",
  27078. // "location": "path",
  27079. // "required": true,
  27080. // "type": "string"
  27081. // },
  27082. // "profileId": {
  27083. // "description": "User profile ID associated with this request.",
  27084. // "format": "int64",
  27085. // "location": "path",
  27086. // "required": true,
  27087. // "type": "string"
  27088. // }
  27089. // },
  27090. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  27091. // "scopes": [
  27092. // "https://www.googleapis.com/auth/dfatrafficking"
  27093. // ]
  27094. // }
  27095. }
  27096. // method id "dfareporting.floodlightActivities.generatetag":
  27097. type FloodlightActivitiesGeneratetagCall struct {
  27098. s *Service
  27099. profileId int64
  27100. urlParams_ gensupport.URLParams
  27101. ctx_ context.Context
  27102. header_ http.Header
  27103. }
  27104. // Generatetag: Generates a tag for a floodlight activity.
  27105. func (r *FloodlightActivitiesService) Generatetag(profileId int64) *FloodlightActivitiesGeneratetagCall {
  27106. c := &FloodlightActivitiesGeneratetagCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27107. c.profileId = profileId
  27108. return c
  27109. }
  27110. // FloodlightActivityId sets the optional parameter
  27111. // "floodlightActivityId": Floodlight activity ID for which we want to
  27112. // generate a tag.
  27113. func (c *FloodlightActivitiesGeneratetagCall) FloodlightActivityId(floodlightActivityId int64) *FloodlightActivitiesGeneratetagCall {
  27114. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  27115. return c
  27116. }
  27117. // Fields allows partial responses to be retrieved. See
  27118. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27119. // for more information.
  27120. func (c *FloodlightActivitiesGeneratetagCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGeneratetagCall {
  27121. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27122. return c
  27123. }
  27124. // Context sets the context to be used in this call's Do method. Any
  27125. // pending HTTP request will be aborted if the provided context is
  27126. // canceled.
  27127. func (c *FloodlightActivitiesGeneratetagCall) Context(ctx context.Context) *FloodlightActivitiesGeneratetagCall {
  27128. c.ctx_ = ctx
  27129. return c
  27130. }
  27131. // Header returns an http.Header that can be modified by the caller to
  27132. // add HTTP headers to the request.
  27133. func (c *FloodlightActivitiesGeneratetagCall) Header() http.Header {
  27134. if c.header_ == nil {
  27135. c.header_ = make(http.Header)
  27136. }
  27137. return c.header_
  27138. }
  27139. func (c *FloodlightActivitiesGeneratetagCall) doRequest(alt string) (*http.Response, error) {
  27140. reqHeaders := make(http.Header)
  27141. for k, v := range c.header_ {
  27142. reqHeaders[k] = v
  27143. }
  27144. reqHeaders.Set("User-Agent", c.s.userAgent())
  27145. var body io.Reader = nil
  27146. c.urlParams_.Set("alt", alt)
  27147. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/generatetag")
  27148. urls += "?" + c.urlParams_.Encode()
  27149. req, _ := http.NewRequest("POST", urls, body)
  27150. req.Header = reqHeaders
  27151. googleapi.Expand(req.URL, map[string]string{
  27152. "profileId": strconv.FormatInt(c.profileId, 10),
  27153. })
  27154. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27155. }
  27156. // Do executes the "dfareporting.floodlightActivities.generatetag" call.
  27157. // Exactly one of *FloodlightActivitiesGenerateTagResponse or error will
  27158. // be non-nil. Any non-2xx status code is an error. Response headers are
  27159. // in either
  27160. // *FloodlightActivitiesGenerateTagResponse.ServerResponse.Header or (if
  27161. // a response was returned at all) in error.(*googleapi.Error).Header.
  27162. // Use googleapi.IsNotModified to check whether the returned error was
  27163. // because http.StatusNotModified was returned.
  27164. func (c *FloodlightActivitiesGeneratetagCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesGenerateTagResponse, error) {
  27165. gensupport.SetOptions(c.urlParams_, opts...)
  27166. res, err := c.doRequest("json")
  27167. if res != nil && res.StatusCode == http.StatusNotModified {
  27168. if res.Body != nil {
  27169. res.Body.Close()
  27170. }
  27171. return nil, &googleapi.Error{
  27172. Code: res.StatusCode,
  27173. Header: res.Header,
  27174. }
  27175. }
  27176. if err != nil {
  27177. return nil, err
  27178. }
  27179. defer googleapi.CloseBody(res)
  27180. if err := googleapi.CheckResponse(res); err != nil {
  27181. return nil, err
  27182. }
  27183. ret := &FloodlightActivitiesGenerateTagResponse{
  27184. ServerResponse: googleapi.ServerResponse{
  27185. Header: res.Header,
  27186. HTTPStatusCode: res.StatusCode,
  27187. },
  27188. }
  27189. target := &ret
  27190. if err := gensupport.DecodeResponse(target, res); err != nil {
  27191. return nil, err
  27192. }
  27193. return ret, nil
  27194. // {
  27195. // "description": "Generates a tag for a floodlight activity.",
  27196. // "httpMethod": "POST",
  27197. // "id": "dfareporting.floodlightActivities.generatetag",
  27198. // "parameterOrder": [
  27199. // "profileId"
  27200. // ],
  27201. // "parameters": {
  27202. // "floodlightActivityId": {
  27203. // "description": "Floodlight activity ID for which we want to generate a tag.",
  27204. // "format": "int64",
  27205. // "location": "query",
  27206. // "type": "string"
  27207. // },
  27208. // "profileId": {
  27209. // "description": "User profile ID associated with this request.",
  27210. // "format": "int64",
  27211. // "location": "path",
  27212. // "required": true,
  27213. // "type": "string"
  27214. // }
  27215. // },
  27216. // "path": "userprofiles/{profileId}/floodlightActivities/generatetag",
  27217. // "response": {
  27218. // "$ref": "FloodlightActivitiesGenerateTagResponse"
  27219. // },
  27220. // "scopes": [
  27221. // "https://www.googleapis.com/auth/dfatrafficking"
  27222. // ]
  27223. // }
  27224. }
  27225. // method id "dfareporting.floodlightActivities.get":
  27226. type FloodlightActivitiesGetCall struct {
  27227. s *Service
  27228. profileId int64
  27229. id int64
  27230. urlParams_ gensupport.URLParams
  27231. ifNoneMatch_ string
  27232. ctx_ context.Context
  27233. header_ http.Header
  27234. }
  27235. // Get: Gets one floodlight activity by ID.
  27236. func (r *FloodlightActivitiesService) Get(profileId int64, id int64) *FloodlightActivitiesGetCall {
  27237. c := &FloodlightActivitiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27238. c.profileId = profileId
  27239. c.id = id
  27240. return c
  27241. }
  27242. // Fields allows partial responses to be retrieved. See
  27243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27244. // for more information.
  27245. func (c *FloodlightActivitiesGetCall) Fields(s ...googleapi.Field) *FloodlightActivitiesGetCall {
  27246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27247. return c
  27248. }
  27249. // IfNoneMatch sets the optional parameter which makes the operation
  27250. // fail if the object's ETag matches the given value. This is useful for
  27251. // getting updates only after the object has changed since the last
  27252. // request. Use googleapi.IsNotModified to check whether the response
  27253. // error from Do is the result of In-None-Match.
  27254. func (c *FloodlightActivitiesGetCall) IfNoneMatch(entityTag string) *FloodlightActivitiesGetCall {
  27255. c.ifNoneMatch_ = entityTag
  27256. return c
  27257. }
  27258. // Context sets the context to be used in this call's Do method. Any
  27259. // pending HTTP request will be aborted if the provided context is
  27260. // canceled.
  27261. func (c *FloodlightActivitiesGetCall) Context(ctx context.Context) *FloodlightActivitiesGetCall {
  27262. c.ctx_ = ctx
  27263. return c
  27264. }
  27265. // Header returns an http.Header that can be modified by the caller to
  27266. // add HTTP headers to the request.
  27267. func (c *FloodlightActivitiesGetCall) Header() http.Header {
  27268. if c.header_ == nil {
  27269. c.header_ = make(http.Header)
  27270. }
  27271. return c.header_
  27272. }
  27273. func (c *FloodlightActivitiesGetCall) doRequest(alt string) (*http.Response, error) {
  27274. reqHeaders := make(http.Header)
  27275. for k, v := range c.header_ {
  27276. reqHeaders[k] = v
  27277. }
  27278. reqHeaders.Set("User-Agent", c.s.userAgent())
  27279. if c.ifNoneMatch_ != "" {
  27280. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27281. }
  27282. var body io.Reader = nil
  27283. c.urlParams_.Set("alt", alt)
  27284. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities/{id}")
  27285. urls += "?" + c.urlParams_.Encode()
  27286. req, _ := http.NewRequest("GET", urls, body)
  27287. req.Header = reqHeaders
  27288. googleapi.Expand(req.URL, map[string]string{
  27289. "profileId": strconv.FormatInt(c.profileId, 10),
  27290. "id": strconv.FormatInt(c.id, 10),
  27291. })
  27292. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27293. }
  27294. // Do executes the "dfareporting.floodlightActivities.get" call.
  27295. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  27296. // non-2xx status code is an error. Response headers are in either
  27297. // *FloodlightActivity.ServerResponse.Header or (if a response was
  27298. // returned at all) in error.(*googleapi.Error).Header. Use
  27299. // googleapi.IsNotModified to check whether the returned error was
  27300. // because http.StatusNotModified was returned.
  27301. func (c *FloodlightActivitiesGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  27302. gensupport.SetOptions(c.urlParams_, opts...)
  27303. res, err := c.doRequest("json")
  27304. if res != nil && res.StatusCode == http.StatusNotModified {
  27305. if res.Body != nil {
  27306. res.Body.Close()
  27307. }
  27308. return nil, &googleapi.Error{
  27309. Code: res.StatusCode,
  27310. Header: res.Header,
  27311. }
  27312. }
  27313. if err != nil {
  27314. return nil, err
  27315. }
  27316. defer googleapi.CloseBody(res)
  27317. if err := googleapi.CheckResponse(res); err != nil {
  27318. return nil, err
  27319. }
  27320. ret := &FloodlightActivity{
  27321. ServerResponse: googleapi.ServerResponse{
  27322. Header: res.Header,
  27323. HTTPStatusCode: res.StatusCode,
  27324. },
  27325. }
  27326. target := &ret
  27327. if err := gensupport.DecodeResponse(target, res); err != nil {
  27328. return nil, err
  27329. }
  27330. return ret, nil
  27331. // {
  27332. // "description": "Gets one floodlight activity by ID.",
  27333. // "httpMethod": "GET",
  27334. // "id": "dfareporting.floodlightActivities.get",
  27335. // "parameterOrder": [
  27336. // "profileId",
  27337. // "id"
  27338. // ],
  27339. // "parameters": {
  27340. // "id": {
  27341. // "description": "Floodlight activity ID.",
  27342. // "format": "int64",
  27343. // "location": "path",
  27344. // "required": true,
  27345. // "type": "string"
  27346. // },
  27347. // "profileId": {
  27348. // "description": "User profile ID associated with this request.",
  27349. // "format": "int64",
  27350. // "location": "path",
  27351. // "required": true,
  27352. // "type": "string"
  27353. // }
  27354. // },
  27355. // "path": "userprofiles/{profileId}/floodlightActivities/{id}",
  27356. // "response": {
  27357. // "$ref": "FloodlightActivity"
  27358. // },
  27359. // "scopes": [
  27360. // "https://www.googleapis.com/auth/dfatrafficking"
  27361. // ]
  27362. // }
  27363. }
  27364. // method id "dfareporting.floodlightActivities.insert":
  27365. type FloodlightActivitiesInsertCall struct {
  27366. s *Service
  27367. profileId int64
  27368. floodlightactivity *FloodlightActivity
  27369. urlParams_ gensupport.URLParams
  27370. ctx_ context.Context
  27371. header_ http.Header
  27372. }
  27373. // Insert: Inserts a new floodlight activity.
  27374. func (r *FloodlightActivitiesService) Insert(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesInsertCall {
  27375. c := &FloodlightActivitiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27376. c.profileId = profileId
  27377. c.floodlightactivity = floodlightactivity
  27378. return c
  27379. }
  27380. // Fields allows partial responses to be retrieved. See
  27381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27382. // for more information.
  27383. func (c *FloodlightActivitiesInsertCall) Fields(s ...googleapi.Field) *FloodlightActivitiesInsertCall {
  27384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27385. return c
  27386. }
  27387. // Context sets the context to be used in this call's Do method. Any
  27388. // pending HTTP request will be aborted if the provided context is
  27389. // canceled.
  27390. func (c *FloodlightActivitiesInsertCall) Context(ctx context.Context) *FloodlightActivitiesInsertCall {
  27391. c.ctx_ = ctx
  27392. return c
  27393. }
  27394. // Header returns an http.Header that can be modified by the caller to
  27395. // add HTTP headers to the request.
  27396. func (c *FloodlightActivitiesInsertCall) Header() http.Header {
  27397. if c.header_ == nil {
  27398. c.header_ = make(http.Header)
  27399. }
  27400. return c.header_
  27401. }
  27402. func (c *FloodlightActivitiesInsertCall) doRequest(alt string) (*http.Response, error) {
  27403. reqHeaders := make(http.Header)
  27404. for k, v := range c.header_ {
  27405. reqHeaders[k] = v
  27406. }
  27407. reqHeaders.Set("User-Agent", c.s.userAgent())
  27408. var body io.Reader = nil
  27409. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  27410. if err != nil {
  27411. return nil, err
  27412. }
  27413. reqHeaders.Set("Content-Type", "application/json")
  27414. c.urlParams_.Set("alt", alt)
  27415. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  27416. urls += "?" + c.urlParams_.Encode()
  27417. req, _ := http.NewRequest("POST", urls, body)
  27418. req.Header = reqHeaders
  27419. googleapi.Expand(req.URL, map[string]string{
  27420. "profileId": strconv.FormatInt(c.profileId, 10),
  27421. })
  27422. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27423. }
  27424. // Do executes the "dfareporting.floodlightActivities.insert" call.
  27425. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  27426. // non-2xx status code is an error. Response headers are in either
  27427. // *FloodlightActivity.ServerResponse.Header or (if a response was
  27428. // returned at all) in error.(*googleapi.Error).Header. Use
  27429. // googleapi.IsNotModified to check whether the returned error was
  27430. // because http.StatusNotModified was returned.
  27431. func (c *FloodlightActivitiesInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  27432. gensupport.SetOptions(c.urlParams_, opts...)
  27433. res, err := c.doRequest("json")
  27434. if res != nil && res.StatusCode == http.StatusNotModified {
  27435. if res.Body != nil {
  27436. res.Body.Close()
  27437. }
  27438. return nil, &googleapi.Error{
  27439. Code: res.StatusCode,
  27440. Header: res.Header,
  27441. }
  27442. }
  27443. if err != nil {
  27444. return nil, err
  27445. }
  27446. defer googleapi.CloseBody(res)
  27447. if err := googleapi.CheckResponse(res); err != nil {
  27448. return nil, err
  27449. }
  27450. ret := &FloodlightActivity{
  27451. ServerResponse: googleapi.ServerResponse{
  27452. Header: res.Header,
  27453. HTTPStatusCode: res.StatusCode,
  27454. },
  27455. }
  27456. target := &ret
  27457. if err := gensupport.DecodeResponse(target, res); err != nil {
  27458. return nil, err
  27459. }
  27460. return ret, nil
  27461. // {
  27462. // "description": "Inserts a new floodlight activity.",
  27463. // "httpMethod": "POST",
  27464. // "id": "dfareporting.floodlightActivities.insert",
  27465. // "parameterOrder": [
  27466. // "profileId"
  27467. // ],
  27468. // "parameters": {
  27469. // "profileId": {
  27470. // "description": "User profile ID associated with this request.",
  27471. // "format": "int64",
  27472. // "location": "path",
  27473. // "required": true,
  27474. // "type": "string"
  27475. // }
  27476. // },
  27477. // "path": "userprofiles/{profileId}/floodlightActivities",
  27478. // "request": {
  27479. // "$ref": "FloodlightActivity"
  27480. // },
  27481. // "response": {
  27482. // "$ref": "FloodlightActivity"
  27483. // },
  27484. // "scopes": [
  27485. // "https://www.googleapis.com/auth/dfatrafficking"
  27486. // ]
  27487. // }
  27488. }
  27489. // method id "dfareporting.floodlightActivities.list":
  27490. type FloodlightActivitiesListCall struct {
  27491. s *Service
  27492. profileId int64
  27493. urlParams_ gensupport.URLParams
  27494. ifNoneMatch_ string
  27495. ctx_ context.Context
  27496. header_ http.Header
  27497. }
  27498. // List: Retrieves a list of floodlight activities, possibly filtered.
  27499. // This method supports paging.
  27500. func (r *FloodlightActivitiesService) List(profileId int64) *FloodlightActivitiesListCall {
  27501. c := &FloodlightActivitiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27502. c.profileId = profileId
  27503. return c
  27504. }
  27505. // AdvertiserId sets the optional parameter "advertiserId": Select only
  27506. // floodlight activities for the specified advertiser ID. Must specify
  27507. // either ids, advertiserId, or floodlightConfigurationId for a
  27508. // non-empty result.
  27509. func (c *FloodlightActivitiesListCall) AdvertiserId(advertiserId int64) *FloodlightActivitiesListCall {
  27510. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  27511. return c
  27512. }
  27513. // FloodlightActivityGroupIds sets the optional parameter
  27514. // "floodlightActivityGroupIds": Select only floodlight activities with
  27515. // the specified floodlight activity group IDs.
  27516. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupIds(floodlightActivityGroupIds ...int64) *FloodlightActivitiesListCall {
  27517. var floodlightActivityGroupIds_ []string
  27518. for _, v := range floodlightActivityGroupIds {
  27519. floodlightActivityGroupIds_ = append(floodlightActivityGroupIds_, fmt.Sprint(v))
  27520. }
  27521. c.urlParams_.SetMulti("floodlightActivityGroupIds", floodlightActivityGroupIds_)
  27522. return c
  27523. }
  27524. // FloodlightActivityGroupName sets the optional parameter
  27525. // "floodlightActivityGroupName": Select only floodlight activities with
  27526. // the specified floodlight activity group name.
  27527. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupName(floodlightActivityGroupName string) *FloodlightActivitiesListCall {
  27528. c.urlParams_.Set("floodlightActivityGroupName", floodlightActivityGroupName)
  27529. return c
  27530. }
  27531. // FloodlightActivityGroupTagString sets the optional parameter
  27532. // "floodlightActivityGroupTagString": Select only floodlight activities
  27533. // with the specified floodlight activity group tag string.
  27534. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupTagString(floodlightActivityGroupTagString string) *FloodlightActivitiesListCall {
  27535. c.urlParams_.Set("floodlightActivityGroupTagString", floodlightActivityGroupTagString)
  27536. return c
  27537. }
  27538. // FloodlightActivityGroupType sets the optional parameter
  27539. // "floodlightActivityGroupType": Select only floodlight activities with
  27540. // the specified floodlight activity group type.
  27541. //
  27542. // Possible values:
  27543. // "COUNTER"
  27544. // "SALE"
  27545. func (c *FloodlightActivitiesListCall) FloodlightActivityGroupType(floodlightActivityGroupType string) *FloodlightActivitiesListCall {
  27546. c.urlParams_.Set("floodlightActivityGroupType", floodlightActivityGroupType)
  27547. return c
  27548. }
  27549. // FloodlightConfigurationId sets the optional parameter
  27550. // "floodlightConfigurationId": Select only floodlight activities for
  27551. // the specified floodlight configuration ID. Must specify either ids,
  27552. // advertiserId, or floodlightConfigurationId for a non-empty result.
  27553. func (c *FloodlightActivitiesListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivitiesListCall {
  27554. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  27555. return c
  27556. }
  27557. // Ids sets the optional parameter "ids": Select only floodlight
  27558. // activities with the specified IDs. Must specify either ids,
  27559. // advertiserId, or floodlightConfigurationId for a non-empty result.
  27560. func (c *FloodlightActivitiesListCall) Ids(ids ...int64) *FloodlightActivitiesListCall {
  27561. var ids_ []string
  27562. for _, v := range ids {
  27563. ids_ = append(ids_, fmt.Sprint(v))
  27564. }
  27565. c.urlParams_.SetMulti("ids", ids_)
  27566. return c
  27567. }
  27568. // MaxResults sets the optional parameter "maxResults": Maximum number
  27569. // of results to return.
  27570. func (c *FloodlightActivitiesListCall) MaxResults(maxResults int64) *FloodlightActivitiesListCall {
  27571. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  27572. return c
  27573. }
  27574. // PageToken sets the optional parameter "pageToken": Value of the
  27575. // nextPageToken from the previous result page.
  27576. func (c *FloodlightActivitiesListCall) PageToken(pageToken string) *FloodlightActivitiesListCall {
  27577. c.urlParams_.Set("pageToken", pageToken)
  27578. return c
  27579. }
  27580. // SearchString sets the optional parameter "searchString": Allows
  27581. // searching for objects by name or ID. Wildcards (*) are allowed. For
  27582. // example, "floodlightactivity*2015" will return objects with names
  27583. // like "floodlightactivity June 2015", "floodlightactivity April 2015",
  27584. // or simply "floodlightactivity 2015". Most of the searches also add
  27585. // wildcards implicitly at the start and the end of the search string.
  27586. // For example, a search string of "floodlightactivity" will match
  27587. // objects with name "my floodlightactivity activity",
  27588. // "floodlightactivity 2015", or simply "floodlightactivity".
  27589. func (c *FloodlightActivitiesListCall) SearchString(searchString string) *FloodlightActivitiesListCall {
  27590. c.urlParams_.Set("searchString", searchString)
  27591. return c
  27592. }
  27593. // SortField sets the optional parameter "sortField": Field by which to
  27594. // sort the list.
  27595. //
  27596. // Possible values:
  27597. // "ID" (default)
  27598. // "NAME"
  27599. func (c *FloodlightActivitiesListCall) SortField(sortField string) *FloodlightActivitiesListCall {
  27600. c.urlParams_.Set("sortField", sortField)
  27601. return c
  27602. }
  27603. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  27604. // results.
  27605. //
  27606. // Possible values:
  27607. // "ASCENDING" (default)
  27608. // "DESCENDING"
  27609. func (c *FloodlightActivitiesListCall) SortOrder(sortOrder string) *FloodlightActivitiesListCall {
  27610. c.urlParams_.Set("sortOrder", sortOrder)
  27611. return c
  27612. }
  27613. // TagString sets the optional parameter "tagString": Select only
  27614. // floodlight activities with the specified tag string.
  27615. func (c *FloodlightActivitiesListCall) TagString(tagString string) *FloodlightActivitiesListCall {
  27616. c.urlParams_.Set("tagString", tagString)
  27617. return c
  27618. }
  27619. // Fields allows partial responses to be retrieved. See
  27620. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27621. // for more information.
  27622. func (c *FloodlightActivitiesListCall) Fields(s ...googleapi.Field) *FloodlightActivitiesListCall {
  27623. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27624. return c
  27625. }
  27626. // IfNoneMatch sets the optional parameter which makes the operation
  27627. // fail if the object's ETag matches the given value. This is useful for
  27628. // getting updates only after the object has changed since the last
  27629. // request. Use googleapi.IsNotModified to check whether the response
  27630. // error from Do is the result of In-None-Match.
  27631. func (c *FloodlightActivitiesListCall) IfNoneMatch(entityTag string) *FloodlightActivitiesListCall {
  27632. c.ifNoneMatch_ = entityTag
  27633. return c
  27634. }
  27635. // Context sets the context to be used in this call's Do method. Any
  27636. // pending HTTP request will be aborted if the provided context is
  27637. // canceled.
  27638. func (c *FloodlightActivitiesListCall) Context(ctx context.Context) *FloodlightActivitiesListCall {
  27639. c.ctx_ = ctx
  27640. return c
  27641. }
  27642. // Header returns an http.Header that can be modified by the caller to
  27643. // add HTTP headers to the request.
  27644. func (c *FloodlightActivitiesListCall) Header() http.Header {
  27645. if c.header_ == nil {
  27646. c.header_ = make(http.Header)
  27647. }
  27648. return c.header_
  27649. }
  27650. func (c *FloodlightActivitiesListCall) doRequest(alt string) (*http.Response, error) {
  27651. reqHeaders := make(http.Header)
  27652. for k, v := range c.header_ {
  27653. reqHeaders[k] = v
  27654. }
  27655. reqHeaders.Set("User-Agent", c.s.userAgent())
  27656. if c.ifNoneMatch_ != "" {
  27657. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  27658. }
  27659. var body io.Reader = nil
  27660. c.urlParams_.Set("alt", alt)
  27661. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  27662. urls += "?" + c.urlParams_.Encode()
  27663. req, _ := http.NewRequest("GET", urls, body)
  27664. req.Header = reqHeaders
  27665. googleapi.Expand(req.URL, map[string]string{
  27666. "profileId": strconv.FormatInt(c.profileId, 10),
  27667. })
  27668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27669. }
  27670. // Do executes the "dfareporting.floodlightActivities.list" call.
  27671. // Exactly one of *FloodlightActivitiesListResponse or error will be
  27672. // non-nil. Any non-2xx status code is an error. Response headers are in
  27673. // either *FloodlightActivitiesListResponse.ServerResponse.Header or (if
  27674. // a response was returned at all) in error.(*googleapi.Error).Header.
  27675. // Use googleapi.IsNotModified to check whether the returned error was
  27676. // because http.StatusNotModified was returned.
  27677. func (c *FloodlightActivitiesListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivitiesListResponse, error) {
  27678. gensupport.SetOptions(c.urlParams_, opts...)
  27679. res, err := c.doRequest("json")
  27680. if res != nil && res.StatusCode == http.StatusNotModified {
  27681. if res.Body != nil {
  27682. res.Body.Close()
  27683. }
  27684. return nil, &googleapi.Error{
  27685. Code: res.StatusCode,
  27686. Header: res.Header,
  27687. }
  27688. }
  27689. if err != nil {
  27690. return nil, err
  27691. }
  27692. defer googleapi.CloseBody(res)
  27693. if err := googleapi.CheckResponse(res); err != nil {
  27694. return nil, err
  27695. }
  27696. ret := &FloodlightActivitiesListResponse{
  27697. ServerResponse: googleapi.ServerResponse{
  27698. Header: res.Header,
  27699. HTTPStatusCode: res.StatusCode,
  27700. },
  27701. }
  27702. target := &ret
  27703. if err := gensupport.DecodeResponse(target, res); err != nil {
  27704. return nil, err
  27705. }
  27706. return ret, nil
  27707. // {
  27708. // "description": "Retrieves a list of floodlight activities, possibly filtered. This method supports paging.",
  27709. // "httpMethod": "GET",
  27710. // "id": "dfareporting.floodlightActivities.list",
  27711. // "parameterOrder": [
  27712. // "profileId"
  27713. // ],
  27714. // "parameters": {
  27715. // "advertiserId": {
  27716. // "description": "Select only floodlight activities for the specified advertiser ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  27717. // "format": "int64",
  27718. // "location": "query",
  27719. // "type": "string"
  27720. // },
  27721. // "floodlightActivityGroupIds": {
  27722. // "description": "Select only floodlight activities with the specified floodlight activity group IDs.",
  27723. // "format": "int64",
  27724. // "location": "query",
  27725. // "repeated": true,
  27726. // "type": "string"
  27727. // },
  27728. // "floodlightActivityGroupName": {
  27729. // "description": "Select only floodlight activities with the specified floodlight activity group name.",
  27730. // "location": "query",
  27731. // "type": "string"
  27732. // },
  27733. // "floodlightActivityGroupTagString": {
  27734. // "description": "Select only floodlight activities with the specified floodlight activity group tag string.",
  27735. // "location": "query",
  27736. // "type": "string"
  27737. // },
  27738. // "floodlightActivityGroupType": {
  27739. // "description": "Select only floodlight activities with the specified floodlight activity group type.",
  27740. // "enum": [
  27741. // "COUNTER",
  27742. // "SALE"
  27743. // ],
  27744. // "enumDescriptions": [
  27745. // "",
  27746. // ""
  27747. // ],
  27748. // "location": "query",
  27749. // "type": "string"
  27750. // },
  27751. // "floodlightConfigurationId": {
  27752. // "description": "Select only floodlight activities for the specified floodlight configuration ID. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  27753. // "format": "int64",
  27754. // "location": "query",
  27755. // "type": "string"
  27756. // },
  27757. // "ids": {
  27758. // "description": "Select only floodlight activities with the specified IDs. Must specify either ids, advertiserId, or floodlightConfigurationId for a non-empty result.",
  27759. // "format": "int64",
  27760. // "location": "query",
  27761. // "repeated": true,
  27762. // "type": "string"
  27763. // },
  27764. // "maxResults": {
  27765. // "default": "1000",
  27766. // "description": "Maximum number of results to return.",
  27767. // "format": "int32",
  27768. // "location": "query",
  27769. // "maximum": "1000",
  27770. // "minimum": "0",
  27771. // "type": "integer"
  27772. // },
  27773. // "pageToken": {
  27774. // "description": "Value of the nextPageToken from the previous result page.",
  27775. // "location": "query",
  27776. // "type": "string"
  27777. // },
  27778. // "profileId": {
  27779. // "description": "User profile ID associated with this request.",
  27780. // "format": "int64",
  27781. // "location": "path",
  27782. // "required": true,
  27783. // "type": "string"
  27784. // },
  27785. // "searchString": {
  27786. // "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\".",
  27787. // "location": "query",
  27788. // "type": "string"
  27789. // },
  27790. // "sortField": {
  27791. // "default": "ID",
  27792. // "description": "Field by which to sort the list.",
  27793. // "enum": [
  27794. // "ID",
  27795. // "NAME"
  27796. // ],
  27797. // "enumDescriptions": [
  27798. // "",
  27799. // ""
  27800. // ],
  27801. // "location": "query",
  27802. // "type": "string"
  27803. // },
  27804. // "sortOrder": {
  27805. // "default": "ASCENDING",
  27806. // "description": "Order of sorted results.",
  27807. // "enum": [
  27808. // "ASCENDING",
  27809. // "DESCENDING"
  27810. // ],
  27811. // "enumDescriptions": [
  27812. // "",
  27813. // ""
  27814. // ],
  27815. // "location": "query",
  27816. // "type": "string"
  27817. // },
  27818. // "tagString": {
  27819. // "description": "Select only floodlight activities with the specified tag string.",
  27820. // "location": "query",
  27821. // "type": "string"
  27822. // }
  27823. // },
  27824. // "path": "userprofiles/{profileId}/floodlightActivities",
  27825. // "response": {
  27826. // "$ref": "FloodlightActivitiesListResponse"
  27827. // },
  27828. // "scopes": [
  27829. // "https://www.googleapis.com/auth/dfatrafficking"
  27830. // ]
  27831. // }
  27832. }
  27833. // Pages invokes f for each page of results.
  27834. // A non-nil error returned from f will halt the iteration.
  27835. // The provided context supersedes any context provided to the Context method.
  27836. func (c *FloodlightActivitiesListCall) Pages(ctx context.Context, f func(*FloodlightActivitiesListResponse) error) error {
  27837. c.ctx_ = ctx
  27838. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  27839. for {
  27840. x, err := c.Do()
  27841. if err != nil {
  27842. return err
  27843. }
  27844. if err := f(x); err != nil {
  27845. return err
  27846. }
  27847. if x.NextPageToken == "" {
  27848. return nil
  27849. }
  27850. c.PageToken(x.NextPageToken)
  27851. }
  27852. }
  27853. // method id "dfareporting.floodlightActivities.patch":
  27854. type FloodlightActivitiesPatchCall struct {
  27855. s *Service
  27856. profileId int64
  27857. floodlightactivity *FloodlightActivity
  27858. urlParams_ gensupport.URLParams
  27859. ctx_ context.Context
  27860. header_ http.Header
  27861. }
  27862. // Patch: Updates an existing floodlight activity. This method supports
  27863. // patch semantics.
  27864. func (r *FloodlightActivitiesService) Patch(profileId int64, id int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesPatchCall {
  27865. c := &FloodlightActivitiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  27866. c.profileId = profileId
  27867. c.urlParams_.Set("id", fmt.Sprint(id))
  27868. c.floodlightactivity = floodlightactivity
  27869. return c
  27870. }
  27871. // Fields allows partial responses to be retrieved. See
  27872. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  27873. // for more information.
  27874. func (c *FloodlightActivitiesPatchCall) Fields(s ...googleapi.Field) *FloodlightActivitiesPatchCall {
  27875. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  27876. return c
  27877. }
  27878. // Context sets the context to be used in this call's Do method. Any
  27879. // pending HTTP request will be aborted if the provided context is
  27880. // canceled.
  27881. func (c *FloodlightActivitiesPatchCall) Context(ctx context.Context) *FloodlightActivitiesPatchCall {
  27882. c.ctx_ = ctx
  27883. return c
  27884. }
  27885. // Header returns an http.Header that can be modified by the caller to
  27886. // add HTTP headers to the request.
  27887. func (c *FloodlightActivitiesPatchCall) Header() http.Header {
  27888. if c.header_ == nil {
  27889. c.header_ = make(http.Header)
  27890. }
  27891. return c.header_
  27892. }
  27893. func (c *FloodlightActivitiesPatchCall) doRequest(alt string) (*http.Response, error) {
  27894. reqHeaders := make(http.Header)
  27895. for k, v := range c.header_ {
  27896. reqHeaders[k] = v
  27897. }
  27898. reqHeaders.Set("User-Agent", c.s.userAgent())
  27899. var body io.Reader = nil
  27900. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  27901. if err != nil {
  27902. return nil, err
  27903. }
  27904. reqHeaders.Set("Content-Type", "application/json")
  27905. c.urlParams_.Set("alt", alt)
  27906. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  27907. urls += "?" + c.urlParams_.Encode()
  27908. req, _ := http.NewRequest("PATCH", urls, body)
  27909. req.Header = reqHeaders
  27910. googleapi.Expand(req.URL, map[string]string{
  27911. "profileId": strconv.FormatInt(c.profileId, 10),
  27912. })
  27913. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  27914. }
  27915. // Do executes the "dfareporting.floodlightActivities.patch" call.
  27916. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  27917. // non-2xx status code is an error. Response headers are in either
  27918. // *FloodlightActivity.ServerResponse.Header or (if a response was
  27919. // returned at all) in error.(*googleapi.Error).Header. Use
  27920. // googleapi.IsNotModified to check whether the returned error was
  27921. // because http.StatusNotModified was returned.
  27922. func (c *FloodlightActivitiesPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  27923. gensupport.SetOptions(c.urlParams_, opts...)
  27924. res, err := c.doRequest("json")
  27925. if res != nil && res.StatusCode == http.StatusNotModified {
  27926. if res.Body != nil {
  27927. res.Body.Close()
  27928. }
  27929. return nil, &googleapi.Error{
  27930. Code: res.StatusCode,
  27931. Header: res.Header,
  27932. }
  27933. }
  27934. if err != nil {
  27935. return nil, err
  27936. }
  27937. defer googleapi.CloseBody(res)
  27938. if err := googleapi.CheckResponse(res); err != nil {
  27939. return nil, err
  27940. }
  27941. ret := &FloodlightActivity{
  27942. ServerResponse: googleapi.ServerResponse{
  27943. Header: res.Header,
  27944. HTTPStatusCode: res.StatusCode,
  27945. },
  27946. }
  27947. target := &ret
  27948. if err := gensupport.DecodeResponse(target, res); err != nil {
  27949. return nil, err
  27950. }
  27951. return ret, nil
  27952. // {
  27953. // "description": "Updates an existing floodlight activity. This method supports patch semantics.",
  27954. // "httpMethod": "PATCH",
  27955. // "id": "dfareporting.floodlightActivities.patch",
  27956. // "parameterOrder": [
  27957. // "profileId",
  27958. // "id"
  27959. // ],
  27960. // "parameters": {
  27961. // "id": {
  27962. // "description": "Floodlight activity ID.",
  27963. // "format": "int64",
  27964. // "location": "query",
  27965. // "required": true,
  27966. // "type": "string"
  27967. // },
  27968. // "profileId": {
  27969. // "description": "User profile ID associated with this request.",
  27970. // "format": "int64",
  27971. // "location": "path",
  27972. // "required": true,
  27973. // "type": "string"
  27974. // }
  27975. // },
  27976. // "path": "userprofiles/{profileId}/floodlightActivities",
  27977. // "request": {
  27978. // "$ref": "FloodlightActivity"
  27979. // },
  27980. // "response": {
  27981. // "$ref": "FloodlightActivity"
  27982. // },
  27983. // "scopes": [
  27984. // "https://www.googleapis.com/auth/dfatrafficking"
  27985. // ]
  27986. // }
  27987. }
  27988. // method id "dfareporting.floodlightActivities.update":
  27989. type FloodlightActivitiesUpdateCall struct {
  27990. s *Service
  27991. profileId int64
  27992. floodlightactivity *FloodlightActivity
  27993. urlParams_ gensupport.URLParams
  27994. ctx_ context.Context
  27995. header_ http.Header
  27996. }
  27997. // Update: Updates an existing floodlight activity.
  27998. func (r *FloodlightActivitiesService) Update(profileId int64, floodlightactivity *FloodlightActivity) *FloodlightActivitiesUpdateCall {
  27999. c := &FloodlightActivitiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28000. c.profileId = profileId
  28001. c.floodlightactivity = floodlightactivity
  28002. return c
  28003. }
  28004. // Fields allows partial responses to be retrieved. See
  28005. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28006. // for more information.
  28007. func (c *FloodlightActivitiesUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivitiesUpdateCall {
  28008. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28009. return c
  28010. }
  28011. // Context sets the context to be used in this call's Do method. Any
  28012. // pending HTTP request will be aborted if the provided context is
  28013. // canceled.
  28014. func (c *FloodlightActivitiesUpdateCall) Context(ctx context.Context) *FloodlightActivitiesUpdateCall {
  28015. c.ctx_ = ctx
  28016. return c
  28017. }
  28018. // Header returns an http.Header that can be modified by the caller to
  28019. // add HTTP headers to the request.
  28020. func (c *FloodlightActivitiesUpdateCall) Header() http.Header {
  28021. if c.header_ == nil {
  28022. c.header_ = make(http.Header)
  28023. }
  28024. return c.header_
  28025. }
  28026. func (c *FloodlightActivitiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  28027. reqHeaders := make(http.Header)
  28028. for k, v := range c.header_ {
  28029. reqHeaders[k] = v
  28030. }
  28031. reqHeaders.Set("User-Agent", c.s.userAgent())
  28032. var body io.Reader = nil
  28033. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivity)
  28034. if err != nil {
  28035. return nil, err
  28036. }
  28037. reqHeaders.Set("Content-Type", "application/json")
  28038. c.urlParams_.Set("alt", alt)
  28039. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivities")
  28040. urls += "?" + c.urlParams_.Encode()
  28041. req, _ := http.NewRequest("PUT", urls, body)
  28042. req.Header = reqHeaders
  28043. googleapi.Expand(req.URL, map[string]string{
  28044. "profileId": strconv.FormatInt(c.profileId, 10),
  28045. })
  28046. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28047. }
  28048. // Do executes the "dfareporting.floodlightActivities.update" call.
  28049. // Exactly one of *FloodlightActivity or error will be non-nil. Any
  28050. // non-2xx status code is an error. Response headers are in either
  28051. // *FloodlightActivity.ServerResponse.Header or (if a response was
  28052. // returned at all) in error.(*googleapi.Error).Header. Use
  28053. // googleapi.IsNotModified to check whether the returned error was
  28054. // because http.StatusNotModified was returned.
  28055. func (c *FloodlightActivitiesUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivity, error) {
  28056. gensupport.SetOptions(c.urlParams_, opts...)
  28057. res, err := c.doRequest("json")
  28058. if res != nil && res.StatusCode == http.StatusNotModified {
  28059. if res.Body != nil {
  28060. res.Body.Close()
  28061. }
  28062. return nil, &googleapi.Error{
  28063. Code: res.StatusCode,
  28064. Header: res.Header,
  28065. }
  28066. }
  28067. if err != nil {
  28068. return nil, err
  28069. }
  28070. defer googleapi.CloseBody(res)
  28071. if err := googleapi.CheckResponse(res); err != nil {
  28072. return nil, err
  28073. }
  28074. ret := &FloodlightActivity{
  28075. ServerResponse: googleapi.ServerResponse{
  28076. Header: res.Header,
  28077. HTTPStatusCode: res.StatusCode,
  28078. },
  28079. }
  28080. target := &ret
  28081. if err := gensupport.DecodeResponse(target, res); err != nil {
  28082. return nil, err
  28083. }
  28084. return ret, nil
  28085. // {
  28086. // "description": "Updates an existing floodlight activity.",
  28087. // "httpMethod": "PUT",
  28088. // "id": "dfareporting.floodlightActivities.update",
  28089. // "parameterOrder": [
  28090. // "profileId"
  28091. // ],
  28092. // "parameters": {
  28093. // "profileId": {
  28094. // "description": "User profile ID associated with this request.",
  28095. // "format": "int64",
  28096. // "location": "path",
  28097. // "required": true,
  28098. // "type": "string"
  28099. // }
  28100. // },
  28101. // "path": "userprofiles/{profileId}/floodlightActivities",
  28102. // "request": {
  28103. // "$ref": "FloodlightActivity"
  28104. // },
  28105. // "response": {
  28106. // "$ref": "FloodlightActivity"
  28107. // },
  28108. // "scopes": [
  28109. // "https://www.googleapis.com/auth/dfatrafficking"
  28110. // ]
  28111. // }
  28112. }
  28113. // method id "dfareporting.floodlightActivityGroups.get":
  28114. type FloodlightActivityGroupsGetCall struct {
  28115. s *Service
  28116. profileId int64
  28117. id int64
  28118. urlParams_ gensupport.URLParams
  28119. ifNoneMatch_ string
  28120. ctx_ context.Context
  28121. header_ http.Header
  28122. }
  28123. // Get: Gets one floodlight activity group by ID.
  28124. func (r *FloodlightActivityGroupsService) Get(profileId int64, id int64) *FloodlightActivityGroupsGetCall {
  28125. c := &FloodlightActivityGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28126. c.profileId = profileId
  28127. c.id = id
  28128. return c
  28129. }
  28130. // Fields allows partial responses to be retrieved. See
  28131. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28132. // for more information.
  28133. func (c *FloodlightActivityGroupsGetCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsGetCall {
  28134. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28135. return c
  28136. }
  28137. // IfNoneMatch sets the optional parameter which makes the operation
  28138. // fail if the object's ETag matches the given value. This is useful for
  28139. // getting updates only after the object has changed since the last
  28140. // request. Use googleapi.IsNotModified to check whether the response
  28141. // error from Do is the result of In-None-Match.
  28142. func (c *FloodlightActivityGroupsGetCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsGetCall {
  28143. c.ifNoneMatch_ = entityTag
  28144. return c
  28145. }
  28146. // Context sets the context to be used in this call's Do method. Any
  28147. // pending HTTP request will be aborted if the provided context is
  28148. // canceled.
  28149. func (c *FloodlightActivityGroupsGetCall) Context(ctx context.Context) *FloodlightActivityGroupsGetCall {
  28150. c.ctx_ = ctx
  28151. return c
  28152. }
  28153. // Header returns an http.Header that can be modified by the caller to
  28154. // add HTTP headers to the request.
  28155. func (c *FloodlightActivityGroupsGetCall) Header() http.Header {
  28156. if c.header_ == nil {
  28157. c.header_ = make(http.Header)
  28158. }
  28159. return c.header_
  28160. }
  28161. func (c *FloodlightActivityGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  28162. reqHeaders := make(http.Header)
  28163. for k, v := range c.header_ {
  28164. reqHeaders[k] = v
  28165. }
  28166. reqHeaders.Set("User-Agent", c.s.userAgent())
  28167. if c.ifNoneMatch_ != "" {
  28168. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28169. }
  28170. var body io.Reader = nil
  28171. c.urlParams_.Set("alt", alt)
  28172. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups/{id}")
  28173. urls += "?" + c.urlParams_.Encode()
  28174. req, _ := http.NewRequest("GET", urls, body)
  28175. req.Header = reqHeaders
  28176. googleapi.Expand(req.URL, map[string]string{
  28177. "profileId": strconv.FormatInt(c.profileId, 10),
  28178. "id": strconv.FormatInt(c.id, 10),
  28179. })
  28180. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28181. }
  28182. // Do executes the "dfareporting.floodlightActivityGroups.get" call.
  28183. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  28184. // non-2xx status code is an error. Response headers are in either
  28185. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  28186. // returned at all) in error.(*googleapi.Error).Header. Use
  28187. // googleapi.IsNotModified to check whether the returned error was
  28188. // because http.StatusNotModified was returned.
  28189. func (c *FloodlightActivityGroupsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  28190. gensupport.SetOptions(c.urlParams_, opts...)
  28191. res, err := c.doRequest("json")
  28192. if res != nil && res.StatusCode == http.StatusNotModified {
  28193. if res.Body != nil {
  28194. res.Body.Close()
  28195. }
  28196. return nil, &googleapi.Error{
  28197. Code: res.StatusCode,
  28198. Header: res.Header,
  28199. }
  28200. }
  28201. if err != nil {
  28202. return nil, err
  28203. }
  28204. defer googleapi.CloseBody(res)
  28205. if err := googleapi.CheckResponse(res); err != nil {
  28206. return nil, err
  28207. }
  28208. ret := &FloodlightActivityGroup{
  28209. ServerResponse: googleapi.ServerResponse{
  28210. Header: res.Header,
  28211. HTTPStatusCode: res.StatusCode,
  28212. },
  28213. }
  28214. target := &ret
  28215. if err := gensupport.DecodeResponse(target, res); err != nil {
  28216. return nil, err
  28217. }
  28218. return ret, nil
  28219. // {
  28220. // "description": "Gets one floodlight activity group by ID.",
  28221. // "httpMethod": "GET",
  28222. // "id": "dfareporting.floodlightActivityGroups.get",
  28223. // "parameterOrder": [
  28224. // "profileId",
  28225. // "id"
  28226. // ],
  28227. // "parameters": {
  28228. // "id": {
  28229. // "description": "Floodlight activity Group ID.",
  28230. // "format": "int64",
  28231. // "location": "path",
  28232. // "required": true,
  28233. // "type": "string"
  28234. // },
  28235. // "profileId": {
  28236. // "description": "User profile ID associated with this request.",
  28237. // "format": "int64",
  28238. // "location": "path",
  28239. // "required": true,
  28240. // "type": "string"
  28241. // }
  28242. // },
  28243. // "path": "userprofiles/{profileId}/floodlightActivityGroups/{id}",
  28244. // "response": {
  28245. // "$ref": "FloodlightActivityGroup"
  28246. // },
  28247. // "scopes": [
  28248. // "https://www.googleapis.com/auth/dfatrafficking"
  28249. // ]
  28250. // }
  28251. }
  28252. // method id "dfareporting.floodlightActivityGroups.insert":
  28253. type FloodlightActivityGroupsInsertCall struct {
  28254. s *Service
  28255. profileId int64
  28256. floodlightactivitygroup *FloodlightActivityGroup
  28257. urlParams_ gensupport.URLParams
  28258. ctx_ context.Context
  28259. header_ http.Header
  28260. }
  28261. // Insert: Inserts a new floodlight activity group.
  28262. func (r *FloodlightActivityGroupsService) Insert(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsInsertCall {
  28263. c := &FloodlightActivityGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28264. c.profileId = profileId
  28265. c.floodlightactivitygroup = floodlightactivitygroup
  28266. return c
  28267. }
  28268. // Fields allows partial responses to be retrieved. See
  28269. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28270. // for more information.
  28271. func (c *FloodlightActivityGroupsInsertCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsInsertCall {
  28272. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28273. return c
  28274. }
  28275. // Context sets the context to be used in this call's Do method. Any
  28276. // pending HTTP request will be aborted if the provided context is
  28277. // canceled.
  28278. func (c *FloodlightActivityGroupsInsertCall) Context(ctx context.Context) *FloodlightActivityGroupsInsertCall {
  28279. c.ctx_ = ctx
  28280. return c
  28281. }
  28282. // Header returns an http.Header that can be modified by the caller to
  28283. // add HTTP headers to the request.
  28284. func (c *FloodlightActivityGroupsInsertCall) Header() http.Header {
  28285. if c.header_ == nil {
  28286. c.header_ = make(http.Header)
  28287. }
  28288. return c.header_
  28289. }
  28290. func (c *FloodlightActivityGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  28291. reqHeaders := make(http.Header)
  28292. for k, v := range c.header_ {
  28293. reqHeaders[k] = v
  28294. }
  28295. reqHeaders.Set("User-Agent", c.s.userAgent())
  28296. var body io.Reader = nil
  28297. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  28298. if err != nil {
  28299. return nil, err
  28300. }
  28301. reqHeaders.Set("Content-Type", "application/json")
  28302. c.urlParams_.Set("alt", alt)
  28303. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  28304. urls += "?" + c.urlParams_.Encode()
  28305. req, _ := http.NewRequest("POST", urls, body)
  28306. req.Header = reqHeaders
  28307. googleapi.Expand(req.URL, map[string]string{
  28308. "profileId": strconv.FormatInt(c.profileId, 10),
  28309. })
  28310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28311. }
  28312. // Do executes the "dfareporting.floodlightActivityGroups.insert" call.
  28313. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  28314. // non-2xx status code is an error. Response headers are in either
  28315. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  28316. // returned at all) in error.(*googleapi.Error).Header. Use
  28317. // googleapi.IsNotModified to check whether the returned error was
  28318. // because http.StatusNotModified was returned.
  28319. func (c *FloodlightActivityGroupsInsertCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  28320. gensupport.SetOptions(c.urlParams_, opts...)
  28321. res, err := c.doRequest("json")
  28322. if res != nil && res.StatusCode == http.StatusNotModified {
  28323. if res.Body != nil {
  28324. res.Body.Close()
  28325. }
  28326. return nil, &googleapi.Error{
  28327. Code: res.StatusCode,
  28328. Header: res.Header,
  28329. }
  28330. }
  28331. if err != nil {
  28332. return nil, err
  28333. }
  28334. defer googleapi.CloseBody(res)
  28335. if err := googleapi.CheckResponse(res); err != nil {
  28336. return nil, err
  28337. }
  28338. ret := &FloodlightActivityGroup{
  28339. ServerResponse: googleapi.ServerResponse{
  28340. Header: res.Header,
  28341. HTTPStatusCode: res.StatusCode,
  28342. },
  28343. }
  28344. target := &ret
  28345. if err := gensupport.DecodeResponse(target, res); err != nil {
  28346. return nil, err
  28347. }
  28348. return ret, nil
  28349. // {
  28350. // "description": "Inserts a new floodlight activity group.",
  28351. // "httpMethod": "POST",
  28352. // "id": "dfareporting.floodlightActivityGroups.insert",
  28353. // "parameterOrder": [
  28354. // "profileId"
  28355. // ],
  28356. // "parameters": {
  28357. // "profileId": {
  28358. // "description": "User profile ID associated with this request.",
  28359. // "format": "int64",
  28360. // "location": "path",
  28361. // "required": true,
  28362. // "type": "string"
  28363. // }
  28364. // },
  28365. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  28366. // "request": {
  28367. // "$ref": "FloodlightActivityGroup"
  28368. // },
  28369. // "response": {
  28370. // "$ref": "FloodlightActivityGroup"
  28371. // },
  28372. // "scopes": [
  28373. // "https://www.googleapis.com/auth/dfatrafficking"
  28374. // ]
  28375. // }
  28376. }
  28377. // method id "dfareporting.floodlightActivityGroups.list":
  28378. type FloodlightActivityGroupsListCall struct {
  28379. s *Service
  28380. profileId int64
  28381. urlParams_ gensupport.URLParams
  28382. ifNoneMatch_ string
  28383. ctx_ context.Context
  28384. header_ http.Header
  28385. }
  28386. // List: Retrieves a list of floodlight activity groups, possibly
  28387. // filtered. This method supports paging.
  28388. func (r *FloodlightActivityGroupsService) List(profileId int64) *FloodlightActivityGroupsListCall {
  28389. c := &FloodlightActivityGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28390. c.profileId = profileId
  28391. return c
  28392. }
  28393. // AdvertiserId sets the optional parameter "advertiserId": Select only
  28394. // floodlight activity groups with the specified advertiser ID. Must
  28395. // specify either advertiserId or floodlightConfigurationId for a
  28396. // non-empty result.
  28397. func (c *FloodlightActivityGroupsListCall) AdvertiserId(advertiserId int64) *FloodlightActivityGroupsListCall {
  28398. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  28399. return c
  28400. }
  28401. // FloodlightConfigurationId sets the optional parameter
  28402. // "floodlightConfigurationId": Select only floodlight activity groups
  28403. // with the specified floodlight configuration ID. Must specify either
  28404. // advertiserId, or floodlightConfigurationId for a non-empty result.
  28405. func (c *FloodlightActivityGroupsListCall) FloodlightConfigurationId(floodlightConfigurationId int64) *FloodlightActivityGroupsListCall {
  28406. c.urlParams_.Set("floodlightConfigurationId", fmt.Sprint(floodlightConfigurationId))
  28407. return c
  28408. }
  28409. // Ids sets the optional parameter "ids": Select only floodlight
  28410. // activity groups with the specified IDs. Must specify either
  28411. // advertiserId or floodlightConfigurationId for a non-empty result.
  28412. func (c *FloodlightActivityGroupsListCall) Ids(ids ...int64) *FloodlightActivityGroupsListCall {
  28413. var ids_ []string
  28414. for _, v := range ids {
  28415. ids_ = append(ids_, fmt.Sprint(v))
  28416. }
  28417. c.urlParams_.SetMulti("ids", ids_)
  28418. return c
  28419. }
  28420. // MaxResults sets the optional parameter "maxResults": Maximum number
  28421. // of results to return.
  28422. func (c *FloodlightActivityGroupsListCall) MaxResults(maxResults int64) *FloodlightActivityGroupsListCall {
  28423. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  28424. return c
  28425. }
  28426. // PageToken sets the optional parameter "pageToken": Value of the
  28427. // nextPageToken from the previous result page.
  28428. func (c *FloodlightActivityGroupsListCall) PageToken(pageToken string) *FloodlightActivityGroupsListCall {
  28429. c.urlParams_.Set("pageToken", pageToken)
  28430. return c
  28431. }
  28432. // SearchString sets the optional parameter "searchString": Allows
  28433. // searching for objects by name or ID. Wildcards (*) are allowed. For
  28434. // example, "floodlightactivitygroup*2015" will return objects with
  28435. // names like "floodlightactivitygroup June 2015",
  28436. // "floodlightactivitygroup April 2015", or simply
  28437. // "floodlightactivitygroup 2015". Most of the searches also add
  28438. // wildcards implicitly at the start and the end of the search string.
  28439. // For example, a search string of "floodlightactivitygroup" will match
  28440. // objects with name "my floodlightactivitygroup activity",
  28441. // "floodlightactivitygroup 2015", or simply "floodlightactivitygroup".
  28442. func (c *FloodlightActivityGroupsListCall) SearchString(searchString string) *FloodlightActivityGroupsListCall {
  28443. c.urlParams_.Set("searchString", searchString)
  28444. return c
  28445. }
  28446. // SortField sets the optional parameter "sortField": Field by which to
  28447. // sort the list.
  28448. //
  28449. // Possible values:
  28450. // "ID" (default)
  28451. // "NAME"
  28452. func (c *FloodlightActivityGroupsListCall) SortField(sortField string) *FloodlightActivityGroupsListCall {
  28453. c.urlParams_.Set("sortField", sortField)
  28454. return c
  28455. }
  28456. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  28457. // results.
  28458. //
  28459. // Possible values:
  28460. // "ASCENDING" (default)
  28461. // "DESCENDING"
  28462. func (c *FloodlightActivityGroupsListCall) SortOrder(sortOrder string) *FloodlightActivityGroupsListCall {
  28463. c.urlParams_.Set("sortOrder", sortOrder)
  28464. return c
  28465. }
  28466. // Type sets the optional parameter "type": Select only floodlight
  28467. // activity groups with the specified floodlight activity group type.
  28468. //
  28469. // Possible values:
  28470. // "COUNTER"
  28471. // "SALE"
  28472. func (c *FloodlightActivityGroupsListCall) Type(type_ string) *FloodlightActivityGroupsListCall {
  28473. c.urlParams_.Set("type", type_)
  28474. return c
  28475. }
  28476. // Fields allows partial responses to be retrieved. See
  28477. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28478. // for more information.
  28479. func (c *FloodlightActivityGroupsListCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsListCall {
  28480. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28481. return c
  28482. }
  28483. // IfNoneMatch sets the optional parameter which makes the operation
  28484. // fail if the object's ETag matches the given value. This is useful for
  28485. // getting updates only after the object has changed since the last
  28486. // request. Use googleapi.IsNotModified to check whether the response
  28487. // error from Do is the result of In-None-Match.
  28488. func (c *FloodlightActivityGroupsListCall) IfNoneMatch(entityTag string) *FloodlightActivityGroupsListCall {
  28489. c.ifNoneMatch_ = entityTag
  28490. return c
  28491. }
  28492. // Context sets the context to be used in this call's Do method. Any
  28493. // pending HTTP request will be aborted if the provided context is
  28494. // canceled.
  28495. func (c *FloodlightActivityGroupsListCall) Context(ctx context.Context) *FloodlightActivityGroupsListCall {
  28496. c.ctx_ = ctx
  28497. return c
  28498. }
  28499. // Header returns an http.Header that can be modified by the caller to
  28500. // add HTTP headers to the request.
  28501. func (c *FloodlightActivityGroupsListCall) Header() http.Header {
  28502. if c.header_ == nil {
  28503. c.header_ = make(http.Header)
  28504. }
  28505. return c.header_
  28506. }
  28507. func (c *FloodlightActivityGroupsListCall) doRequest(alt string) (*http.Response, error) {
  28508. reqHeaders := make(http.Header)
  28509. for k, v := range c.header_ {
  28510. reqHeaders[k] = v
  28511. }
  28512. reqHeaders.Set("User-Agent", c.s.userAgent())
  28513. if c.ifNoneMatch_ != "" {
  28514. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  28515. }
  28516. var body io.Reader = nil
  28517. c.urlParams_.Set("alt", alt)
  28518. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  28519. urls += "?" + c.urlParams_.Encode()
  28520. req, _ := http.NewRequest("GET", urls, body)
  28521. req.Header = reqHeaders
  28522. googleapi.Expand(req.URL, map[string]string{
  28523. "profileId": strconv.FormatInt(c.profileId, 10),
  28524. })
  28525. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28526. }
  28527. // Do executes the "dfareporting.floodlightActivityGroups.list" call.
  28528. // Exactly one of *FloodlightActivityGroupsListResponse or error will be
  28529. // non-nil. Any non-2xx status code is an error. Response headers are in
  28530. // either *FloodlightActivityGroupsListResponse.ServerResponse.Header or
  28531. // (if a response was returned at all) in
  28532. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  28533. // whether the returned error was because http.StatusNotModified was
  28534. // returned.
  28535. func (c *FloodlightActivityGroupsListCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroupsListResponse, error) {
  28536. gensupport.SetOptions(c.urlParams_, opts...)
  28537. res, err := c.doRequest("json")
  28538. if res != nil && res.StatusCode == http.StatusNotModified {
  28539. if res.Body != nil {
  28540. res.Body.Close()
  28541. }
  28542. return nil, &googleapi.Error{
  28543. Code: res.StatusCode,
  28544. Header: res.Header,
  28545. }
  28546. }
  28547. if err != nil {
  28548. return nil, err
  28549. }
  28550. defer googleapi.CloseBody(res)
  28551. if err := googleapi.CheckResponse(res); err != nil {
  28552. return nil, err
  28553. }
  28554. ret := &FloodlightActivityGroupsListResponse{
  28555. ServerResponse: googleapi.ServerResponse{
  28556. Header: res.Header,
  28557. HTTPStatusCode: res.StatusCode,
  28558. },
  28559. }
  28560. target := &ret
  28561. if err := gensupport.DecodeResponse(target, res); err != nil {
  28562. return nil, err
  28563. }
  28564. return ret, nil
  28565. // {
  28566. // "description": "Retrieves a list of floodlight activity groups, possibly filtered. This method supports paging.",
  28567. // "httpMethod": "GET",
  28568. // "id": "dfareporting.floodlightActivityGroups.list",
  28569. // "parameterOrder": [
  28570. // "profileId"
  28571. // ],
  28572. // "parameters": {
  28573. // "advertiserId": {
  28574. // "description": "Select only floodlight activity groups with the specified advertiser ID. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  28575. // "format": "int64",
  28576. // "location": "query",
  28577. // "type": "string"
  28578. // },
  28579. // "floodlightConfigurationId": {
  28580. // "description": "Select only floodlight activity groups with the specified floodlight configuration ID. Must specify either advertiserId, or floodlightConfigurationId for a non-empty result.",
  28581. // "format": "int64",
  28582. // "location": "query",
  28583. // "type": "string"
  28584. // },
  28585. // "ids": {
  28586. // "description": "Select only floodlight activity groups with the specified IDs. Must specify either advertiserId or floodlightConfigurationId for a non-empty result.",
  28587. // "format": "int64",
  28588. // "location": "query",
  28589. // "repeated": true,
  28590. // "type": "string"
  28591. // },
  28592. // "maxResults": {
  28593. // "default": "1000",
  28594. // "description": "Maximum number of results to return.",
  28595. // "format": "int32",
  28596. // "location": "query",
  28597. // "maximum": "1000",
  28598. // "minimum": "0",
  28599. // "type": "integer"
  28600. // },
  28601. // "pageToken": {
  28602. // "description": "Value of the nextPageToken from the previous result page.",
  28603. // "location": "query",
  28604. // "type": "string"
  28605. // },
  28606. // "profileId": {
  28607. // "description": "User profile ID associated with this request.",
  28608. // "format": "int64",
  28609. // "location": "path",
  28610. // "required": true,
  28611. // "type": "string"
  28612. // },
  28613. // "searchString": {
  28614. // "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\".",
  28615. // "location": "query",
  28616. // "type": "string"
  28617. // },
  28618. // "sortField": {
  28619. // "default": "ID",
  28620. // "description": "Field by which to sort the list.",
  28621. // "enum": [
  28622. // "ID",
  28623. // "NAME"
  28624. // ],
  28625. // "enumDescriptions": [
  28626. // "",
  28627. // ""
  28628. // ],
  28629. // "location": "query",
  28630. // "type": "string"
  28631. // },
  28632. // "sortOrder": {
  28633. // "default": "ASCENDING",
  28634. // "description": "Order of sorted results.",
  28635. // "enum": [
  28636. // "ASCENDING",
  28637. // "DESCENDING"
  28638. // ],
  28639. // "enumDescriptions": [
  28640. // "",
  28641. // ""
  28642. // ],
  28643. // "location": "query",
  28644. // "type": "string"
  28645. // },
  28646. // "type": {
  28647. // "description": "Select only floodlight activity groups with the specified floodlight activity group type.",
  28648. // "enum": [
  28649. // "COUNTER",
  28650. // "SALE"
  28651. // ],
  28652. // "enumDescriptions": [
  28653. // "",
  28654. // ""
  28655. // ],
  28656. // "location": "query",
  28657. // "type": "string"
  28658. // }
  28659. // },
  28660. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  28661. // "response": {
  28662. // "$ref": "FloodlightActivityGroupsListResponse"
  28663. // },
  28664. // "scopes": [
  28665. // "https://www.googleapis.com/auth/dfatrafficking"
  28666. // ]
  28667. // }
  28668. }
  28669. // Pages invokes f for each page of results.
  28670. // A non-nil error returned from f will halt the iteration.
  28671. // The provided context supersedes any context provided to the Context method.
  28672. func (c *FloodlightActivityGroupsListCall) Pages(ctx context.Context, f func(*FloodlightActivityGroupsListResponse) error) error {
  28673. c.ctx_ = ctx
  28674. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  28675. for {
  28676. x, err := c.Do()
  28677. if err != nil {
  28678. return err
  28679. }
  28680. if err := f(x); err != nil {
  28681. return err
  28682. }
  28683. if x.NextPageToken == "" {
  28684. return nil
  28685. }
  28686. c.PageToken(x.NextPageToken)
  28687. }
  28688. }
  28689. // method id "dfareporting.floodlightActivityGroups.patch":
  28690. type FloodlightActivityGroupsPatchCall struct {
  28691. s *Service
  28692. profileId int64
  28693. floodlightactivitygroup *FloodlightActivityGroup
  28694. urlParams_ gensupport.URLParams
  28695. ctx_ context.Context
  28696. header_ http.Header
  28697. }
  28698. // Patch: Updates an existing floodlight activity group. This method
  28699. // supports patch semantics.
  28700. func (r *FloodlightActivityGroupsService) Patch(profileId int64, id int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsPatchCall {
  28701. c := &FloodlightActivityGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28702. c.profileId = profileId
  28703. c.urlParams_.Set("id", fmt.Sprint(id))
  28704. c.floodlightactivitygroup = floodlightactivitygroup
  28705. return c
  28706. }
  28707. // Fields allows partial responses to be retrieved. See
  28708. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28709. // for more information.
  28710. func (c *FloodlightActivityGroupsPatchCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsPatchCall {
  28711. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28712. return c
  28713. }
  28714. // Context sets the context to be used in this call's Do method. Any
  28715. // pending HTTP request will be aborted if the provided context is
  28716. // canceled.
  28717. func (c *FloodlightActivityGroupsPatchCall) Context(ctx context.Context) *FloodlightActivityGroupsPatchCall {
  28718. c.ctx_ = ctx
  28719. return c
  28720. }
  28721. // Header returns an http.Header that can be modified by the caller to
  28722. // add HTTP headers to the request.
  28723. func (c *FloodlightActivityGroupsPatchCall) Header() http.Header {
  28724. if c.header_ == nil {
  28725. c.header_ = make(http.Header)
  28726. }
  28727. return c.header_
  28728. }
  28729. func (c *FloodlightActivityGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  28730. reqHeaders := make(http.Header)
  28731. for k, v := range c.header_ {
  28732. reqHeaders[k] = v
  28733. }
  28734. reqHeaders.Set("User-Agent", c.s.userAgent())
  28735. var body io.Reader = nil
  28736. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  28737. if err != nil {
  28738. return nil, err
  28739. }
  28740. reqHeaders.Set("Content-Type", "application/json")
  28741. c.urlParams_.Set("alt", alt)
  28742. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  28743. urls += "?" + c.urlParams_.Encode()
  28744. req, _ := http.NewRequest("PATCH", urls, body)
  28745. req.Header = reqHeaders
  28746. googleapi.Expand(req.URL, map[string]string{
  28747. "profileId": strconv.FormatInt(c.profileId, 10),
  28748. })
  28749. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28750. }
  28751. // Do executes the "dfareporting.floodlightActivityGroups.patch" call.
  28752. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  28753. // non-2xx status code is an error. Response headers are in either
  28754. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  28755. // returned at all) in error.(*googleapi.Error).Header. Use
  28756. // googleapi.IsNotModified to check whether the returned error was
  28757. // because http.StatusNotModified was returned.
  28758. func (c *FloodlightActivityGroupsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  28759. gensupport.SetOptions(c.urlParams_, opts...)
  28760. res, err := c.doRequest("json")
  28761. if res != nil && res.StatusCode == http.StatusNotModified {
  28762. if res.Body != nil {
  28763. res.Body.Close()
  28764. }
  28765. return nil, &googleapi.Error{
  28766. Code: res.StatusCode,
  28767. Header: res.Header,
  28768. }
  28769. }
  28770. if err != nil {
  28771. return nil, err
  28772. }
  28773. defer googleapi.CloseBody(res)
  28774. if err := googleapi.CheckResponse(res); err != nil {
  28775. return nil, err
  28776. }
  28777. ret := &FloodlightActivityGroup{
  28778. ServerResponse: googleapi.ServerResponse{
  28779. Header: res.Header,
  28780. HTTPStatusCode: res.StatusCode,
  28781. },
  28782. }
  28783. target := &ret
  28784. if err := gensupport.DecodeResponse(target, res); err != nil {
  28785. return nil, err
  28786. }
  28787. return ret, nil
  28788. // {
  28789. // "description": "Updates an existing floodlight activity group. This method supports patch semantics.",
  28790. // "httpMethod": "PATCH",
  28791. // "id": "dfareporting.floodlightActivityGroups.patch",
  28792. // "parameterOrder": [
  28793. // "profileId",
  28794. // "id"
  28795. // ],
  28796. // "parameters": {
  28797. // "id": {
  28798. // "description": "Floodlight activity Group ID.",
  28799. // "format": "int64",
  28800. // "location": "query",
  28801. // "required": true,
  28802. // "type": "string"
  28803. // },
  28804. // "profileId": {
  28805. // "description": "User profile ID associated with this request.",
  28806. // "format": "int64",
  28807. // "location": "path",
  28808. // "required": true,
  28809. // "type": "string"
  28810. // }
  28811. // },
  28812. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  28813. // "request": {
  28814. // "$ref": "FloodlightActivityGroup"
  28815. // },
  28816. // "response": {
  28817. // "$ref": "FloodlightActivityGroup"
  28818. // },
  28819. // "scopes": [
  28820. // "https://www.googleapis.com/auth/dfatrafficking"
  28821. // ]
  28822. // }
  28823. }
  28824. // method id "dfareporting.floodlightActivityGroups.update":
  28825. type FloodlightActivityGroupsUpdateCall struct {
  28826. s *Service
  28827. profileId int64
  28828. floodlightactivitygroup *FloodlightActivityGroup
  28829. urlParams_ gensupport.URLParams
  28830. ctx_ context.Context
  28831. header_ http.Header
  28832. }
  28833. // Update: Updates an existing floodlight activity group.
  28834. func (r *FloodlightActivityGroupsService) Update(profileId int64, floodlightactivitygroup *FloodlightActivityGroup) *FloodlightActivityGroupsUpdateCall {
  28835. c := &FloodlightActivityGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28836. c.profileId = profileId
  28837. c.floodlightactivitygroup = floodlightactivitygroup
  28838. return c
  28839. }
  28840. // Fields allows partial responses to be retrieved. See
  28841. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28842. // for more information.
  28843. func (c *FloodlightActivityGroupsUpdateCall) Fields(s ...googleapi.Field) *FloodlightActivityGroupsUpdateCall {
  28844. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28845. return c
  28846. }
  28847. // Context sets the context to be used in this call's Do method. Any
  28848. // pending HTTP request will be aborted if the provided context is
  28849. // canceled.
  28850. func (c *FloodlightActivityGroupsUpdateCall) Context(ctx context.Context) *FloodlightActivityGroupsUpdateCall {
  28851. c.ctx_ = ctx
  28852. return c
  28853. }
  28854. // Header returns an http.Header that can be modified by the caller to
  28855. // add HTTP headers to the request.
  28856. func (c *FloodlightActivityGroupsUpdateCall) Header() http.Header {
  28857. if c.header_ == nil {
  28858. c.header_ = make(http.Header)
  28859. }
  28860. return c.header_
  28861. }
  28862. func (c *FloodlightActivityGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  28863. reqHeaders := make(http.Header)
  28864. for k, v := range c.header_ {
  28865. reqHeaders[k] = v
  28866. }
  28867. reqHeaders.Set("User-Agent", c.s.userAgent())
  28868. var body io.Reader = nil
  28869. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightactivitygroup)
  28870. if err != nil {
  28871. return nil, err
  28872. }
  28873. reqHeaders.Set("Content-Type", "application/json")
  28874. c.urlParams_.Set("alt", alt)
  28875. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightActivityGroups")
  28876. urls += "?" + c.urlParams_.Encode()
  28877. req, _ := http.NewRequest("PUT", urls, body)
  28878. req.Header = reqHeaders
  28879. googleapi.Expand(req.URL, map[string]string{
  28880. "profileId": strconv.FormatInt(c.profileId, 10),
  28881. })
  28882. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  28883. }
  28884. // Do executes the "dfareporting.floodlightActivityGroups.update" call.
  28885. // Exactly one of *FloodlightActivityGroup or error will be non-nil. Any
  28886. // non-2xx status code is an error. Response headers are in either
  28887. // *FloodlightActivityGroup.ServerResponse.Header or (if a response was
  28888. // returned at all) in error.(*googleapi.Error).Header. Use
  28889. // googleapi.IsNotModified to check whether the returned error was
  28890. // because http.StatusNotModified was returned.
  28891. func (c *FloodlightActivityGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightActivityGroup, error) {
  28892. gensupport.SetOptions(c.urlParams_, opts...)
  28893. res, err := c.doRequest("json")
  28894. if res != nil && res.StatusCode == http.StatusNotModified {
  28895. if res.Body != nil {
  28896. res.Body.Close()
  28897. }
  28898. return nil, &googleapi.Error{
  28899. Code: res.StatusCode,
  28900. Header: res.Header,
  28901. }
  28902. }
  28903. if err != nil {
  28904. return nil, err
  28905. }
  28906. defer googleapi.CloseBody(res)
  28907. if err := googleapi.CheckResponse(res); err != nil {
  28908. return nil, err
  28909. }
  28910. ret := &FloodlightActivityGroup{
  28911. ServerResponse: googleapi.ServerResponse{
  28912. Header: res.Header,
  28913. HTTPStatusCode: res.StatusCode,
  28914. },
  28915. }
  28916. target := &ret
  28917. if err := gensupport.DecodeResponse(target, res); err != nil {
  28918. return nil, err
  28919. }
  28920. return ret, nil
  28921. // {
  28922. // "description": "Updates an existing floodlight activity group.",
  28923. // "httpMethod": "PUT",
  28924. // "id": "dfareporting.floodlightActivityGroups.update",
  28925. // "parameterOrder": [
  28926. // "profileId"
  28927. // ],
  28928. // "parameters": {
  28929. // "profileId": {
  28930. // "description": "User profile ID associated with this request.",
  28931. // "format": "int64",
  28932. // "location": "path",
  28933. // "required": true,
  28934. // "type": "string"
  28935. // }
  28936. // },
  28937. // "path": "userprofiles/{profileId}/floodlightActivityGroups",
  28938. // "request": {
  28939. // "$ref": "FloodlightActivityGroup"
  28940. // },
  28941. // "response": {
  28942. // "$ref": "FloodlightActivityGroup"
  28943. // },
  28944. // "scopes": [
  28945. // "https://www.googleapis.com/auth/dfatrafficking"
  28946. // ]
  28947. // }
  28948. }
  28949. // method id "dfareporting.floodlightConfigurations.get":
  28950. type FloodlightConfigurationsGetCall struct {
  28951. s *Service
  28952. profileId int64
  28953. id int64
  28954. urlParams_ gensupport.URLParams
  28955. ifNoneMatch_ string
  28956. ctx_ context.Context
  28957. header_ http.Header
  28958. }
  28959. // Get: Gets one floodlight configuration by ID.
  28960. func (r *FloodlightConfigurationsService) Get(profileId int64, id int64) *FloodlightConfigurationsGetCall {
  28961. c := &FloodlightConfigurationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  28962. c.profileId = profileId
  28963. c.id = id
  28964. return c
  28965. }
  28966. // Fields allows partial responses to be retrieved. See
  28967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  28968. // for more information.
  28969. func (c *FloodlightConfigurationsGetCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsGetCall {
  28970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  28971. return c
  28972. }
  28973. // IfNoneMatch sets the optional parameter which makes the operation
  28974. // fail if the object's ETag matches the given value. This is useful for
  28975. // getting updates only after the object has changed since the last
  28976. // request. Use googleapi.IsNotModified to check whether the response
  28977. // error from Do is the result of In-None-Match.
  28978. func (c *FloodlightConfigurationsGetCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsGetCall {
  28979. c.ifNoneMatch_ = entityTag
  28980. return c
  28981. }
  28982. // Context sets the context to be used in this call's Do method. Any
  28983. // pending HTTP request will be aborted if the provided context is
  28984. // canceled.
  28985. func (c *FloodlightConfigurationsGetCall) Context(ctx context.Context) *FloodlightConfigurationsGetCall {
  28986. c.ctx_ = ctx
  28987. return c
  28988. }
  28989. // Header returns an http.Header that can be modified by the caller to
  28990. // add HTTP headers to the request.
  28991. func (c *FloodlightConfigurationsGetCall) Header() http.Header {
  28992. if c.header_ == nil {
  28993. c.header_ = make(http.Header)
  28994. }
  28995. return c.header_
  28996. }
  28997. func (c *FloodlightConfigurationsGetCall) doRequest(alt string) (*http.Response, error) {
  28998. reqHeaders := make(http.Header)
  28999. for k, v := range c.header_ {
  29000. reqHeaders[k] = v
  29001. }
  29002. reqHeaders.Set("User-Agent", c.s.userAgent())
  29003. if c.ifNoneMatch_ != "" {
  29004. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29005. }
  29006. var body io.Reader = nil
  29007. c.urlParams_.Set("alt", alt)
  29008. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations/{id}")
  29009. urls += "?" + c.urlParams_.Encode()
  29010. req, _ := http.NewRequest("GET", urls, body)
  29011. req.Header = reqHeaders
  29012. googleapi.Expand(req.URL, map[string]string{
  29013. "profileId": strconv.FormatInt(c.profileId, 10),
  29014. "id": strconv.FormatInt(c.id, 10),
  29015. })
  29016. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29017. }
  29018. // Do executes the "dfareporting.floodlightConfigurations.get" call.
  29019. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  29020. // non-2xx status code is an error. Response headers are in either
  29021. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  29022. // returned at all) in error.(*googleapi.Error).Header. Use
  29023. // googleapi.IsNotModified to check whether the returned error was
  29024. // because http.StatusNotModified was returned.
  29025. func (c *FloodlightConfigurationsGetCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  29026. gensupport.SetOptions(c.urlParams_, opts...)
  29027. res, err := c.doRequest("json")
  29028. if res != nil && res.StatusCode == http.StatusNotModified {
  29029. if res.Body != nil {
  29030. res.Body.Close()
  29031. }
  29032. return nil, &googleapi.Error{
  29033. Code: res.StatusCode,
  29034. Header: res.Header,
  29035. }
  29036. }
  29037. if err != nil {
  29038. return nil, err
  29039. }
  29040. defer googleapi.CloseBody(res)
  29041. if err := googleapi.CheckResponse(res); err != nil {
  29042. return nil, err
  29043. }
  29044. ret := &FloodlightConfiguration{
  29045. ServerResponse: googleapi.ServerResponse{
  29046. Header: res.Header,
  29047. HTTPStatusCode: res.StatusCode,
  29048. },
  29049. }
  29050. target := &ret
  29051. if err := gensupport.DecodeResponse(target, res); err != nil {
  29052. return nil, err
  29053. }
  29054. return ret, nil
  29055. // {
  29056. // "description": "Gets one floodlight configuration by ID.",
  29057. // "httpMethod": "GET",
  29058. // "id": "dfareporting.floodlightConfigurations.get",
  29059. // "parameterOrder": [
  29060. // "profileId",
  29061. // "id"
  29062. // ],
  29063. // "parameters": {
  29064. // "id": {
  29065. // "description": "Floodlight configuration ID.",
  29066. // "format": "int64",
  29067. // "location": "path",
  29068. // "required": true,
  29069. // "type": "string"
  29070. // },
  29071. // "profileId": {
  29072. // "description": "User profile ID associated with this request.",
  29073. // "format": "int64",
  29074. // "location": "path",
  29075. // "required": true,
  29076. // "type": "string"
  29077. // }
  29078. // },
  29079. // "path": "userprofiles/{profileId}/floodlightConfigurations/{id}",
  29080. // "response": {
  29081. // "$ref": "FloodlightConfiguration"
  29082. // },
  29083. // "scopes": [
  29084. // "https://www.googleapis.com/auth/dfatrafficking"
  29085. // ]
  29086. // }
  29087. }
  29088. // method id "dfareporting.floodlightConfigurations.list":
  29089. type FloodlightConfigurationsListCall struct {
  29090. s *Service
  29091. profileId int64
  29092. urlParams_ gensupport.URLParams
  29093. ifNoneMatch_ string
  29094. ctx_ context.Context
  29095. header_ http.Header
  29096. }
  29097. // List: Retrieves a list of floodlight configurations, possibly
  29098. // filtered.
  29099. func (r *FloodlightConfigurationsService) List(profileId int64) *FloodlightConfigurationsListCall {
  29100. c := &FloodlightConfigurationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29101. c.profileId = profileId
  29102. return c
  29103. }
  29104. // Ids sets the optional parameter "ids": Set of IDs of floodlight
  29105. // configurations to retrieve. Required field; otherwise an empty list
  29106. // will be returned.
  29107. func (c *FloodlightConfigurationsListCall) Ids(ids ...int64) *FloodlightConfigurationsListCall {
  29108. var ids_ []string
  29109. for _, v := range ids {
  29110. ids_ = append(ids_, fmt.Sprint(v))
  29111. }
  29112. c.urlParams_.SetMulti("ids", ids_)
  29113. return c
  29114. }
  29115. // Fields allows partial responses to be retrieved. See
  29116. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29117. // for more information.
  29118. func (c *FloodlightConfigurationsListCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsListCall {
  29119. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29120. return c
  29121. }
  29122. // IfNoneMatch sets the optional parameter which makes the operation
  29123. // fail if the object's ETag matches the given value. This is useful for
  29124. // getting updates only after the object has changed since the last
  29125. // request. Use googleapi.IsNotModified to check whether the response
  29126. // error from Do is the result of In-None-Match.
  29127. func (c *FloodlightConfigurationsListCall) IfNoneMatch(entityTag string) *FloodlightConfigurationsListCall {
  29128. c.ifNoneMatch_ = entityTag
  29129. return c
  29130. }
  29131. // Context sets the context to be used in this call's Do method. Any
  29132. // pending HTTP request will be aborted if the provided context is
  29133. // canceled.
  29134. func (c *FloodlightConfigurationsListCall) Context(ctx context.Context) *FloodlightConfigurationsListCall {
  29135. c.ctx_ = ctx
  29136. return c
  29137. }
  29138. // Header returns an http.Header that can be modified by the caller to
  29139. // add HTTP headers to the request.
  29140. func (c *FloodlightConfigurationsListCall) Header() http.Header {
  29141. if c.header_ == nil {
  29142. c.header_ = make(http.Header)
  29143. }
  29144. return c.header_
  29145. }
  29146. func (c *FloodlightConfigurationsListCall) doRequest(alt string) (*http.Response, error) {
  29147. reqHeaders := make(http.Header)
  29148. for k, v := range c.header_ {
  29149. reqHeaders[k] = v
  29150. }
  29151. reqHeaders.Set("User-Agent", c.s.userAgent())
  29152. if c.ifNoneMatch_ != "" {
  29153. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29154. }
  29155. var body io.Reader = nil
  29156. c.urlParams_.Set("alt", alt)
  29157. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  29158. urls += "?" + c.urlParams_.Encode()
  29159. req, _ := http.NewRequest("GET", urls, body)
  29160. req.Header = reqHeaders
  29161. googleapi.Expand(req.URL, map[string]string{
  29162. "profileId": strconv.FormatInt(c.profileId, 10),
  29163. })
  29164. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29165. }
  29166. // Do executes the "dfareporting.floodlightConfigurations.list" call.
  29167. // Exactly one of *FloodlightConfigurationsListResponse or error will be
  29168. // non-nil. Any non-2xx status code is an error. Response headers are in
  29169. // either *FloodlightConfigurationsListResponse.ServerResponse.Header or
  29170. // (if a response was returned at all) in
  29171. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  29172. // whether the returned error was because http.StatusNotModified was
  29173. // returned.
  29174. func (c *FloodlightConfigurationsListCall) Do(opts ...googleapi.CallOption) (*FloodlightConfigurationsListResponse, error) {
  29175. gensupport.SetOptions(c.urlParams_, opts...)
  29176. res, err := c.doRequest("json")
  29177. if res != nil && res.StatusCode == http.StatusNotModified {
  29178. if res.Body != nil {
  29179. res.Body.Close()
  29180. }
  29181. return nil, &googleapi.Error{
  29182. Code: res.StatusCode,
  29183. Header: res.Header,
  29184. }
  29185. }
  29186. if err != nil {
  29187. return nil, err
  29188. }
  29189. defer googleapi.CloseBody(res)
  29190. if err := googleapi.CheckResponse(res); err != nil {
  29191. return nil, err
  29192. }
  29193. ret := &FloodlightConfigurationsListResponse{
  29194. ServerResponse: googleapi.ServerResponse{
  29195. Header: res.Header,
  29196. HTTPStatusCode: res.StatusCode,
  29197. },
  29198. }
  29199. target := &ret
  29200. if err := gensupport.DecodeResponse(target, res); err != nil {
  29201. return nil, err
  29202. }
  29203. return ret, nil
  29204. // {
  29205. // "description": "Retrieves a list of floodlight configurations, possibly filtered.",
  29206. // "httpMethod": "GET",
  29207. // "id": "dfareporting.floodlightConfigurations.list",
  29208. // "parameterOrder": [
  29209. // "profileId"
  29210. // ],
  29211. // "parameters": {
  29212. // "ids": {
  29213. // "description": "Set of IDs of floodlight configurations to retrieve. Required field; otherwise an empty list will be returned.",
  29214. // "format": "int64",
  29215. // "location": "query",
  29216. // "repeated": true,
  29217. // "type": "string"
  29218. // },
  29219. // "profileId": {
  29220. // "description": "User profile ID associated with this request.",
  29221. // "format": "int64",
  29222. // "location": "path",
  29223. // "required": true,
  29224. // "type": "string"
  29225. // }
  29226. // },
  29227. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  29228. // "response": {
  29229. // "$ref": "FloodlightConfigurationsListResponse"
  29230. // },
  29231. // "scopes": [
  29232. // "https://www.googleapis.com/auth/dfatrafficking"
  29233. // ]
  29234. // }
  29235. }
  29236. // method id "dfareporting.floodlightConfigurations.patch":
  29237. type FloodlightConfigurationsPatchCall struct {
  29238. s *Service
  29239. profileId int64
  29240. floodlightconfiguration *FloodlightConfiguration
  29241. urlParams_ gensupport.URLParams
  29242. ctx_ context.Context
  29243. header_ http.Header
  29244. }
  29245. // Patch: Updates an existing floodlight configuration. This method
  29246. // supports patch semantics.
  29247. func (r *FloodlightConfigurationsService) Patch(profileId int64, id int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsPatchCall {
  29248. c := &FloodlightConfigurationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29249. c.profileId = profileId
  29250. c.urlParams_.Set("id", fmt.Sprint(id))
  29251. c.floodlightconfiguration = floodlightconfiguration
  29252. return c
  29253. }
  29254. // Fields allows partial responses to be retrieved. See
  29255. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29256. // for more information.
  29257. func (c *FloodlightConfigurationsPatchCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsPatchCall {
  29258. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29259. return c
  29260. }
  29261. // Context sets the context to be used in this call's Do method. Any
  29262. // pending HTTP request will be aborted if the provided context is
  29263. // canceled.
  29264. func (c *FloodlightConfigurationsPatchCall) Context(ctx context.Context) *FloodlightConfigurationsPatchCall {
  29265. c.ctx_ = ctx
  29266. return c
  29267. }
  29268. // Header returns an http.Header that can be modified by the caller to
  29269. // add HTTP headers to the request.
  29270. func (c *FloodlightConfigurationsPatchCall) Header() http.Header {
  29271. if c.header_ == nil {
  29272. c.header_ = make(http.Header)
  29273. }
  29274. return c.header_
  29275. }
  29276. func (c *FloodlightConfigurationsPatchCall) doRequest(alt string) (*http.Response, error) {
  29277. reqHeaders := make(http.Header)
  29278. for k, v := range c.header_ {
  29279. reqHeaders[k] = v
  29280. }
  29281. reqHeaders.Set("User-Agent", c.s.userAgent())
  29282. var body io.Reader = nil
  29283. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  29284. if err != nil {
  29285. return nil, err
  29286. }
  29287. reqHeaders.Set("Content-Type", "application/json")
  29288. c.urlParams_.Set("alt", alt)
  29289. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  29290. urls += "?" + c.urlParams_.Encode()
  29291. req, _ := http.NewRequest("PATCH", urls, body)
  29292. req.Header = reqHeaders
  29293. googleapi.Expand(req.URL, map[string]string{
  29294. "profileId": strconv.FormatInt(c.profileId, 10),
  29295. })
  29296. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29297. }
  29298. // Do executes the "dfareporting.floodlightConfigurations.patch" call.
  29299. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  29300. // non-2xx status code is an error. Response headers are in either
  29301. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  29302. // returned at all) in error.(*googleapi.Error).Header. Use
  29303. // googleapi.IsNotModified to check whether the returned error was
  29304. // because http.StatusNotModified was returned.
  29305. func (c *FloodlightConfigurationsPatchCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  29306. gensupport.SetOptions(c.urlParams_, opts...)
  29307. res, err := c.doRequest("json")
  29308. if res != nil && res.StatusCode == http.StatusNotModified {
  29309. if res.Body != nil {
  29310. res.Body.Close()
  29311. }
  29312. return nil, &googleapi.Error{
  29313. Code: res.StatusCode,
  29314. Header: res.Header,
  29315. }
  29316. }
  29317. if err != nil {
  29318. return nil, err
  29319. }
  29320. defer googleapi.CloseBody(res)
  29321. if err := googleapi.CheckResponse(res); err != nil {
  29322. return nil, err
  29323. }
  29324. ret := &FloodlightConfiguration{
  29325. ServerResponse: googleapi.ServerResponse{
  29326. Header: res.Header,
  29327. HTTPStatusCode: res.StatusCode,
  29328. },
  29329. }
  29330. target := &ret
  29331. if err := gensupport.DecodeResponse(target, res); err != nil {
  29332. return nil, err
  29333. }
  29334. return ret, nil
  29335. // {
  29336. // "description": "Updates an existing floodlight configuration. This method supports patch semantics.",
  29337. // "httpMethod": "PATCH",
  29338. // "id": "dfareporting.floodlightConfigurations.patch",
  29339. // "parameterOrder": [
  29340. // "profileId",
  29341. // "id"
  29342. // ],
  29343. // "parameters": {
  29344. // "id": {
  29345. // "description": "Floodlight configuration ID.",
  29346. // "format": "int64",
  29347. // "location": "query",
  29348. // "required": true,
  29349. // "type": "string"
  29350. // },
  29351. // "profileId": {
  29352. // "description": "User profile ID associated with this request.",
  29353. // "format": "int64",
  29354. // "location": "path",
  29355. // "required": true,
  29356. // "type": "string"
  29357. // }
  29358. // },
  29359. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  29360. // "request": {
  29361. // "$ref": "FloodlightConfiguration"
  29362. // },
  29363. // "response": {
  29364. // "$ref": "FloodlightConfiguration"
  29365. // },
  29366. // "scopes": [
  29367. // "https://www.googleapis.com/auth/dfatrafficking"
  29368. // ]
  29369. // }
  29370. }
  29371. // method id "dfareporting.floodlightConfigurations.update":
  29372. type FloodlightConfigurationsUpdateCall struct {
  29373. s *Service
  29374. profileId int64
  29375. floodlightconfiguration *FloodlightConfiguration
  29376. urlParams_ gensupport.URLParams
  29377. ctx_ context.Context
  29378. header_ http.Header
  29379. }
  29380. // Update: Updates an existing floodlight configuration.
  29381. func (r *FloodlightConfigurationsService) Update(profileId int64, floodlightconfiguration *FloodlightConfiguration) *FloodlightConfigurationsUpdateCall {
  29382. c := &FloodlightConfigurationsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29383. c.profileId = profileId
  29384. c.floodlightconfiguration = floodlightconfiguration
  29385. return c
  29386. }
  29387. // Fields allows partial responses to be retrieved. See
  29388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29389. // for more information.
  29390. func (c *FloodlightConfigurationsUpdateCall) Fields(s ...googleapi.Field) *FloodlightConfigurationsUpdateCall {
  29391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29392. return c
  29393. }
  29394. // Context sets the context to be used in this call's Do method. Any
  29395. // pending HTTP request will be aborted if the provided context is
  29396. // canceled.
  29397. func (c *FloodlightConfigurationsUpdateCall) Context(ctx context.Context) *FloodlightConfigurationsUpdateCall {
  29398. c.ctx_ = ctx
  29399. return c
  29400. }
  29401. // Header returns an http.Header that can be modified by the caller to
  29402. // add HTTP headers to the request.
  29403. func (c *FloodlightConfigurationsUpdateCall) Header() http.Header {
  29404. if c.header_ == nil {
  29405. c.header_ = make(http.Header)
  29406. }
  29407. return c.header_
  29408. }
  29409. func (c *FloodlightConfigurationsUpdateCall) doRequest(alt string) (*http.Response, error) {
  29410. reqHeaders := make(http.Header)
  29411. for k, v := range c.header_ {
  29412. reqHeaders[k] = v
  29413. }
  29414. reqHeaders.Set("User-Agent", c.s.userAgent())
  29415. var body io.Reader = nil
  29416. body, err := googleapi.WithoutDataWrapper.JSONReader(c.floodlightconfiguration)
  29417. if err != nil {
  29418. return nil, err
  29419. }
  29420. reqHeaders.Set("Content-Type", "application/json")
  29421. c.urlParams_.Set("alt", alt)
  29422. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/floodlightConfigurations")
  29423. urls += "?" + c.urlParams_.Encode()
  29424. req, _ := http.NewRequest("PUT", urls, body)
  29425. req.Header = reqHeaders
  29426. googleapi.Expand(req.URL, map[string]string{
  29427. "profileId": strconv.FormatInt(c.profileId, 10),
  29428. })
  29429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29430. }
  29431. // Do executes the "dfareporting.floodlightConfigurations.update" call.
  29432. // Exactly one of *FloodlightConfiguration or error will be non-nil. Any
  29433. // non-2xx status code is an error. Response headers are in either
  29434. // *FloodlightConfiguration.ServerResponse.Header or (if a response was
  29435. // returned at all) in error.(*googleapi.Error).Header. Use
  29436. // googleapi.IsNotModified to check whether the returned error was
  29437. // because http.StatusNotModified was returned.
  29438. func (c *FloodlightConfigurationsUpdateCall) Do(opts ...googleapi.CallOption) (*FloodlightConfiguration, error) {
  29439. gensupport.SetOptions(c.urlParams_, opts...)
  29440. res, err := c.doRequest("json")
  29441. if res != nil && res.StatusCode == http.StatusNotModified {
  29442. if res.Body != nil {
  29443. res.Body.Close()
  29444. }
  29445. return nil, &googleapi.Error{
  29446. Code: res.StatusCode,
  29447. Header: res.Header,
  29448. }
  29449. }
  29450. if err != nil {
  29451. return nil, err
  29452. }
  29453. defer googleapi.CloseBody(res)
  29454. if err := googleapi.CheckResponse(res); err != nil {
  29455. return nil, err
  29456. }
  29457. ret := &FloodlightConfiguration{
  29458. ServerResponse: googleapi.ServerResponse{
  29459. Header: res.Header,
  29460. HTTPStatusCode: res.StatusCode,
  29461. },
  29462. }
  29463. target := &ret
  29464. if err := gensupport.DecodeResponse(target, res); err != nil {
  29465. return nil, err
  29466. }
  29467. return ret, nil
  29468. // {
  29469. // "description": "Updates an existing floodlight configuration.",
  29470. // "httpMethod": "PUT",
  29471. // "id": "dfareporting.floodlightConfigurations.update",
  29472. // "parameterOrder": [
  29473. // "profileId"
  29474. // ],
  29475. // "parameters": {
  29476. // "profileId": {
  29477. // "description": "User profile ID associated with this request.",
  29478. // "format": "int64",
  29479. // "location": "path",
  29480. // "required": true,
  29481. // "type": "string"
  29482. // }
  29483. // },
  29484. // "path": "userprofiles/{profileId}/floodlightConfigurations",
  29485. // "request": {
  29486. // "$ref": "FloodlightConfiguration"
  29487. // },
  29488. // "response": {
  29489. // "$ref": "FloodlightConfiguration"
  29490. // },
  29491. // "scopes": [
  29492. // "https://www.googleapis.com/auth/dfatrafficking"
  29493. // ]
  29494. // }
  29495. }
  29496. // method id "dfareporting.inventoryItems.get":
  29497. type InventoryItemsGetCall struct {
  29498. s *Service
  29499. profileId int64
  29500. projectId int64
  29501. id int64
  29502. urlParams_ gensupport.URLParams
  29503. ifNoneMatch_ string
  29504. ctx_ context.Context
  29505. header_ http.Header
  29506. }
  29507. // Get: Gets one inventory item by ID.
  29508. func (r *InventoryItemsService) Get(profileId int64, projectId int64, id int64) *InventoryItemsGetCall {
  29509. c := &InventoryItemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29510. c.profileId = profileId
  29511. c.projectId = projectId
  29512. c.id = id
  29513. return c
  29514. }
  29515. // Fields allows partial responses to be retrieved. See
  29516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29517. // for more information.
  29518. func (c *InventoryItemsGetCall) Fields(s ...googleapi.Field) *InventoryItemsGetCall {
  29519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29520. return c
  29521. }
  29522. // IfNoneMatch sets the optional parameter which makes the operation
  29523. // fail if the object's ETag matches the given value. This is useful for
  29524. // getting updates only after the object has changed since the last
  29525. // request. Use googleapi.IsNotModified to check whether the response
  29526. // error from Do is the result of In-None-Match.
  29527. func (c *InventoryItemsGetCall) IfNoneMatch(entityTag string) *InventoryItemsGetCall {
  29528. c.ifNoneMatch_ = entityTag
  29529. return c
  29530. }
  29531. // Context sets the context to be used in this call's Do method. Any
  29532. // pending HTTP request will be aborted if the provided context is
  29533. // canceled.
  29534. func (c *InventoryItemsGetCall) Context(ctx context.Context) *InventoryItemsGetCall {
  29535. c.ctx_ = ctx
  29536. return c
  29537. }
  29538. // Header returns an http.Header that can be modified by the caller to
  29539. // add HTTP headers to the request.
  29540. func (c *InventoryItemsGetCall) Header() http.Header {
  29541. if c.header_ == nil {
  29542. c.header_ = make(http.Header)
  29543. }
  29544. return c.header_
  29545. }
  29546. func (c *InventoryItemsGetCall) doRequest(alt string) (*http.Response, error) {
  29547. reqHeaders := make(http.Header)
  29548. for k, v := range c.header_ {
  29549. reqHeaders[k] = v
  29550. }
  29551. reqHeaders.Set("User-Agent", c.s.userAgent())
  29552. if c.ifNoneMatch_ != "" {
  29553. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29554. }
  29555. var body io.Reader = nil
  29556. c.urlParams_.Set("alt", alt)
  29557. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}")
  29558. urls += "?" + c.urlParams_.Encode()
  29559. req, _ := http.NewRequest("GET", urls, body)
  29560. req.Header = reqHeaders
  29561. googleapi.Expand(req.URL, map[string]string{
  29562. "profileId": strconv.FormatInt(c.profileId, 10),
  29563. "projectId": strconv.FormatInt(c.projectId, 10),
  29564. "id": strconv.FormatInt(c.id, 10),
  29565. })
  29566. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29567. }
  29568. // Do executes the "dfareporting.inventoryItems.get" call.
  29569. // Exactly one of *InventoryItem or error will be non-nil. Any non-2xx
  29570. // status code is an error. Response headers are in either
  29571. // *InventoryItem.ServerResponse.Header or (if a response was returned
  29572. // at all) in error.(*googleapi.Error).Header. Use
  29573. // googleapi.IsNotModified to check whether the returned error was
  29574. // because http.StatusNotModified was returned.
  29575. func (c *InventoryItemsGetCall) Do(opts ...googleapi.CallOption) (*InventoryItem, error) {
  29576. gensupport.SetOptions(c.urlParams_, opts...)
  29577. res, err := c.doRequest("json")
  29578. if res != nil && res.StatusCode == http.StatusNotModified {
  29579. if res.Body != nil {
  29580. res.Body.Close()
  29581. }
  29582. return nil, &googleapi.Error{
  29583. Code: res.StatusCode,
  29584. Header: res.Header,
  29585. }
  29586. }
  29587. if err != nil {
  29588. return nil, err
  29589. }
  29590. defer googleapi.CloseBody(res)
  29591. if err := googleapi.CheckResponse(res); err != nil {
  29592. return nil, err
  29593. }
  29594. ret := &InventoryItem{
  29595. ServerResponse: googleapi.ServerResponse{
  29596. Header: res.Header,
  29597. HTTPStatusCode: res.StatusCode,
  29598. },
  29599. }
  29600. target := &ret
  29601. if err := gensupport.DecodeResponse(target, res); err != nil {
  29602. return nil, err
  29603. }
  29604. return ret, nil
  29605. // {
  29606. // "description": "Gets one inventory item by ID.",
  29607. // "httpMethod": "GET",
  29608. // "id": "dfareporting.inventoryItems.get",
  29609. // "parameterOrder": [
  29610. // "profileId",
  29611. // "projectId",
  29612. // "id"
  29613. // ],
  29614. // "parameters": {
  29615. // "id": {
  29616. // "description": "Inventory item ID.",
  29617. // "format": "int64",
  29618. // "location": "path",
  29619. // "required": true,
  29620. // "type": "string"
  29621. // },
  29622. // "profileId": {
  29623. // "description": "User profile ID associated with this request.",
  29624. // "format": "int64",
  29625. // "location": "path",
  29626. // "required": true,
  29627. // "type": "string"
  29628. // },
  29629. // "projectId": {
  29630. // "description": "Project ID for order documents.",
  29631. // "format": "int64",
  29632. // "location": "path",
  29633. // "required": true,
  29634. // "type": "string"
  29635. // }
  29636. // },
  29637. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems/{id}",
  29638. // "response": {
  29639. // "$ref": "InventoryItem"
  29640. // },
  29641. // "scopes": [
  29642. // "https://www.googleapis.com/auth/dfatrafficking"
  29643. // ]
  29644. // }
  29645. }
  29646. // method id "dfareporting.inventoryItems.list":
  29647. type InventoryItemsListCall struct {
  29648. s *Service
  29649. profileId int64
  29650. projectId int64
  29651. urlParams_ gensupport.URLParams
  29652. ifNoneMatch_ string
  29653. ctx_ context.Context
  29654. header_ http.Header
  29655. }
  29656. // List: Retrieves a list of inventory items, possibly filtered. This
  29657. // method supports paging.
  29658. func (r *InventoryItemsService) List(profileId int64, projectId int64) *InventoryItemsListCall {
  29659. c := &InventoryItemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29660. c.profileId = profileId
  29661. c.projectId = projectId
  29662. return c
  29663. }
  29664. // Ids sets the optional parameter "ids": Select only inventory items
  29665. // with these IDs.
  29666. func (c *InventoryItemsListCall) Ids(ids ...int64) *InventoryItemsListCall {
  29667. var ids_ []string
  29668. for _, v := range ids {
  29669. ids_ = append(ids_, fmt.Sprint(v))
  29670. }
  29671. c.urlParams_.SetMulti("ids", ids_)
  29672. return c
  29673. }
  29674. // InPlan sets the optional parameter "inPlan": Select only inventory
  29675. // items that are in plan.
  29676. func (c *InventoryItemsListCall) InPlan(inPlan bool) *InventoryItemsListCall {
  29677. c.urlParams_.Set("inPlan", fmt.Sprint(inPlan))
  29678. return c
  29679. }
  29680. // MaxResults sets the optional parameter "maxResults": Maximum number
  29681. // of results to return.
  29682. func (c *InventoryItemsListCall) MaxResults(maxResults int64) *InventoryItemsListCall {
  29683. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  29684. return c
  29685. }
  29686. // OrderId sets the optional parameter "orderId": Select only inventory
  29687. // items that belong to specified orders.
  29688. func (c *InventoryItemsListCall) OrderId(orderId ...int64) *InventoryItemsListCall {
  29689. var orderId_ []string
  29690. for _, v := range orderId {
  29691. orderId_ = append(orderId_, fmt.Sprint(v))
  29692. }
  29693. c.urlParams_.SetMulti("orderId", orderId_)
  29694. return c
  29695. }
  29696. // PageToken sets the optional parameter "pageToken": Value of the
  29697. // nextPageToken from the previous result page.
  29698. func (c *InventoryItemsListCall) PageToken(pageToken string) *InventoryItemsListCall {
  29699. c.urlParams_.Set("pageToken", pageToken)
  29700. return c
  29701. }
  29702. // SiteId sets the optional parameter "siteId": Select only inventory
  29703. // items that are associated with these sites.
  29704. func (c *InventoryItemsListCall) SiteId(siteId ...int64) *InventoryItemsListCall {
  29705. var siteId_ []string
  29706. for _, v := range siteId {
  29707. siteId_ = append(siteId_, fmt.Sprint(v))
  29708. }
  29709. c.urlParams_.SetMulti("siteId", siteId_)
  29710. return c
  29711. }
  29712. // SortField sets the optional parameter "sortField": Field by which to
  29713. // sort the list.
  29714. //
  29715. // Possible values:
  29716. // "ID" (default)
  29717. // "NAME"
  29718. func (c *InventoryItemsListCall) SortField(sortField string) *InventoryItemsListCall {
  29719. c.urlParams_.Set("sortField", sortField)
  29720. return c
  29721. }
  29722. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  29723. // results.
  29724. //
  29725. // Possible values:
  29726. // "ASCENDING" (default)
  29727. // "DESCENDING"
  29728. func (c *InventoryItemsListCall) SortOrder(sortOrder string) *InventoryItemsListCall {
  29729. c.urlParams_.Set("sortOrder", sortOrder)
  29730. return c
  29731. }
  29732. // Type sets the optional parameter "type": Select only inventory items
  29733. // with this type.
  29734. //
  29735. // Possible values:
  29736. // "PLANNING_PLACEMENT_TYPE_CREDIT"
  29737. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  29738. func (c *InventoryItemsListCall) Type(type_ string) *InventoryItemsListCall {
  29739. c.urlParams_.Set("type", type_)
  29740. return c
  29741. }
  29742. // Fields allows partial responses to be retrieved. See
  29743. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29744. // for more information.
  29745. func (c *InventoryItemsListCall) Fields(s ...googleapi.Field) *InventoryItemsListCall {
  29746. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29747. return c
  29748. }
  29749. // IfNoneMatch sets the optional parameter which makes the operation
  29750. // fail if the object's ETag matches the given value. This is useful for
  29751. // getting updates only after the object has changed since the last
  29752. // request. Use googleapi.IsNotModified to check whether the response
  29753. // error from Do is the result of In-None-Match.
  29754. func (c *InventoryItemsListCall) IfNoneMatch(entityTag string) *InventoryItemsListCall {
  29755. c.ifNoneMatch_ = entityTag
  29756. return c
  29757. }
  29758. // Context sets the context to be used in this call's Do method. Any
  29759. // pending HTTP request will be aborted if the provided context is
  29760. // canceled.
  29761. func (c *InventoryItemsListCall) Context(ctx context.Context) *InventoryItemsListCall {
  29762. c.ctx_ = ctx
  29763. return c
  29764. }
  29765. // Header returns an http.Header that can be modified by the caller to
  29766. // add HTTP headers to the request.
  29767. func (c *InventoryItemsListCall) Header() http.Header {
  29768. if c.header_ == nil {
  29769. c.header_ = make(http.Header)
  29770. }
  29771. return c.header_
  29772. }
  29773. func (c *InventoryItemsListCall) doRequest(alt string) (*http.Response, error) {
  29774. reqHeaders := make(http.Header)
  29775. for k, v := range c.header_ {
  29776. reqHeaders[k] = v
  29777. }
  29778. reqHeaders.Set("User-Agent", c.s.userAgent())
  29779. if c.ifNoneMatch_ != "" {
  29780. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  29781. }
  29782. var body io.Reader = nil
  29783. c.urlParams_.Set("alt", alt)
  29784. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/inventoryItems")
  29785. urls += "?" + c.urlParams_.Encode()
  29786. req, _ := http.NewRequest("GET", urls, body)
  29787. req.Header = reqHeaders
  29788. googleapi.Expand(req.URL, map[string]string{
  29789. "profileId": strconv.FormatInt(c.profileId, 10),
  29790. "projectId": strconv.FormatInt(c.projectId, 10),
  29791. })
  29792. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  29793. }
  29794. // Do executes the "dfareporting.inventoryItems.list" call.
  29795. // Exactly one of *InventoryItemsListResponse or error will be non-nil.
  29796. // Any non-2xx status code is an error. Response headers are in either
  29797. // *InventoryItemsListResponse.ServerResponse.Header or (if a response
  29798. // was returned at all) in error.(*googleapi.Error).Header. Use
  29799. // googleapi.IsNotModified to check whether the returned error was
  29800. // because http.StatusNotModified was returned.
  29801. func (c *InventoryItemsListCall) Do(opts ...googleapi.CallOption) (*InventoryItemsListResponse, error) {
  29802. gensupport.SetOptions(c.urlParams_, opts...)
  29803. res, err := c.doRequest("json")
  29804. if res != nil && res.StatusCode == http.StatusNotModified {
  29805. if res.Body != nil {
  29806. res.Body.Close()
  29807. }
  29808. return nil, &googleapi.Error{
  29809. Code: res.StatusCode,
  29810. Header: res.Header,
  29811. }
  29812. }
  29813. if err != nil {
  29814. return nil, err
  29815. }
  29816. defer googleapi.CloseBody(res)
  29817. if err := googleapi.CheckResponse(res); err != nil {
  29818. return nil, err
  29819. }
  29820. ret := &InventoryItemsListResponse{
  29821. ServerResponse: googleapi.ServerResponse{
  29822. Header: res.Header,
  29823. HTTPStatusCode: res.StatusCode,
  29824. },
  29825. }
  29826. target := &ret
  29827. if err := gensupport.DecodeResponse(target, res); err != nil {
  29828. return nil, err
  29829. }
  29830. return ret, nil
  29831. // {
  29832. // "description": "Retrieves a list of inventory items, possibly filtered. This method supports paging.",
  29833. // "httpMethod": "GET",
  29834. // "id": "dfareporting.inventoryItems.list",
  29835. // "parameterOrder": [
  29836. // "profileId",
  29837. // "projectId"
  29838. // ],
  29839. // "parameters": {
  29840. // "ids": {
  29841. // "description": "Select only inventory items with these IDs.",
  29842. // "format": "int64",
  29843. // "location": "query",
  29844. // "repeated": true,
  29845. // "type": "string"
  29846. // },
  29847. // "inPlan": {
  29848. // "description": "Select only inventory items that are in plan.",
  29849. // "location": "query",
  29850. // "type": "boolean"
  29851. // },
  29852. // "maxResults": {
  29853. // "default": "1000",
  29854. // "description": "Maximum number of results to return.",
  29855. // "format": "int32",
  29856. // "location": "query",
  29857. // "maximum": "1000",
  29858. // "minimum": "0",
  29859. // "type": "integer"
  29860. // },
  29861. // "orderId": {
  29862. // "description": "Select only inventory items that belong to specified orders.",
  29863. // "format": "int64",
  29864. // "location": "query",
  29865. // "repeated": true,
  29866. // "type": "string"
  29867. // },
  29868. // "pageToken": {
  29869. // "description": "Value of the nextPageToken from the previous result page.",
  29870. // "location": "query",
  29871. // "type": "string"
  29872. // },
  29873. // "profileId": {
  29874. // "description": "User profile ID associated with this request.",
  29875. // "format": "int64",
  29876. // "location": "path",
  29877. // "required": true,
  29878. // "type": "string"
  29879. // },
  29880. // "projectId": {
  29881. // "description": "Project ID for order documents.",
  29882. // "format": "int64",
  29883. // "location": "path",
  29884. // "required": true,
  29885. // "type": "string"
  29886. // },
  29887. // "siteId": {
  29888. // "description": "Select only inventory items that are associated with these sites.",
  29889. // "format": "int64",
  29890. // "location": "query",
  29891. // "repeated": true,
  29892. // "type": "string"
  29893. // },
  29894. // "sortField": {
  29895. // "default": "ID",
  29896. // "description": "Field by which to sort the list.",
  29897. // "enum": [
  29898. // "ID",
  29899. // "NAME"
  29900. // ],
  29901. // "enumDescriptions": [
  29902. // "",
  29903. // ""
  29904. // ],
  29905. // "location": "query",
  29906. // "type": "string"
  29907. // },
  29908. // "sortOrder": {
  29909. // "default": "ASCENDING",
  29910. // "description": "Order of sorted results.",
  29911. // "enum": [
  29912. // "ASCENDING",
  29913. // "DESCENDING"
  29914. // ],
  29915. // "enumDescriptions": [
  29916. // "",
  29917. // ""
  29918. // ],
  29919. // "location": "query",
  29920. // "type": "string"
  29921. // },
  29922. // "type": {
  29923. // "description": "Select only inventory items with this type.",
  29924. // "enum": [
  29925. // "PLANNING_PLACEMENT_TYPE_CREDIT",
  29926. // "PLANNING_PLACEMENT_TYPE_REGULAR"
  29927. // ],
  29928. // "enumDescriptions": [
  29929. // "",
  29930. // ""
  29931. // ],
  29932. // "location": "query",
  29933. // "type": "string"
  29934. // }
  29935. // },
  29936. // "path": "userprofiles/{profileId}/projects/{projectId}/inventoryItems",
  29937. // "response": {
  29938. // "$ref": "InventoryItemsListResponse"
  29939. // },
  29940. // "scopes": [
  29941. // "https://www.googleapis.com/auth/dfatrafficking"
  29942. // ]
  29943. // }
  29944. }
  29945. // Pages invokes f for each page of results.
  29946. // A non-nil error returned from f will halt the iteration.
  29947. // The provided context supersedes any context provided to the Context method.
  29948. func (c *InventoryItemsListCall) Pages(ctx context.Context, f func(*InventoryItemsListResponse) error) error {
  29949. c.ctx_ = ctx
  29950. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  29951. for {
  29952. x, err := c.Do()
  29953. if err != nil {
  29954. return err
  29955. }
  29956. if err := f(x); err != nil {
  29957. return err
  29958. }
  29959. if x.NextPageToken == "" {
  29960. return nil
  29961. }
  29962. c.PageToken(x.NextPageToken)
  29963. }
  29964. }
  29965. // method id "dfareporting.landingPages.delete":
  29966. type LandingPagesDeleteCall struct {
  29967. s *Service
  29968. profileId int64
  29969. campaignId int64
  29970. id int64
  29971. urlParams_ gensupport.URLParams
  29972. ctx_ context.Context
  29973. header_ http.Header
  29974. }
  29975. // Delete: Deletes an existing campaign landing page.
  29976. func (r *LandingPagesService) Delete(profileId int64, campaignId int64, id int64) *LandingPagesDeleteCall {
  29977. c := &LandingPagesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  29978. c.profileId = profileId
  29979. c.campaignId = campaignId
  29980. c.id = id
  29981. return c
  29982. }
  29983. // Fields allows partial responses to be retrieved. See
  29984. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  29985. // for more information.
  29986. func (c *LandingPagesDeleteCall) Fields(s ...googleapi.Field) *LandingPagesDeleteCall {
  29987. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  29988. return c
  29989. }
  29990. // Context sets the context to be used in this call's Do method. Any
  29991. // pending HTTP request will be aborted if the provided context is
  29992. // canceled.
  29993. func (c *LandingPagesDeleteCall) Context(ctx context.Context) *LandingPagesDeleteCall {
  29994. c.ctx_ = ctx
  29995. return c
  29996. }
  29997. // Header returns an http.Header that can be modified by the caller to
  29998. // add HTTP headers to the request.
  29999. func (c *LandingPagesDeleteCall) Header() http.Header {
  30000. if c.header_ == nil {
  30001. c.header_ = make(http.Header)
  30002. }
  30003. return c.header_
  30004. }
  30005. func (c *LandingPagesDeleteCall) doRequest(alt string) (*http.Response, error) {
  30006. reqHeaders := make(http.Header)
  30007. for k, v := range c.header_ {
  30008. reqHeaders[k] = v
  30009. }
  30010. reqHeaders.Set("User-Agent", c.s.userAgent())
  30011. var body io.Reader = nil
  30012. c.urlParams_.Set("alt", alt)
  30013. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}")
  30014. urls += "?" + c.urlParams_.Encode()
  30015. req, _ := http.NewRequest("DELETE", urls, body)
  30016. req.Header = reqHeaders
  30017. googleapi.Expand(req.URL, map[string]string{
  30018. "profileId": strconv.FormatInt(c.profileId, 10),
  30019. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30020. "id": strconv.FormatInt(c.id, 10),
  30021. })
  30022. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30023. }
  30024. // Do executes the "dfareporting.landingPages.delete" call.
  30025. func (c *LandingPagesDeleteCall) Do(opts ...googleapi.CallOption) error {
  30026. gensupport.SetOptions(c.urlParams_, opts...)
  30027. res, err := c.doRequest("json")
  30028. if err != nil {
  30029. return err
  30030. }
  30031. defer googleapi.CloseBody(res)
  30032. if err := googleapi.CheckResponse(res); err != nil {
  30033. return err
  30034. }
  30035. return nil
  30036. // {
  30037. // "description": "Deletes an existing campaign landing page.",
  30038. // "httpMethod": "DELETE",
  30039. // "id": "dfareporting.landingPages.delete",
  30040. // "parameterOrder": [
  30041. // "profileId",
  30042. // "campaignId",
  30043. // "id"
  30044. // ],
  30045. // "parameters": {
  30046. // "campaignId": {
  30047. // "description": "Landing page campaign ID.",
  30048. // "format": "int64",
  30049. // "location": "path",
  30050. // "required": true,
  30051. // "type": "string"
  30052. // },
  30053. // "id": {
  30054. // "description": "Landing page ID.",
  30055. // "format": "int64",
  30056. // "location": "path",
  30057. // "required": true,
  30058. // "type": "string"
  30059. // },
  30060. // "profileId": {
  30061. // "description": "User profile ID associated with this request.",
  30062. // "format": "int64",
  30063. // "location": "path",
  30064. // "required": true,
  30065. // "type": "string"
  30066. // }
  30067. // },
  30068. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}",
  30069. // "scopes": [
  30070. // "https://www.googleapis.com/auth/dfatrafficking"
  30071. // ]
  30072. // }
  30073. }
  30074. // method id "dfareporting.landingPages.get":
  30075. type LandingPagesGetCall struct {
  30076. s *Service
  30077. profileId int64
  30078. campaignId int64
  30079. id int64
  30080. urlParams_ gensupport.URLParams
  30081. ifNoneMatch_ string
  30082. ctx_ context.Context
  30083. header_ http.Header
  30084. }
  30085. // Get: Gets one campaign landing page by ID.
  30086. func (r *LandingPagesService) Get(profileId int64, campaignId int64, id int64) *LandingPagesGetCall {
  30087. c := &LandingPagesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30088. c.profileId = profileId
  30089. c.campaignId = campaignId
  30090. c.id = id
  30091. return c
  30092. }
  30093. // Fields allows partial responses to be retrieved. See
  30094. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30095. // for more information.
  30096. func (c *LandingPagesGetCall) Fields(s ...googleapi.Field) *LandingPagesGetCall {
  30097. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30098. return c
  30099. }
  30100. // IfNoneMatch sets the optional parameter which makes the operation
  30101. // fail if the object's ETag matches the given value. This is useful for
  30102. // getting updates only after the object has changed since the last
  30103. // request. Use googleapi.IsNotModified to check whether the response
  30104. // error from Do is the result of In-None-Match.
  30105. func (c *LandingPagesGetCall) IfNoneMatch(entityTag string) *LandingPagesGetCall {
  30106. c.ifNoneMatch_ = entityTag
  30107. return c
  30108. }
  30109. // Context sets the context to be used in this call's Do method. Any
  30110. // pending HTTP request will be aborted if the provided context is
  30111. // canceled.
  30112. func (c *LandingPagesGetCall) Context(ctx context.Context) *LandingPagesGetCall {
  30113. c.ctx_ = ctx
  30114. return c
  30115. }
  30116. // Header returns an http.Header that can be modified by the caller to
  30117. // add HTTP headers to the request.
  30118. func (c *LandingPagesGetCall) Header() http.Header {
  30119. if c.header_ == nil {
  30120. c.header_ = make(http.Header)
  30121. }
  30122. return c.header_
  30123. }
  30124. func (c *LandingPagesGetCall) doRequest(alt string) (*http.Response, error) {
  30125. reqHeaders := make(http.Header)
  30126. for k, v := range c.header_ {
  30127. reqHeaders[k] = v
  30128. }
  30129. reqHeaders.Set("User-Agent", c.s.userAgent())
  30130. if c.ifNoneMatch_ != "" {
  30131. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30132. }
  30133. var body io.Reader = nil
  30134. c.urlParams_.Set("alt", alt)
  30135. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}")
  30136. urls += "?" + c.urlParams_.Encode()
  30137. req, _ := http.NewRequest("GET", urls, body)
  30138. req.Header = reqHeaders
  30139. googleapi.Expand(req.URL, map[string]string{
  30140. "profileId": strconv.FormatInt(c.profileId, 10),
  30141. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30142. "id": strconv.FormatInt(c.id, 10),
  30143. })
  30144. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30145. }
  30146. // Do executes the "dfareporting.landingPages.get" call.
  30147. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  30148. // status code is an error. Response headers are in either
  30149. // *LandingPage.ServerResponse.Header or (if a response was returned at
  30150. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30151. // to check whether the returned error was because
  30152. // http.StatusNotModified was returned.
  30153. func (c *LandingPagesGetCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  30154. gensupport.SetOptions(c.urlParams_, opts...)
  30155. res, err := c.doRequest("json")
  30156. if res != nil && res.StatusCode == http.StatusNotModified {
  30157. if res.Body != nil {
  30158. res.Body.Close()
  30159. }
  30160. return nil, &googleapi.Error{
  30161. Code: res.StatusCode,
  30162. Header: res.Header,
  30163. }
  30164. }
  30165. if err != nil {
  30166. return nil, err
  30167. }
  30168. defer googleapi.CloseBody(res)
  30169. if err := googleapi.CheckResponse(res); err != nil {
  30170. return nil, err
  30171. }
  30172. ret := &LandingPage{
  30173. ServerResponse: googleapi.ServerResponse{
  30174. Header: res.Header,
  30175. HTTPStatusCode: res.StatusCode,
  30176. },
  30177. }
  30178. target := &ret
  30179. if err := gensupport.DecodeResponse(target, res); err != nil {
  30180. return nil, err
  30181. }
  30182. return ret, nil
  30183. // {
  30184. // "description": "Gets one campaign landing page by ID.",
  30185. // "httpMethod": "GET",
  30186. // "id": "dfareporting.landingPages.get",
  30187. // "parameterOrder": [
  30188. // "profileId",
  30189. // "campaignId",
  30190. // "id"
  30191. // ],
  30192. // "parameters": {
  30193. // "campaignId": {
  30194. // "description": "Landing page campaign ID.",
  30195. // "format": "int64",
  30196. // "location": "path",
  30197. // "required": true,
  30198. // "type": "string"
  30199. // },
  30200. // "id": {
  30201. // "description": "Landing page ID.",
  30202. // "format": "int64",
  30203. // "location": "path",
  30204. // "required": true,
  30205. // "type": "string"
  30206. // },
  30207. // "profileId": {
  30208. // "description": "User profile ID associated with this request.",
  30209. // "format": "int64",
  30210. // "location": "path",
  30211. // "required": true,
  30212. // "type": "string"
  30213. // }
  30214. // },
  30215. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages/{id}",
  30216. // "response": {
  30217. // "$ref": "LandingPage"
  30218. // },
  30219. // "scopes": [
  30220. // "https://www.googleapis.com/auth/dfatrafficking"
  30221. // ]
  30222. // }
  30223. }
  30224. // method id "dfareporting.landingPages.insert":
  30225. type LandingPagesInsertCall struct {
  30226. s *Service
  30227. profileId int64
  30228. campaignId int64
  30229. landingpage *LandingPage
  30230. urlParams_ gensupport.URLParams
  30231. ctx_ context.Context
  30232. header_ http.Header
  30233. }
  30234. // Insert: Inserts a new landing page for the specified campaign.
  30235. func (r *LandingPagesService) Insert(profileId int64, campaignId int64, landingpage *LandingPage) *LandingPagesInsertCall {
  30236. c := &LandingPagesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30237. c.profileId = profileId
  30238. c.campaignId = campaignId
  30239. c.landingpage = landingpage
  30240. return c
  30241. }
  30242. // Fields allows partial responses to be retrieved. See
  30243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30244. // for more information.
  30245. func (c *LandingPagesInsertCall) Fields(s ...googleapi.Field) *LandingPagesInsertCall {
  30246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30247. return c
  30248. }
  30249. // Context sets the context to be used in this call's Do method. Any
  30250. // pending HTTP request will be aborted if the provided context is
  30251. // canceled.
  30252. func (c *LandingPagesInsertCall) Context(ctx context.Context) *LandingPagesInsertCall {
  30253. c.ctx_ = ctx
  30254. return c
  30255. }
  30256. // Header returns an http.Header that can be modified by the caller to
  30257. // add HTTP headers to the request.
  30258. func (c *LandingPagesInsertCall) Header() http.Header {
  30259. if c.header_ == nil {
  30260. c.header_ = make(http.Header)
  30261. }
  30262. return c.header_
  30263. }
  30264. func (c *LandingPagesInsertCall) doRequest(alt string) (*http.Response, error) {
  30265. reqHeaders := make(http.Header)
  30266. for k, v := range c.header_ {
  30267. reqHeaders[k] = v
  30268. }
  30269. reqHeaders.Set("User-Agent", c.s.userAgent())
  30270. var body io.Reader = nil
  30271. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  30272. if err != nil {
  30273. return nil, err
  30274. }
  30275. reqHeaders.Set("Content-Type", "application/json")
  30276. c.urlParams_.Set("alt", alt)
  30277. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages")
  30278. urls += "?" + c.urlParams_.Encode()
  30279. req, _ := http.NewRequest("POST", urls, body)
  30280. req.Header = reqHeaders
  30281. googleapi.Expand(req.URL, map[string]string{
  30282. "profileId": strconv.FormatInt(c.profileId, 10),
  30283. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30284. })
  30285. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30286. }
  30287. // Do executes the "dfareporting.landingPages.insert" call.
  30288. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  30289. // status code is an error. Response headers are in either
  30290. // *LandingPage.ServerResponse.Header or (if a response was returned at
  30291. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30292. // to check whether the returned error was because
  30293. // http.StatusNotModified was returned.
  30294. func (c *LandingPagesInsertCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  30295. gensupport.SetOptions(c.urlParams_, opts...)
  30296. res, err := c.doRequest("json")
  30297. if res != nil && res.StatusCode == http.StatusNotModified {
  30298. if res.Body != nil {
  30299. res.Body.Close()
  30300. }
  30301. return nil, &googleapi.Error{
  30302. Code: res.StatusCode,
  30303. Header: res.Header,
  30304. }
  30305. }
  30306. if err != nil {
  30307. return nil, err
  30308. }
  30309. defer googleapi.CloseBody(res)
  30310. if err := googleapi.CheckResponse(res); err != nil {
  30311. return nil, err
  30312. }
  30313. ret := &LandingPage{
  30314. ServerResponse: googleapi.ServerResponse{
  30315. Header: res.Header,
  30316. HTTPStatusCode: res.StatusCode,
  30317. },
  30318. }
  30319. target := &ret
  30320. if err := gensupport.DecodeResponse(target, res); err != nil {
  30321. return nil, err
  30322. }
  30323. return ret, nil
  30324. // {
  30325. // "description": "Inserts a new landing page for the specified campaign.",
  30326. // "httpMethod": "POST",
  30327. // "id": "dfareporting.landingPages.insert",
  30328. // "parameterOrder": [
  30329. // "profileId",
  30330. // "campaignId"
  30331. // ],
  30332. // "parameters": {
  30333. // "campaignId": {
  30334. // "description": "Landing page campaign ID.",
  30335. // "format": "int64",
  30336. // "location": "path",
  30337. // "required": true,
  30338. // "type": "string"
  30339. // },
  30340. // "profileId": {
  30341. // "description": "User profile ID associated with this request.",
  30342. // "format": "int64",
  30343. // "location": "path",
  30344. // "required": true,
  30345. // "type": "string"
  30346. // }
  30347. // },
  30348. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages",
  30349. // "request": {
  30350. // "$ref": "LandingPage"
  30351. // },
  30352. // "response": {
  30353. // "$ref": "LandingPage"
  30354. // },
  30355. // "scopes": [
  30356. // "https://www.googleapis.com/auth/dfatrafficking"
  30357. // ]
  30358. // }
  30359. }
  30360. // method id "dfareporting.landingPages.list":
  30361. type LandingPagesListCall struct {
  30362. s *Service
  30363. profileId int64
  30364. campaignId int64
  30365. urlParams_ gensupport.URLParams
  30366. ifNoneMatch_ string
  30367. ctx_ context.Context
  30368. header_ http.Header
  30369. }
  30370. // List: Retrieves the list of landing pages for the specified campaign.
  30371. func (r *LandingPagesService) List(profileId int64, campaignId int64) *LandingPagesListCall {
  30372. c := &LandingPagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30373. c.profileId = profileId
  30374. c.campaignId = campaignId
  30375. return c
  30376. }
  30377. // Fields allows partial responses to be retrieved. See
  30378. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30379. // for more information.
  30380. func (c *LandingPagesListCall) Fields(s ...googleapi.Field) *LandingPagesListCall {
  30381. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30382. return c
  30383. }
  30384. // IfNoneMatch sets the optional parameter which makes the operation
  30385. // fail if the object's ETag matches the given value. This is useful for
  30386. // getting updates only after the object has changed since the last
  30387. // request. Use googleapi.IsNotModified to check whether the response
  30388. // error from Do is the result of In-None-Match.
  30389. func (c *LandingPagesListCall) IfNoneMatch(entityTag string) *LandingPagesListCall {
  30390. c.ifNoneMatch_ = entityTag
  30391. return c
  30392. }
  30393. // Context sets the context to be used in this call's Do method. Any
  30394. // pending HTTP request will be aborted if the provided context is
  30395. // canceled.
  30396. func (c *LandingPagesListCall) Context(ctx context.Context) *LandingPagesListCall {
  30397. c.ctx_ = ctx
  30398. return c
  30399. }
  30400. // Header returns an http.Header that can be modified by the caller to
  30401. // add HTTP headers to the request.
  30402. func (c *LandingPagesListCall) Header() http.Header {
  30403. if c.header_ == nil {
  30404. c.header_ = make(http.Header)
  30405. }
  30406. return c.header_
  30407. }
  30408. func (c *LandingPagesListCall) doRequest(alt string) (*http.Response, error) {
  30409. reqHeaders := make(http.Header)
  30410. for k, v := range c.header_ {
  30411. reqHeaders[k] = v
  30412. }
  30413. reqHeaders.Set("User-Agent", c.s.userAgent())
  30414. if c.ifNoneMatch_ != "" {
  30415. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30416. }
  30417. var body io.Reader = nil
  30418. c.urlParams_.Set("alt", alt)
  30419. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages")
  30420. urls += "?" + c.urlParams_.Encode()
  30421. req, _ := http.NewRequest("GET", urls, body)
  30422. req.Header = reqHeaders
  30423. googleapi.Expand(req.URL, map[string]string{
  30424. "profileId": strconv.FormatInt(c.profileId, 10),
  30425. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30426. })
  30427. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30428. }
  30429. // Do executes the "dfareporting.landingPages.list" call.
  30430. // Exactly one of *LandingPagesListResponse or error will be non-nil.
  30431. // Any non-2xx status code is an error. Response headers are in either
  30432. // *LandingPagesListResponse.ServerResponse.Header or (if a response was
  30433. // returned at all) in error.(*googleapi.Error).Header. Use
  30434. // googleapi.IsNotModified to check whether the returned error was
  30435. // because http.StatusNotModified was returned.
  30436. func (c *LandingPagesListCall) Do(opts ...googleapi.CallOption) (*LandingPagesListResponse, error) {
  30437. gensupport.SetOptions(c.urlParams_, opts...)
  30438. res, err := c.doRequest("json")
  30439. if res != nil && res.StatusCode == http.StatusNotModified {
  30440. if res.Body != nil {
  30441. res.Body.Close()
  30442. }
  30443. return nil, &googleapi.Error{
  30444. Code: res.StatusCode,
  30445. Header: res.Header,
  30446. }
  30447. }
  30448. if err != nil {
  30449. return nil, err
  30450. }
  30451. defer googleapi.CloseBody(res)
  30452. if err := googleapi.CheckResponse(res); err != nil {
  30453. return nil, err
  30454. }
  30455. ret := &LandingPagesListResponse{
  30456. ServerResponse: googleapi.ServerResponse{
  30457. Header: res.Header,
  30458. HTTPStatusCode: res.StatusCode,
  30459. },
  30460. }
  30461. target := &ret
  30462. if err := gensupport.DecodeResponse(target, res); err != nil {
  30463. return nil, err
  30464. }
  30465. return ret, nil
  30466. // {
  30467. // "description": "Retrieves the list of landing pages for the specified campaign.",
  30468. // "httpMethod": "GET",
  30469. // "id": "dfareporting.landingPages.list",
  30470. // "parameterOrder": [
  30471. // "profileId",
  30472. // "campaignId"
  30473. // ],
  30474. // "parameters": {
  30475. // "campaignId": {
  30476. // "description": "Landing page campaign ID.",
  30477. // "format": "int64",
  30478. // "location": "path",
  30479. // "required": true,
  30480. // "type": "string"
  30481. // },
  30482. // "profileId": {
  30483. // "description": "User profile ID associated with this request.",
  30484. // "format": "int64",
  30485. // "location": "path",
  30486. // "required": true,
  30487. // "type": "string"
  30488. // }
  30489. // },
  30490. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages",
  30491. // "response": {
  30492. // "$ref": "LandingPagesListResponse"
  30493. // },
  30494. // "scopes": [
  30495. // "https://www.googleapis.com/auth/dfatrafficking"
  30496. // ]
  30497. // }
  30498. }
  30499. // method id "dfareporting.landingPages.patch":
  30500. type LandingPagesPatchCall struct {
  30501. s *Service
  30502. profileId int64
  30503. campaignId int64
  30504. landingpage *LandingPage
  30505. urlParams_ gensupport.URLParams
  30506. ctx_ context.Context
  30507. header_ http.Header
  30508. }
  30509. // Patch: Updates an existing campaign landing page. This method
  30510. // supports patch semantics.
  30511. func (r *LandingPagesService) Patch(profileId int64, campaignId int64, id int64, landingpage *LandingPage) *LandingPagesPatchCall {
  30512. c := &LandingPagesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30513. c.profileId = profileId
  30514. c.campaignId = campaignId
  30515. c.urlParams_.Set("id", fmt.Sprint(id))
  30516. c.landingpage = landingpage
  30517. return c
  30518. }
  30519. // Fields allows partial responses to be retrieved. See
  30520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30521. // for more information.
  30522. func (c *LandingPagesPatchCall) Fields(s ...googleapi.Field) *LandingPagesPatchCall {
  30523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30524. return c
  30525. }
  30526. // Context sets the context to be used in this call's Do method. Any
  30527. // pending HTTP request will be aborted if the provided context is
  30528. // canceled.
  30529. func (c *LandingPagesPatchCall) Context(ctx context.Context) *LandingPagesPatchCall {
  30530. c.ctx_ = ctx
  30531. return c
  30532. }
  30533. // Header returns an http.Header that can be modified by the caller to
  30534. // add HTTP headers to the request.
  30535. func (c *LandingPagesPatchCall) Header() http.Header {
  30536. if c.header_ == nil {
  30537. c.header_ = make(http.Header)
  30538. }
  30539. return c.header_
  30540. }
  30541. func (c *LandingPagesPatchCall) doRequest(alt string) (*http.Response, error) {
  30542. reqHeaders := make(http.Header)
  30543. for k, v := range c.header_ {
  30544. reqHeaders[k] = v
  30545. }
  30546. reqHeaders.Set("User-Agent", c.s.userAgent())
  30547. var body io.Reader = nil
  30548. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  30549. if err != nil {
  30550. return nil, err
  30551. }
  30552. reqHeaders.Set("Content-Type", "application/json")
  30553. c.urlParams_.Set("alt", alt)
  30554. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages")
  30555. urls += "?" + c.urlParams_.Encode()
  30556. req, _ := http.NewRequest("PATCH", urls, body)
  30557. req.Header = reqHeaders
  30558. googleapi.Expand(req.URL, map[string]string{
  30559. "profileId": strconv.FormatInt(c.profileId, 10),
  30560. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30561. })
  30562. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30563. }
  30564. // Do executes the "dfareporting.landingPages.patch" call.
  30565. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  30566. // status code is an error. Response headers are in either
  30567. // *LandingPage.ServerResponse.Header or (if a response was returned at
  30568. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30569. // to check whether the returned error was because
  30570. // http.StatusNotModified was returned.
  30571. func (c *LandingPagesPatchCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  30572. gensupport.SetOptions(c.urlParams_, opts...)
  30573. res, err := c.doRequest("json")
  30574. if res != nil && res.StatusCode == http.StatusNotModified {
  30575. if res.Body != nil {
  30576. res.Body.Close()
  30577. }
  30578. return nil, &googleapi.Error{
  30579. Code: res.StatusCode,
  30580. Header: res.Header,
  30581. }
  30582. }
  30583. if err != nil {
  30584. return nil, err
  30585. }
  30586. defer googleapi.CloseBody(res)
  30587. if err := googleapi.CheckResponse(res); err != nil {
  30588. return nil, err
  30589. }
  30590. ret := &LandingPage{
  30591. ServerResponse: googleapi.ServerResponse{
  30592. Header: res.Header,
  30593. HTTPStatusCode: res.StatusCode,
  30594. },
  30595. }
  30596. target := &ret
  30597. if err := gensupport.DecodeResponse(target, res); err != nil {
  30598. return nil, err
  30599. }
  30600. return ret, nil
  30601. // {
  30602. // "description": "Updates an existing campaign landing page. This method supports patch semantics.",
  30603. // "httpMethod": "PATCH",
  30604. // "id": "dfareporting.landingPages.patch",
  30605. // "parameterOrder": [
  30606. // "profileId",
  30607. // "campaignId",
  30608. // "id"
  30609. // ],
  30610. // "parameters": {
  30611. // "campaignId": {
  30612. // "description": "Landing page campaign ID.",
  30613. // "format": "int64",
  30614. // "location": "path",
  30615. // "required": true,
  30616. // "type": "string"
  30617. // },
  30618. // "id": {
  30619. // "description": "Landing page ID.",
  30620. // "format": "int64",
  30621. // "location": "query",
  30622. // "required": true,
  30623. // "type": "string"
  30624. // },
  30625. // "profileId": {
  30626. // "description": "User profile ID associated with this request.",
  30627. // "format": "int64",
  30628. // "location": "path",
  30629. // "required": true,
  30630. // "type": "string"
  30631. // }
  30632. // },
  30633. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages",
  30634. // "request": {
  30635. // "$ref": "LandingPage"
  30636. // },
  30637. // "response": {
  30638. // "$ref": "LandingPage"
  30639. // },
  30640. // "scopes": [
  30641. // "https://www.googleapis.com/auth/dfatrafficking"
  30642. // ]
  30643. // }
  30644. }
  30645. // method id "dfareporting.landingPages.update":
  30646. type LandingPagesUpdateCall struct {
  30647. s *Service
  30648. profileId int64
  30649. campaignId int64
  30650. landingpage *LandingPage
  30651. urlParams_ gensupport.URLParams
  30652. ctx_ context.Context
  30653. header_ http.Header
  30654. }
  30655. // Update: Updates an existing campaign landing page.
  30656. func (r *LandingPagesService) Update(profileId int64, campaignId int64, landingpage *LandingPage) *LandingPagesUpdateCall {
  30657. c := &LandingPagesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30658. c.profileId = profileId
  30659. c.campaignId = campaignId
  30660. c.landingpage = landingpage
  30661. return c
  30662. }
  30663. // Fields allows partial responses to be retrieved. See
  30664. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30665. // for more information.
  30666. func (c *LandingPagesUpdateCall) Fields(s ...googleapi.Field) *LandingPagesUpdateCall {
  30667. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30668. return c
  30669. }
  30670. // Context sets the context to be used in this call's Do method. Any
  30671. // pending HTTP request will be aborted if the provided context is
  30672. // canceled.
  30673. func (c *LandingPagesUpdateCall) Context(ctx context.Context) *LandingPagesUpdateCall {
  30674. c.ctx_ = ctx
  30675. return c
  30676. }
  30677. // Header returns an http.Header that can be modified by the caller to
  30678. // add HTTP headers to the request.
  30679. func (c *LandingPagesUpdateCall) Header() http.Header {
  30680. if c.header_ == nil {
  30681. c.header_ = make(http.Header)
  30682. }
  30683. return c.header_
  30684. }
  30685. func (c *LandingPagesUpdateCall) doRequest(alt string) (*http.Response, error) {
  30686. reqHeaders := make(http.Header)
  30687. for k, v := range c.header_ {
  30688. reqHeaders[k] = v
  30689. }
  30690. reqHeaders.Set("User-Agent", c.s.userAgent())
  30691. var body io.Reader = nil
  30692. body, err := googleapi.WithoutDataWrapper.JSONReader(c.landingpage)
  30693. if err != nil {
  30694. return nil, err
  30695. }
  30696. reqHeaders.Set("Content-Type", "application/json")
  30697. c.urlParams_.Set("alt", alt)
  30698. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/campaigns/{campaignId}/landingPages")
  30699. urls += "?" + c.urlParams_.Encode()
  30700. req, _ := http.NewRequest("PUT", urls, body)
  30701. req.Header = reqHeaders
  30702. googleapi.Expand(req.URL, map[string]string{
  30703. "profileId": strconv.FormatInt(c.profileId, 10),
  30704. "campaignId": strconv.FormatInt(c.campaignId, 10),
  30705. })
  30706. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30707. }
  30708. // Do executes the "dfareporting.landingPages.update" call.
  30709. // Exactly one of *LandingPage or error will be non-nil. Any non-2xx
  30710. // status code is an error. Response headers are in either
  30711. // *LandingPage.ServerResponse.Header or (if a response was returned at
  30712. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  30713. // to check whether the returned error was because
  30714. // http.StatusNotModified was returned.
  30715. func (c *LandingPagesUpdateCall) Do(opts ...googleapi.CallOption) (*LandingPage, error) {
  30716. gensupport.SetOptions(c.urlParams_, opts...)
  30717. res, err := c.doRequest("json")
  30718. if res != nil && res.StatusCode == http.StatusNotModified {
  30719. if res.Body != nil {
  30720. res.Body.Close()
  30721. }
  30722. return nil, &googleapi.Error{
  30723. Code: res.StatusCode,
  30724. Header: res.Header,
  30725. }
  30726. }
  30727. if err != nil {
  30728. return nil, err
  30729. }
  30730. defer googleapi.CloseBody(res)
  30731. if err := googleapi.CheckResponse(res); err != nil {
  30732. return nil, err
  30733. }
  30734. ret := &LandingPage{
  30735. ServerResponse: googleapi.ServerResponse{
  30736. Header: res.Header,
  30737. HTTPStatusCode: res.StatusCode,
  30738. },
  30739. }
  30740. target := &ret
  30741. if err := gensupport.DecodeResponse(target, res); err != nil {
  30742. return nil, err
  30743. }
  30744. return ret, nil
  30745. // {
  30746. // "description": "Updates an existing campaign landing page.",
  30747. // "httpMethod": "PUT",
  30748. // "id": "dfareporting.landingPages.update",
  30749. // "parameterOrder": [
  30750. // "profileId",
  30751. // "campaignId"
  30752. // ],
  30753. // "parameters": {
  30754. // "campaignId": {
  30755. // "description": "Landing page campaign ID.",
  30756. // "format": "int64",
  30757. // "location": "path",
  30758. // "required": true,
  30759. // "type": "string"
  30760. // },
  30761. // "profileId": {
  30762. // "description": "User profile ID associated with this request.",
  30763. // "format": "int64",
  30764. // "location": "path",
  30765. // "required": true,
  30766. // "type": "string"
  30767. // }
  30768. // },
  30769. // "path": "userprofiles/{profileId}/campaigns/{campaignId}/landingPages",
  30770. // "request": {
  30771. // "$ref": "LandingPage"
  30772. // },
  30773. // "response": {
  30774. // "$ref": "LandingPage"
  30775. // },
  30776. // "scopes": [
  30777. // "https://www.googleapis.com/auth/dfatrafficking"
  30778. // ]
  30779. // }
  30780. }
  30781. // method id "dfareporting.languages.list":
  30782. type LanguagesListCall struct {
  30783. s *Service
  30784. profileId int64
  30785. urlParams_ gensupport.URLParams
  30786. ifNoneMatch_ string
  30787. ctx_ context.Context
  30788. header_ http.Header
  30789. }
  30790. // List: Retrieves a list of languages.
  30791. func (r *LanguagesService) List(profileId int64) *LanguagesListCall {
  30792. c := &LanguagesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30793. c.profileId = profileId
  30794. return c
  30795. }
  30796. // Fields allows partial responses to be retrieved. See
  30797. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30798. // for more information.
  30799. func (c *LanguagesListCall) Fields(s ...googleapi.Field) *LanguagesListCall {
  30800. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30801. return c
  30802. }
  30803. // IfNoneMatch sets the optional parameter which makes the operation
  30804. // fail if the object's ETag matches the given value. This is useful for
  30805. // getting updates only after the object has changed since the last
  30806. // request. Use googleapi.IsNotModified to check whether the response
  30807. // error from Do is the result of In-None-Match.
  30808. func (c *LanguagesListCall) IfNoneMatch(entityTag string) *LanguagesListCall {
  30809. c.ifNoneMatch_ = entityTag
  30810. return c
  30811. }
  30812. // Context sets the context to be used in this call's Do method. Any
  30813. // pending HTTP request will be aborted if the provided context is
  30814. // canceled.
  30815. func (c *LanguagesListCall) Context(ctx context.Context) *LanguagesListCall {
  30816. c.ctx_ = ctx
  30817. return c
  30818. }
  30819. // Header returns an http.Header that can be modified by the caller to
  30820. // add HTTP headers to the request.
  30821. func (c *LanguagesListCall) Header() http.Header {
  30822. if c.header_ == nil {
  30823. c.header_ = make(http.Header)
  30824. }
  30825. return c.header_
  30826. }
  30827. func (c *LanguagesListCall) doRequest(alt string) (*http.Response, error) {
  30828. reqHeaders := make(http.Header)
  30829. for k, v := range c.header_ {
  30830. reqHeaders[k] = v
  30831. }
  30832. reqHeaders.Set("User-Agent", c.s.userAgent())
  30833. if c.ifNoneMatch_ != "" {
  30834. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30835. }
  30836. var body io.Reader = nil
  30837. c.urlParams_.Set("alt", alt)
  30838. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/languages")
  30839. urls += "?" + c.urlParams_.Encode()
  30840. req, _ := http.NewRequest("GET", urls, body)
  30841. req.Header = reqHeaders
  30842. googleapi.Expand(req.URL, map[string]string{
  30843. "profileId": strconv.FormatInt(c.profileId, 10),
  30844. })
  30845. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30846. }
  30847. // Do executes the "dfareporting.languages.list" call.
  30848. // Exactly one of *LanguagesListResponse or error will be non-nil. Any
  30849. // non-2xx status code is an error. Response headers are in either
  30850. // *LanguagesListResponse.ServerResponse.Header or (if a response was
  30851. // returned at all) in error.(*googleapi.Error).Header. Use
  30852. // googleapi.IsNotModified to check whether the returned error was
  30853. // because http.StatusNotModified was returned.
  30854. func (c *LanguagesListCall) Do(opts ...googleapi.CallOption) (*LanguagesListResponse, error) {
  30855. gensupport.SetOptions(c.urlParams_, opts...)
  30856. res, err := c.doRequest("json")
  30857. if res != nil && res.StatusCode == http.StatusNotModified {
  30858. if res.Body != nil {
  30859. res.Body.Close()
  30860. }
  30861. return nil, &googleapi.Error{
  30862. Code: res.StatusCode,
  30863. Header: res.Header,
  30864. }
  30865. }
  30866. if err != nil {
  30867. return nil, err
  30868. }
  30869. defer googleapi.CloseBody(res)
  30870. if err := googleapi.CheckResponse(res); err != nil {
  30871. return nil, err
  30872. }
  30873. ret := &LanguagesListResponse{
  30874. ServerResponse: googleapi.ServerResponse{
  30875. Header: res.Header,
  30876. HTTPStatusCode: res.StatusCode,
  30877. },
  30878. }
  30879. target := &ret
  30880. if err := gensupport.DecodeResponse(target, res); err != nil {
  30881. return nil, err
  30882. }
  30883. return ret, nil
  30884. // {
  30885. // "description": "Retrieves a list of languages.",
  30886. // "httpMethod": "GET",
  30887. // "id": "dfareporting.languages.list",
  30888. // "parameterOrder": [
  30889. // "profileId"
  30890. // ],
  30891. // "parameters": {
  30892. // "profileId": {
  30893. // "description": "User profile ID associated with this request.",
  30894. // "format": "int64",
  30895. // "location": "path",
  30896. // "required": true,
  30897. // "type": "string"
  30898. // }
  30899. // },
  30900. // "path": "userprofiles/{profileId}/languages",
  30901. // "response": {
  30902. // "$ref": "LanguagesListResponse"
  30903. // },
  30904. // "scopes": [
  30905. // "https://www.googleapis.com/auth/dfatrafficking"
  30906. // ]
  30907. // }
  30908. }
  30909. // method id "dfareporting.metros.list":
  30910. type MetrosListCall struct {
  30911. s *Service
  30912. profileId int64
  30913. urlParams_ gensupport.URLParams
  30914. ifNoneMatch_ string
  30915. ctx_ context.Context
  30916. header_ http.Header
  30917. }
  30918. // List: Retrieves a list of metros.
  30919. func (r *MetrosService) List(profileId int64) *MetrosListCall {
  30920. c := &MetrosListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  30921. c.profileId = profileId
  30922. return c
  30923. }
  30924. // Fields allows partial responses to be retrieved. See
  30925. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  30926. // for more information.
  30927. func (c *MetrosListCall) Fields(s ...googleapi.Field) *MetrosListCall {
  30928. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  30929. return c
  30930. }
  30931. // IfNoneMatch sets the optional parameter which makes the operation
  30932. // fail if the object's ETag matches the given value. This is useful for
  30933. // getting updates only after the object has changed since the last
  30934. // request. Use googleapi.IsNotModified to check whether the response
  30935. // error from Do is the result of In-None-Match.
  30936. func (c *MetrosListCall) IfNoneMatch(entityTag string) *MetrosListCall {
  30937. c.ifNoneMatch_ = entityTag
  30938. return c
  30939. }
  30940. // Context sets the context to be used in this call's Do method. Any
  30941. // pending HTTP request will be aborted if the provided context is
  30942. // canceled.
  30943. func (c *MetrosListCall) Context(ctx context.Context) *MetrosListCall {
  30944. c.ctx_ = ctx
  30945. return c
  30946. }
  30947. // Header returns an http.Header that can be modified by the caller to
  30948. // add HTTP headers to the request.
  30949. func (c *MetrosListCall) Header() http.Header {
  30950. if c.header_ == nil {
  30951. c.header_ = make(http.Header)
  30952. }
  30953. return c.header_
  30954. }
  30955. func (c *MetrosListCall) doRequest(alt string) (*http.Response, error) {
  30956. reqHeaders := make(http.Header)
  30957. for k, v := range c.header_ {
  30958. reqHeaders[k] = v
  30959. }
  30960. reqHeaders.Set("User-Agent", c.s.userAgent())
  30961. if c.ifNoneMatch_ != "" {
  30962. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  30963. }
  30964. var body io.Reader = nil
  30965. c.urlParams_.Set("alt", alt)
  30966. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/metros")
  30967. urls += "?" + c.urlParams_.Encode()
  30968. req, _ := http.NewRequest("GET", urls, body)
  30969. req.Header = reqHeaders
  30970. googleapi.Expand(req.URL, map[string]string{
  30971. "profileId": strconv.FormatInt(c.profileId, 10),
  30972. })
  30973. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  30974. }
  30975. // Do executes the "dfareporting.metros.list" call.
  30976. // Exactly one of *MetrosListResponse or error will be non-nil. Any
  30977. // non-2xx status code is an error. Response headers are in either
  30978. // *MetrosListResponse.ServerResponse.Header or (if a response was
  30979. // returned at all) in error.(*googleapi.Error).Header. Use
  30980. // googleapi.IsNotModified to check whether the returned error was
  30981. // because http.StatusNotModified was returned.
  30982. func (c *MetrosListCall) Do(opts ...googleapi.CallOption) (*MetrosListResponse, error) {
  30983. gensupport.SetOptions(c.urlParams_, opts...)
  30984. res, err := c.doRequest("json")
  30985. if res != nil && res.StatusCode == http.StatusNotModified {
  30986. if res.Body != nil {
  30987. res.Body.Close()
  30988. }
  30989. return nil, &googleapi.Error{
  30990. Code: res.StatusCode,
  30991. Header: res.Header,
  30992. }
  30993. }
  30994. if err != nil {
  30995. return nil, err
  30996. }
  30997. defer googleapi.CloseBody(res)
  30998. if err := googleapi.CheckResponse(res); err != nil {
  30999. return nil, err
  31000. }
  31001. ret := &MetrosListResponse{
  31002. ServerResponse: googleapi.ServerResponse{
  31003. Header: res.Header,
  31004. HTTPStatusCode: res.StatusCode,
  31005. },
  31006. }
  31007. target := &ret
  31008. if err := gensupport.DecodeResponse(target, res); err != nil {
  31009. return nil, err
  31010. }
  31011. return ret, nil
  31012. // {
  31013. // "description": "Retrieves a list of metros.",
  31014. // "httpMethod": "GET",
  31015. // "id": "dfareporting.metros.list",
  31016. // "parameterOrder": [
  31017. // "profileId"
  31018. // ],
  31019. // "parameters": {
  31020. // "profileId": {
  31021. // "description": "User profile ID associated with this request.",
  31022. // "format": "int64",
  31023. // "location": "path",
  31024. // "required": true,
  31025. // "type": "string"
  31026. // }
  31027. // },
  31028. // "path": "userprofiles/{profileId}/metros",
  31029. // "response": {
  31030. // "$ref": "MetrosListResponse"
  31031. // },
  31032. // "scopes": [
  31033. // "https://www.googleapis.com/auth/dfatrafficking"
  31034. // ]
  31035. // }
  31036. }
  31037. // method id "dfareporting.mobileCarriers.get":
  31038. type MobileCarriersGetCall struct {
  31039. s *Service
  31040. profileId int64
  31041. id int64
  31042. urlParams_ gensupport.URLParams
  31043. ifNoneMatch_ string
  31044. ctx_ context.Context
  31045. header_ http.Header
  31046. }
  31047. // Get: Gets one mobile carrier by ID.
  31048. func (r *MobileCarriersService) Get(profileId int64, id int64) *MobileCarriersGetCall {
  31049. c := &MobileCarriersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31050. c.profileId = profileId
  31051. c.id = id
  31052. return c
  31053. }
  31054. // Fields allows partial responses to be retrieved. See
  31055. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31056. // for more information.
  31057. func (c *MobileCarriersGetCall) Fields(s ...googleapi.Field) *MobileCarriersGetCall {
  31058. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31059. return c
  31060. }
  31061. // IfNoneMatch sets the optional parameter which makes the operation
  31062. // fail if the object's ETag matches the given value. This is useful for
  31063. // getting updates only after the object has changed since the last
  31064. // request. Use googleapi.IsNotModified to check whether the response
  31065. // error from Do is the result of In-None-Match.
  31066. func (c *MobileCarriersGetCall) IfNoneMatch(entityTag string) *MobileCarriersGetCall {
  31067. c.ifNoneMatch_ = entityTag
  31068. return c
  31069. }
  31070. // Context sets the context to be used in this call's Do method. Any
  31071. // pending HTTP request will be aborted if the provided context is
  31072. // canceled.
  31073. func (c *MobileCarriersGetCall) Context(ctx context.Context) *MobileCarriersGetCall {
  31074. c.ctx_ = ctx
  31075. return c
  31076. }
  31077. // Header returns an http.Header that can be modified by the caller to
  31078. // add HTTP headers to the request.
  31079. func (c *MobileCarriersGetCall) Header() http.Header {
  31080. if c.header_ == nil {
  31081. c.header_ = make(http.Header)
  31082. }
  31083. return c.header_
  31084. }
  31085. func (c *MobileCarriersGetCall) doRequest(alt string) (*http.Response, error) {
  31086. reqHeaders := make(http.Header)
  31087. for k, v := range c.header_ {
  31088. reqHeaders[k] = v
  31089. }
  31090. reqHeaders.Set("User-Agent", c.s.userAgent())
  31091. if c.ifNoneMatch_ != "" {
  31092. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31093. }
  31094. var body io.Reader = nil
  31095. c.urlParams_.Set("alt", alt)
  31096. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers/{id}")
  31097. urls += "?" + c.urlParams_.Encode()
  31098. req, _ := http.NewRequest("GET", urls, body)
  31099. req.Header = reqHeaders
  31100. googleapi.Expand(req.URL, map[string]string{
  31101. "profileId": strconv.FormatInt(c.profileId, 10),
  31102. "id": strconv.FormatInt(c.id, 10),
  31103. })
  31104. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31105. }
  31106. // Do executes the "dfareporting.mobileCarriers.get" call.
  31107. // Exactly one of *MobileCarrier or error will be non-nil. Any non-2xx
  31108. // status code is an error. Response headers are in either
  31109. // *MobileCarrier.ServerResponse.Header or (if a response was returned
  31110. // at all) in error.(*googleapi.Error).Header. Use
  31111. // googleapi.IsNotModified to check whether the returned error was
  31112. // because http.StatusNotModified was returned.
  31113. func (c *MobileCarriersGetCall) Do(opts ...googleapi.CallOption) (*MobileCarrier, error) {
  31114. gensupport.SetOptions(c.urlParams_, opts...)
  31115. res, err := c.doRequest("json")
  31116. if res != nil && res.StatusCode == http.StatusNotModified {
  31117. if res.Body != nil {
  31118. res.Body.Close()
  31119. }
  31120. return nil, &googleapi.Error{
  31121. Code: res.StatusCode,
  31122. Header: res.Header,
  31123. }
  31124. }
  31125. if err != nil {
  31126. return nil, err
  31127. }
  31128. defer googleapi.CloseBody(res)
  31129. if err := googleapi.CheckResponse(res); err != nil {
  31130. return nil, err
  31131. }
  31132. ret := &MobileCarrier{
  31133. ServerResponse: googleapi.ServerResponse{
  31134. Header: res.Header,
  31135. HTTPStatusCode: res.StatusCode,
  31136. },
  31137. }
  31138. target := &ret
  31139. if err := gensupport.DecodeResponse(target, res); err != nil {
  31140. return nil, err
  31141. }
  31142. return ret, nil
  31143. // {
  31144. // "description": "Gets one mobile carrier by ID.",
  31145. // "httpMethod": "GET",
  31146. // "id": "dfareporting.mobileCarriers.get",
  31147. // "parameterOrder": [
  31148. // "profileId",
  31149. // "id"
  31150. // ],
  31151. // "parameters": {
  31152. // "id": {
  31153. // "description": "Mobile carrier ID.",
  31154. // "format": "int64",
  31155. // "location": "path",
  31156. // "required": true,
  31157. // "type": "string"
  31158. // },
  31159. // "profileId": {
  31160. // "description": "User profile ID associated with this request.",
  31161. // "format": "int64",
  31162. // "location": "path",
  31163. // "required": true,
  31164. // "type": "string"
  31165. // }
  31166. // },
  31167. // "path": "userprofiles/{profileId}/mobileCarriers/{id}",
  31168. // "response": {
  31169. // "$ref": "MobileCarrier"
  31170. // },
  31171. // "scopes": [
  31172. // "https://www.googleapis.com/auth/dfatrafficking"
  31173. // ]
  31174. // }
  31175. }
  31176. // method id "dfareporting.mobileCarriers.list":
  31177. type MobileCarriersListCall struct {
  31178. s *Service
  31179. profileId int64
  31180. urlParams_ gensupport.URLParams
  31181. ifNoneMatch_ string
  31182. ctx_ context.Context
  31183. header_ http.Header
  31184. }
  31185. // List: Retrieves a list of mobile carriers.
  31186. func (r *MobileCarriersService) List(profileId int64) *MobileCarriersListCall {
  31187. c := &MobileCarriersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31188. c.profileId = profileId
  31189. return c
  31190. }
  31191. // Fields allows partial responses to be retrieved. See
  31192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31193. // for more information.
  31194. func (c *MobileCarriersListCall) Fields(s ...googleapi.Field) *MobileCarriersListCall {
  31195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31196. return c
  31197. }
  31198. // IfNoneMatch sets the optional parameter which makes the operation
  31199. // fail if the object's ETag matches the given value. This is useful for
  31200. // getting updates only after the object has changed since the last
  31201. // request. Use googleapi.IsNotModified to check whether the response
  31202. // error from Do is the result of In-None-Match.
  31203. func (c *MobileCarriersListCall) IfNoneMatch(entityTag string) *MobileCarriersListCall {
  31204. c.ifNoneMatch_ = entityTag
  31205. return c
  31206. }
  31207. // Context sets the context to be used in this call's Do method. Any
  31208. // pending HTTP request will be aborted if the provided context is
  31209. // canceled.
  31210. func (c *MobileCarriersListCall) Context(ctx context.Context) *MobileCarriersListCall {
  31211. c.ctx_ = ctx
  31212. return c
  31213. }
  31214. // Header returns an http.Header that can be modified by the caller to
  31215. // add HTTP headers to the request.
  31216. func (c *MobileCarriersListCall) Header() http.Header {
  31217. if c.header_ == nil {
  31218. c.header_ = make(http.Header)
  31219. }
  31220. return c.header_
  31221. }
  31222. func (c *MobileCarriersListCall) doRequest(alt string) (*http.Response, error) {
  31223. reqHeaders := make(http.Header)
  31224. for k, v := range c.header_ {
  31225. reqHeaders[k] = v
  31226. }
  31227. reqHeaders.Set("User-Agent", c.s.userAgent())
  31228. if c.ifNoneMatch_ != "" {
  31229. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31230. }
  31231. var body io.Reader = nil
  31232. c.urlParams_.Set("alt", alt)
  31233. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/mobileCarriers")
  31234. urls += "?" + c.urlParams_.Encode()
  31235. req, _ := http.NewRequest("GET", urls, body)
  31236. req.Header = reqHeaders
  31237. googleapi.Expand(req.URL, map[string]string{
  31238. "profileId": strconv.FormatInt(c.profileId, 10),
  31239. })
  31240. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31241. }
  31242. // Do executes the "dfareporting.mobileCarriers.list" call.
  31243. // Exactly one of *MobileCarriersListResponse or error will be non-nil.
  31244. // Any non-2xx status code is an error. Response headers are in either
  31245. // *MobileCarriersListResponse.ServerResponse.Header or (if a response
  31246. // was returned at all) in error.(*googleapi.Error).Header. Use
  31247. // googleapi.IsNotModified to check whether the returned error was
  31248. // because http.StatusNotModified was returned.
  31249. func (c *MobileCarriersListCall) Do(opts ...googleapi.CallOption) (*MobileCarriersListResponse, error) {
  31250. gensupport.SetOptions(c.urlParams_, opts...)
  31251. res, err := c.doRequest("json")
  31252. if res != nil && res.StatusCode == http.StatusNotModified {
  31253. if res.Body != nil {
  31254. res.Body.Close()
  31255. }
  31256. return nil, &googleapi.Error{
  31257. Code: res.StatusCode,
  31258. Header: res.Header,
  31259. }
  31260. }
  31261. if err != nil {
  31262. return nil, err
  31263. }
  31264. defer googleapi.CloseBody(res)
  31265. if err := googleapi.CheckResponse(res); err != nil {
  31266. return nil, err
  31267. }
  31268. ret := &MobileCarriersListResponse{
  31269. ServerResponse: googleapi.ServerResponse{
  31270. Header: res.Header,
  31271. HTTPStatusCode: res.StatusCode,
  31272. },
  31273. }
  31274. target := &ret
  31275. if err := gensupport.DecodeResponse(target, res); err != nil {
  31276. return nil, err
  31277. }
  31278. return ret, nil
  31279. // {
  31280. // "description": "Retrieves a list of mobile carriers.",
  31281. // "httpMethod": "GET",
  31282. // "id": "dfareporting.mobileCarriers.list",
  31283. // "parameterOrder": [
  31284. // "profileId"
  31285. // ],
  31286. // "parameters": {
  31287. // "profileId": {
  31288. // "description": "User profile ID associated with this request.",
  31289. // "format": "int64",
  31290. // "location": "path",
  31291. // "required": true,
  31292. // "type": "string"
  31293. // }
  31294. // },
  31295. // "path": "userprofiles/{profileId}/mobileCarriers",
  31296. // "response": {
  31297. // "$ref": "MobileCarriersListResponse"
  31298. // },
  31299. // "scopes": [
  31300. // "https://www.googleapis.com/auth/dfatrafficking"
  31301. // ]
  31302. // }
  31303. }
  31304. // method id "dfareporting.operatingSystemVersions.get":
  31305. type OperatingSystemVersionsGetCall struct {
  31306. s *Service
  31307. profileId int64
  31308. id int64
  31309. urlParams_ gensupport.URLParams
  31310. ifNoneMatch_ string
  31311. ctx_ context.Context
  31312. header_ http.Header
  31313. }
  31314. // Get: Gets one operating system version by ID.
  31315. func (r *OperatingSystemVersionsService) Get(profileId int64, id int64) *OperatingSystemVersionsGetCall {
  31316. c := &OperatingSystemVersionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31317. c.profileId = profileId
  31318. c.id = id
  31319. return c
  31320. }
  31321. // Fields allows partial responses to be retrieved. See
  31322. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31323. // for more information.
  31324. func (c *OperatingSystemVersionsGetCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsGetCall {
  31325. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31326. return c
  31327. }
  31328. // IfNoneMatch sets the optional parameter which makes the operation
  31329. // fail if the object's ETag matches the given value. This is useful for
  31330. // getting updates only after the object has changed since the last
  31331. // request. Use googleapi.IsNotModified to check whether the response
  31332. // error from Do is the result of In-None-Match.
  31333. func (c *OperatingSystemVersionsGetCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsGetCall {
  31334. c.ifNoneMatch_ = entityTag
  31335. return c
  31336. }
  31337. // Context sets the context to be used in this call's Do method. Any
  31338. // pending HTTP request will be aborted if the provided context is
  31339. // canceled.
  31340. func (c *OperatingSystemVersionsGetCall) Context(ctx context.Context) *OperatingSystemVersionsGetCall {
  31341. c.ctx_ = ctx
  31342. return c
  31343. }
  31344. // Header returns an http.Header that can be modified by the caller to
  31345. // add HTTP headers to the request.
  31346. func (c *OperatingSystemVersionsGetCall) Header() http.Header {
  31347. if c.header_ == nil {
  31348. c.header_ = make(http.Header)
  31349. }
  31350. return c.header_
  31351. }
  31352. func (c *OperatingSystemVersionsGetCall) doRequest(alt string) (*http.Response, error) {
  31353. reqHeaders := make(http.Header)
  31354. for k, v := range c.header_ {
  31355. reqHeaders[k] = v
  31356. }
  31357. reqHeaders.Set("User-Agent", c.s.userAgent())
  31358. if c.ifNoneMatch_ != "" {
  31359. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31360. }
  31361. var body io.Reader = nil
  31362. c.urlParams_.Set("alt", alt)
  31363. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions/{id}")
  31364. urls += "?" + c.urlParams_.Encode()
  31365. req, _ := http.NewRequest("GET", urls, body)
  31366. req.Header = reqHeaders
  31367. googleapi.Expand(req.URL, map[string]string{
  31368. "profileId": strconv.FormatInt(c.profileId, 10),
  31369. "id": strconv.FormatInt(c.id, 10),
  31370. })
  31371. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31372. }
  31373. // Do executes the "dfareporting.operatingSystemVersions.get" call.
  31374. // Exactly one of *OperatingSystemVersion or error will be non-nil. Any
  31375. // non-2xx status code is an error. Response headers are in either
  31376. // *OperatingSystemVersion.ServerResponse.Header or (if a response was
  31377. // returned at all) in error.(*googleapi.Error).Header. Use
  31378. // googleapi.IsNotModified to check whether the returned error was
  31379. // because http.StatusNotModified was returned.
  31380. func (c *OperatingSystemVersionsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersion, error) {
  31381. gensupport.SetOptions(c.urlParams_, opts...)
  31382. res, err := c.doRequest("json")
  31383. if res != nil && res.StatusCode == http.StatusNotModified {
  31384. if res.Body != nil {
  31385. res.Body.Close()
  31386. }
  31387. return nil, &googleapi.Error{
  31388. Code: res.StatusCode,
  31389. Header: res.Header,
  31390. }
  31391. }
  31392. if err != nil {
  31393. return nil, err
  31394. }
  31395. defer googleapi.CloseBody(res)
  31396. if err := googleapi.CheckResponse(res); err != nil {
  31397. return nil, err
  31398. }
  31399. ret := &OperatingSystemVersion{
  31400. ServerResponse: googleapi.ServerResponse{
  31401. Header: res.Header,
  31402. HTTPStatusCode: res.StatusCode,
  31403. },
  31404. }
  31405. target := &ret
  31406. if err := gensupport.DecodeResponse(target, res); err != nil {
  31407. return nil, err
  31408. }
  31409. return ret, nil
  31410. // {
  31411. // "description": "Gets one operating system version by ID.",
  31412. // "httpMethod": "GET",
  31413. // "id": "dfareporting.operatingSystemVersions.get",
  31414. // "parameterOrder": [
  31415. // "profileId",
  31416. // "id"
  31417. // ],
  31418. // "parameters": {
  31419. // "id": {
  31420. // "description": "Operating system version ID.",
  31421. // "format": "int64",
  31422. // "location": "path",
  31423. // "required": true,
  31424. // "type": "string"
  31425. // },
  31426. // "profileId": {
  31427. // "description": "User profile ID associated with this request.",
  31428. // "format": "int64",
  31429. // "location": "path",
  31430. // "required": true,
  31431. // "type": "string"
  31432. // }
  31433. // },
  31434. // "path": "userprofiles/{profileId}/operatingSystemVersions/{id}",
  31435. // "response": {
  31436. // "$ref": "OperatingSystemVersion"
  31437. // },
  31438. // "scopes": [
  31439. // "https://www.googleapis.com/auth/dfatrafficking"
  31440. // ]
  31441. // }
  31442. }
  31443. // method id "dfareporting.operatingSystemVersions.list":
  31444. type OperatingSystemVersionsListCall struct {
  31445. s *Service
  31446. profileId int64
  31447. urlParams_ gensupport.URLParams
  31448. ifNoneMatch_ string
  31449. ctx_ context.Context
  31450. header_ http.Header
  31451. }
  31452. // List: Retrieves a list of operating system versions.
  31453. func (r *OperatingSystemVersionsService) List(profileId int64) *OperatingSystemVersionsListCall {
  31454. c := &OperatingSystemVersionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31455. c.profileId = profileId
  31456. return c
  31457. }
  31458. // Fields allows partial responses to be retrieved. See
  31459. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31460. // for more information.
  31461. func (c *OperatingSystemVersionsListCall) Fields(s ...googleapi.Field) *OperatingSystemVersionsListCall {
  31462. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31463. return c
  31464. }
  31465. // IfNoneMatch sets the optional parameter which makes the operation
  31466. // fail if the object's ETag matches the given value. This is useful for
  31467. // getting updates only after the object has changed since the last
  31468. // request. Use googleapi.IsNotModified to check whether the response
  31469. // error from Do is the result of In-None-Match.
  31470. func (c *OperatingSystemVersionsListCall) IfNoneMatch(entityTag string) *OperatingSystemVersionsListCall {
  31471. c.ifNoneMatch_ = entityTag
  31472. return c
  31473. }
  31474. // Context sets the context to be used in this call's Do method. Any
  31475. // pending HTTP request will be aborted if the provided context is
  31476. // canceled.
  31477. func (c *OperatingSystemVersionsListCall) Context(ctx context.Context) *OperatingSystemVersionsListCall {
  31478. c.ctx_ = ctx
  31479. return c
  31480. }
  31481. // Header returns an http.Header that can be modified by the caller to
  31482. // add HTTP headers to the request.
  31483. func (c *OperatingSystemVersionsListCall) Header() http.Header {
  31484. if c.header_ == nil {
  31485. c.header_ = make(http.Header)
  31486. }
  31487. return c.header_
  31488. }
  31489. func (c *OperatingSystemVersionsListCall) doRequest(alt string) (*http.Response, error) {
  31490. reqHeaders := make(http.Header)
  31491. for k, v := range c.header_ {
  31492. reqHeaders[k] = v
  31493. }
  31494. reqHeaders.Set("User-Agent", c.s.userAgent())
  31495. if c.ifNoneMatch_ != "" {
  31496. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31497. }
  31498. var body io.Reader = nil
  31499. c.urlParams_.Set("alt", alt)
  31500. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystemVersions")
  31501. urls += "?" + c.urlParams_.Encode()
  31502. req, _ := http.NewRequest("GET", urls, body)
  31503. req.Header = reqHeaders
  31504. googleapi.Expand(req.URL, map[string]string{
  31505. "profileId": strconv.FormatInt(c.profileId, 10),
  31506. })
  31507. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31508. }
  31509. // Do executes the "dfareporting.operatingSystemVersions.list" call.
  31510. // Exactly one of *OperatingSystemVersionsListResponse or error will be
  31511. // non-nil. Any non-2xx status code is an error. Response headers are in
  31512. // either *OperatingSystemVersionsListResponse.ServerResponse.Header or
  31513. // (if a response was returned at all) in
  31514. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  31515. // whether the returned error was because http.StatusNotModified was
  31516. // returned.
  31517. func (c *OperatingSystemVersionsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemVersionsListResponse, error) {
  31518. gensupport.SetOptions(c.urlParams_, opts...)
  31519. res, err := c.doRequest("json")
  31520. if res != nil && res.StatusCode == http.StatusNotModified {
  31521. if res.Body != nil {
  31522. res.Body.Close()
  31523. }
  31524. return nil, &googleapi.Error{
  31525. Code: res.StatusCode,
  31526. Header: res.Header,
  31527. }
  31528. }
  31529. if err != nil {
  31530. return nil, err
  31531. }
  31532. defer googleapi.CloseBody(res)
  31533. if err := googleapi.CheckResponse(res); err != nil {
  31534. return nil, err
  31535. }
  31536. ret := &OperatingSystemVersionsListResponse{
  31537. ServerResponse: googleapi.ServerResponse{
  31538. Header: res.Header,
  31539. HTTPStatusCode: res.StatusCode,
  31540. },
  31541. }
  31542. target := &ret
  31543. if err := gensupport.DecodeResponse(target, res); err != nil {
  31544. return nil, err
  31545. }
  31546. return ret, nil
  31547. // {
  31548. // "description": "Retrieves a list of operating system versions.",
  31549. // "httpMethod": "GET",
  31550. // "id": "dfareporting.operatingSystemVersions.list",
  31551. // "parameterOrder": [
  31552. // "profileId"
  31553. // ],
  31554. // "parameters": {
  31555. // "profileId": {
  31556. // "description": "User profile ID associated with this request.",
  31557. // "format": "int64",
  31558. // "location": "path",
  31559. // "required": true,
  31560. // "type": "string"
  31561. // }
  31562. // },
  31563. // "path": "userprofiles/{profileId}/operatingSystemVersions",
  31564. // "response": {
  31565. // "$ref": "OperatingSystemVersionsListResponse"
  31566. // },
  31567. // "scopes": [
  31568. // "https://www.googleapis.com/auth/dfatrafficking"
  31569. // ]
  31570. // }
  31571. }
  31572. // method id "dfareporting.operatingSystems.get":
  31573. type OperatingSystemsGetCall struct {
  31574. s *Service
  31575. profileId int64
  31576. dartId int64
  31577. urlParams_ gensupport.URLParams
  31578. ifNoneMatch_ string
  31579. ctx_ context.Context
  31580. header_ http.Header
  31581. }
  31582. // Get: Gets one operating system by DART ID.
  31583. func (r *OperatingSystemsService) Get(profileId int64, dartId int64) *OperatingSystemsGetCall {
  31584. c := &OperatingSystemsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31585. c.profileId = profileId
  31586. c.dartId = dartId
  31587. return c
  31588. }
  31589. // Fields allows partial responses to be retrieved. See
  31590. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31591. // for more information.
  31592. func (c *OperatingSystemsGetCall) Fields(s ...googleapi.Field) *OperatingSystemsGetCall {
  31593. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31594. return c
  31595. }
  31596. // IfNoneMatch sets the optional parameter which makes the operation
  31597. // fail if the object's ETag matches the given value. This is useful for
  31598. // getting updates only after the object has changed since the last
  31599. // request. Use googleapi.IsNotModified to check whether the response
  31600. // error from Do is the result of In-None-Match.
  31601. func (c *OperatingSystemsGetCall) IfNoneMatch(entityTag string) *OperatingSystemsGetCall {
  31602. c.ifNoneMatch_ = entityTag
  31603. return c
  31604. }
  31605. // Context sets the context to be used in this call's Do method. Any
  31606. // pending HTTP request will be aborted if the provided context is
  31607. // canceled.
  31608. func (c *OperatingSystemsGetCall) Context(ctx context.Context) *OperatingSystemsGetCall {
  31609. c.ctx_ = ctx
  31610. return c
  31611. }
  31612. // Header returns an http.Header that can be modified by the caller to
  31613. // add HTTP headers to the request.
  31614. func (c *OperatingSystemsGetCall) Header() http.Header {
  31615. if c.header_ == nil {
  31616. c.header_ = make(http.Header)
  31617. }
  31618. return c.header_
  31619. }
  31620. func (c *OperatingSystemsGetCall) doRequest(alt string) (*http.Response, error) {
  31621. reqHeaders := make(http.Header)
  31622. for k, v := range c.header_ {
  31623. reqHeaders[k] = v
  31624. }
  31625. reqHeaders.Set("User-Agent", c.s.userAgent())
  31626. if c.ifNoneMatch_ != "" {
  31627. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31628. }
  31629. var body io.Reader = nil
  31630. c.urlParams_.Set("alt", alt)
  31631. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems/{dartId}")
  31632. urls += "?" + c.urlParams_.Encode()
  31633. req, _ := http.NewRequest("GET", urls, body)
  31634. req.Header = reqHeaders
  31635. googleapi.Expand(req.URL, map[string]string{
  31636. "profileId": strconv.FormatInt(c.profileId, 10),
  31637. "dartId": strconv.FormatInt(c.dartId, 10),
  31638. })
  31639. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31640. }
  31641. // Do executes the "dfareporting.operatingSystems.get" call.
  31642. // Exactly one of *OperatingSystem or error will be non-nil. Any non-2xx
  31643. // status code is an error. Response headers are in either
  31644. // *OperatingSystem.ServerResponse.Header or (if a response was returned
  31645. // at all) in error.(*googleapi.Error).Header. Use
  31646. // googleapi.IsNotModified to check whether the returned error was
  31647. // because http.StatusNotModified was returned.
  31648. func (c *OperatingSystemsGetCall) Do(opts ...googleapi.CallOption) (*OperatingSystem, error) {
  31649. gensupport.SetOptions(c.urlParams_, opts...)
  31650. res, err := c.doRequest("json")
  31651. if res != nil && res.StatusCode == http.StatusNotModified {
  31652. if res.Body != nil {
  31653. res.Body.Close()
  31654. }
  31655. return nil, &googleapi.Error{
  31656. Code: res.StatusCode,
  31657. Header: res.Header,
  31658. }
  31659. }
  31660. if err != nil {
  31661. return nil, err
  31662. }
  31663. defer googleapi.CloseBody(res)
  31664. if err := googleapi.CheckResponse(res); err != nil {
  31665. return nil, err
  31666. }
  31667. ret := &OperatingSystem{
  31668. ServerResponse: googleapi.ServerResponse{
  31669. Header: res.Header,
  31670. HTTPStatusCode: res.StatusCode,
  31671. },
  31672. }
  31673. target := &ret
  31674. if err := gensupport.DecodeResponse(target, res); err != nil {
  31675. return nil, err
  31676. }
  31677. return ret, nil
  31678. // {
  31679. // "description": "Gets one operating system by DART ID.",
  31680. // "httpMethod": "GET",
  31681. // "id": "dfareporting.operatingSystems.get",
  31682. // "parameterOrder": [
  31683. // "profileId",
  31684. // "dartId"
  31685. // ],
  31686. // "parameters": {
  31687. // "dartId": {
  31688. // "description": "Operating system DART ID.",
  31689. // "format": "int64",
  31690. // "location": "path",
  31691. // "required": true,
  31692. // "type": "string"
  31693. // },
  31694. // "profileId": {
  31695. // "description": "User profile ID associated with this request.",
  31696. // "format": "int64",
  31697. // "location": "path",
  31698. // "required": true,
  31699. // "type": "string"
  31700. // }
  31701. // },
  31702. // "path": "userprofiles/{profileId}/operatingSystems/{dartId}",
  31703. // "response": {
  31704. // "$ref": "OperatingSystem"
  31705. // },
  31706. // "scopes": [
  31707. // "https://www.googleapis.com/auth/dfatrafficking"
  31708. // ]
  31709. // }
  31710. }
  31711. // method id "dfareporting.operatingSystems.list":
  31712. type OperatingSystemsListCall struct {
  31713. s *Service
  31714. profileId int64
  31715. urlParams_ gensupport.URLParams
  31716. ifNoneMatch_ string
  31717. ctx_ context.Context
  31718. header_ http.Header
  31719. }
  31720. // List: Retrieves a list of operating systems.
  31721. func (r *OperatingSystemsService) List(profileId int64) *OperatingSystemsListCall {
  31722. c := &OperatingSystemsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31723. c.profileId = profileId
  31724. return c
  31725. }
  31726. // Fields allows partial responses to be retrieved. See
  31727. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31728. // for more information.
  31729. func (c *OperatingSystemsListCall) Fields(s ...googleapi.Field) *OperatingSystemsListCall {
  31730. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31731. return c
  31732. }
  31733. // IfNoneMatch sets the optional parameter which makes the operation
  31734. // fail if the object's ETag matches the given value. This is useful for
  31735. // getting updates only after the object has changed since the last
  31736. // request. Use googleapi.IsNotModified to check whether the response
  31737. // error from Do is the result of In-None-Match.
  31738. func (c *OperatingSystemsListCall) IfNoneMatch(entityTag string) *OperatingSystemsListCall {
  31739. c.ifNoneMatch_ = entityTag
  31740. return c
  31741. }
  31742. // Context sets the context to be used in this call's Do method. Any
  31743. // pending HTTP request will be aborted if the provided context is
  31744. // canceled.
  31745. func (c *OperatingSystemsListCall) Context(ctx context.Context) *OperatingSystemsListCall {
  31746. c.ctx_ = ctx
  31747. return c
  31748. }
  31749. // Header returns an http.Header that can be modified by the caller to
  31750. // add HTTP headers to the request.
  31751. func (c *OperatingSystemsListCall) Header() http.Header {
  31752. if c.header_ == nil {
  31753. c.header_ = make(http.Header)
  31754. }
  31755. return c.header_
  31756. }
  31757. func (c *OperatingSystemsListCall) doRequest(alt string) (*http.Response, error) {
  31758. reqHeaders := make(http.Header)
  31759. for k, v := range c.header_ {
  31760. reqHeaders[k] = v
  31761. }
  31762. reqHeaders.Set("User-Agent", c.s.userAgent())
  31763. if c.ifNoneMatch_ != "" {
  31764. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31765. }
  31766. var body io.Reader = nil
  31767. c.urlParams_.Set("alt", alt)
  31768. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/operatingSystems")
  31769. urls += "?" + c.urlParams_.Encode()
  31770. req, _ := http.NewRequest("GET", urls, body)
  31771. req.Header = reqHeaders
  31772. googleapi.Expand(req.URL, map[string]string{
  31773. "profileId": strconv.FormatInt(c.profileId, 10),
  31774. })
  31775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31776. }
  31777. // Do executes the "dfareporting.operatingSystems.list" call.
  31778. // Exactly one of *OperatingSystemsListResponse or error will be
  31779. // non-nil. Any non-2xx status code is an error. Response headers are in
  31780. // either *OperatingSystemsListResponse.ServerResponse.Header or (if a
  31781. // response was returned at all) in error.(*googleapi.Error).Header. Use
  31782. // googleapi.IsNotModified to check whether the returned error was
  31783. // because http.StatusNotModified was returned.
  31784. func (c *OperatingSystemsListCall) Do(opts ...googleapi.CallOption) (*OperatingSystemsListResponse, error) {
  31785. gensupport.SetOptions(c.urlParams_, opts...)
  31786. res, err := c.doRequest("json")
  31787. if res != nil && res.StatusCode == http.StatusNotModified {
  31788. if res.Body != nil {
  31789. res.Body.Close()
  31790. }
  31791. return nil, &googleapi.Error{
  31792. Code: res.StatusCode,
  31793. Header: res.Header,
  31794. }
  31795. }
  31796. if err != nil {
  31797. return nil, err
  31798. }
  31799. defer googleapi.CloseBody(res)
  31800. if err := googleapi.CheckResponse(res); err != nil {
  31801. return nil, err
  31802. }
  31803. ret := &OperatingSystemsListResponse{
  31804. ServerResponse: googleapi.ServerResponse{
  31805. Header: res.Header,
  31806. HTTPStatusCode: res.StatusCode,
  31807. },
  31808. }
  31809. target := &ret
  31810. if err := gensupport.DecodeResponse(target, res); err != nil {
  31811. return nil, err
  31812. }
  31813. return ret, nil
  31814. // {
  31815. // "description": "Retrieves a list of operating systems.",
  31816. // "httpMethod": "GET",
  31817. // "id": "dfareporting.operatingSystems.list",
  31818. // "parameterOrder": [
  31819. // "profileId"
  31820. // ],
  31821. // "parameters": {
  31822. // "profileId": {
  31823. // "description": "User profile ID associated with this request.",
  31824. // "format": "int64",
  31825. // "location": "path",
  31826. // "required": true,
  31827. // "type": "string"
  31828. // }
  31829. // },
  31830. // "path": "userprofiles/{profileId}/operatingSystems",
  31831. // "response": {
  31832. // "$ref": "OperatingSystemsListResponse"
  31833. // },
  31834. // "scopes": [
  31835. // "https://www.googleapis.com/auth/dfatrafficking"
  31836. // ]
  31837. // }
  31838. }
  31839. // method id "dfareporting.orderDocuments.get":
  31840. type OrderDocumentsGetCall struct {
  31841. s *Service
  31842. profileId int64
  31843. projectId int64
  31844. id int64
  31845. urlParams_ gensupport.URLParams
  31846. ifNoneMatch_ string
  31847. ctx_ context.Context
  31848. header_ http.Header
  31849. }
  31850. // Get: Gets one order document by ID.
  31851. func (r *OrderDocumentsService) Get(profileId int64, projectId int64, id int64) *OrderDocumentsGetCall {
  31852. c := &OrderDocumentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  31853. c.profileId = profileId
  31854. c.projectId = projectId
  31855. c.id = id
  31856. return c
  31857. }
  31858. // Fields allows partial responses to be retrieved. See
  31859. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  31860. // for more information.
  31861. func (c *OrderDocumentsGetCall) Fields(s ...googleapi.Field) *OrderDocumentsGetCall {
  31862. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  31863. return c
  31864. }
  31865. // IfNoneMatch sets the optional parameter which makes the operation
  31866. // fail if the object's ETag matches the given value. This is useful for
  31867. // getting updates only after the object has changed since the last
  31868. // request. Use googleapi.IsNotModified to check whether the response
  31869. // error from Do is the result of In-None-Match.
  31870. func (c *OrderDocumentsGetCall) IfNoneMatch(entityTag string) *OrderDocumentsGetCall {
  31871. c.ifNoneMatch_ = entityTag
  31872. return c
  31873. }
  31874. // Context sets the context to be used in this call's Do method. Any
  31875. // pending HTTP request will be aborted if the provided context is
  31876. // canceled.
  31877. func (c *OrderDocumentsGetCall) Context(ctx context.Context) *OrderDocumentsGetCall {
  31878. c.ctx_ = ctx
  31879. return c
  31880. }
  31881. // Header returns an http.Header that can be modified by the caller to
  31882. // add HTTP headers to the request.
  31883. func (c *OrderDocumentsGetCall) Header() http.Header {
  31884. if c.header_ == nil {
  31885. c.header_ = make(http.Header)
  31886. }
  31887. return c.header_
  31888. }
  31889. func (c *OrderDocumentsGetCall) doRequest(alt string) (*http.Response, error) {
  31890. reqHeaders := make(http.Header)
  31891. for k, v := range c.header_ {
  31892. reqHeaders[k] = v
  31893. }
  31894. reqHeaders.Set("User-Agent", c.s.userAgent())
  31895. if c.ifNoneMatch_ != "" {
  31896. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  31897. }
  31898. var body io.Reader = nil
  31899. c.urlParams_.Set("alt", alt)
  31900. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}")
  31901. urls += "?" + c.urlParams_.Encode()
  31902. req, _ := http.NewRequest("GET", urls, body)
  31903. req.Header = reqHeaders
  31904. googleapi.Expand(req.URL, map[string]string{
  31905. "profileId": strconv.FormatInt(c.profileId, 10),
  31906. "projectId": strconv.FormatInt(c.projectId, 10),
  31907. "id": strconv.FormatInt(c.id, 10),
  31908. })
  31909. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  31910. }
  31911. // Do executes the "dfareporting.orderDocuments.get" call.
  31912. // Exactly one of *OrderDocument or error will be non-nil. Any non-2xx
  31913. // status code is an error. Response headers are in either
  31914. // *OrderDocument.ServerResponse.Header or (if a response was returned
  31915. // at all) in error.(*googleapi.Error).Header. Use
  31916. // googleapi.IsNotModified to check whether the returned error was
  31917. // because http.StatusNotModified was returned.
  31918. func (c *OrderDocumentsGetCall) Do(opts ...googleapi.CallOption) (*OrderDocument, error) {
  31919. gensupport.SetOptions(c.urlParams_, opts...)
  31920. res, err := c.doRequest("json")
  31921. if res != nil && res.StatusCode == http.StatusNotModified {
  31922. if res.Body != nil {
  31923. res.Body.Close()
  31924. }
  31925. return nil, &googleapi.Error{
  31926. Code: res.StatusCode,
  31927. Header: res.Header,
  31928. }
  31929. }
  31930. if err != nil {
  31931. return nil, err
  31932. }
  31933. defer googleapi.CloseBody(res)
  31934. if err := googleapi.CheckResponse(res); err != nil {
  31935. return nil, err
  31936. }
  31937. ret := &OrderDocument{
  31938. ServerResponse: googleapi.ServerResponse{
  31939. Header: res.Header,
  31940. HTTPStatusCode: res.StatusCode,
  31941. },
  31942. }
  31943. target := &ret
  31944. if err := gensupport.DecodeResponse(target, res); err != nil {
  31945. return nil, err
  31946. }
  31947. return ret, nil
  31948. // {
  31949. // "description": "Gets one order document by ID.",
  31950. // "httpMethod": "GET",
  31951. // "id": "dfareporting.orderDocuments.get",
  31952. // "parameterOrder": [
  31953. // "profileId",
  31954. // "projectId",
  31955. // "id"
  31956. // ],
  31957. // "parameters": {
  31958. // "id": {
  31959. // "description": "Order document ID.",
  31960. // "format": "int64",
  31961. // "location": "path",
  31962. // "required": true,
  31963. // "type": "string"
  31964. // },
  31965. // "profileId": {
  31966. // "description": "User profile ID associated with this request.",
  31967. // "format": "int64",
  31968. // "location": "path",
  31969. // "required": true,
  31970. // "type": "string"
  31971. // },
  31972. // "projectId": {
  31973. // "description": "Project ID for order documents.",
  31974. // "format": "int64",
  31975. // "location": "path",
  31976. // "required": true,
  31977. // "type": "string"
  31978. // }
  31979. // },
  31980. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments/{id}",
  31981. // "response": {
  31982. // "$ref": "OrderDocument"
  31983. // },
  31984. // "scopes": [
  31985. // "https://www.googleapis.com/auth/dfatrafficking"
  31986. // ]
  31987. // }
  31988. }
  31989. // method id "dfareporting.orderDocuments.list":
  31990. type OrderDocumentsListCall struct {
  31991. s *Service
  31992. profileId int64
  31993. projectId int64
  31994. urlParams_ gensupport.URLParams
  31995. ifNoneMatch_ string
  31996. ctx_ context.Context
  31997. header_ http.Header
  31998. }
  31999. // List: Retrieves a list of order documents, possibly filtered. This
  32000. // method supports paging.
  32001. func (r *OrderDocumentsService) List(profileId int64, projectId int64) *OrderDocumentsListCall {
  32002. c := &OrderDocumentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32003. c.profileId = profileId
  32004. c.projectId = projectId
  32005. return c
  32006. }
  32007. // Approved sets the optional parameter "approved": Select only order
  32008. // documents that have been approved by at least one user.
  32009. func (c *OrderDocumentsListCall) Approved(approved bool) *OrderDocumentsListCall {
  32010. c.urlParams_.Set("approved", fmt.Sprint(approved))
  32011. return c
  32012. }
  32013. // Ids sets the optional parameter "ids": Select only order documents
  32014. // with these IDs.
  32015. func (c *OrderDocumentsListCall) Ids(ids ...int64) *OrderDocumentsListCall {
  32016. var ids_ []string
  32017. for _, v := range ids {
  32018. ids_ = append(ids_, fmt.Sprint(v))
  32019. }
  32020. c.urlParams_.SetMulti("ids", ids_)
  32021. return c
  32022. }
  32023. // MaxResults sets the optional parameter "maxResults": Maximum number
  32024. // of results to return.
  32025. func (c *OrderDocumentsListCall) MaxResults(maxResults int64) *OrderDocumentsListCall {
  32026. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32027. return c
  32028. }
  32029. // OrderId sets the optional parameter "orderId": Select only order
  32030. // documents for specified orders.
  32031. func (c *OrderDocumentsListCall) OrderId(orderId ...int64) *OrderDocumentsListCall {
  32032. var orderId_ []string
  32033. for _, v := range orderId {
  32034. orderId_ = append(orderId_, fmt.Sprint(v))
  32035. }
  32036. c.urlParams_.SetMulti("orderId", orderId_)
  32037. return c
  32038. }
  32039. // PageToken sets the optional parameter "pageToken": Value of the
  32040. // nextPageToken from the previous result page.
  32041. func (c *OrderDocumentsListCall) PageToken(pageToken string) *OrderDocumentsListCall {
  32042. c.urlParams_.Set("pageToken", pageToken)
  32043. return c
  32044. }
  32045. // SearchString sets the optional parameter "searchString": Allows
  32046. // searching for order documents by name or ID. Wildcards (*) are
  32047. // allowed. For example, "orderdocument*2015" will return order
  32048. // documents with names like "orderdocument June 2015", "orderdocument
  32049. // April 2015", or simply "orderdocument 2015". Most of the searches
  32050. // also add wildcards implicitly at the start and the end of the search
  32051. // string. For example, a search string of "orderdocument" will match
  32052. // order documents with name "my orderdocument", "orderdocument 2015",
  32053. // or simply "orderdocument".
  32054. func (c *OrderDocumentsListCall) SearchString(searchString string) *OrderDocumentsListCall {
  32055. c.urlParams_.Set("searchString", searchString)
  32056. return c
  32057. }
  32058. // SiteId sets the optional parameter "siteId": Select only order
  32059. // documents that are associated with these sites.
  32060. func (c *OrderDocumentsListCall) SiteId(siteId ...int64) *OrderDocumentsListCall {
  32061. var siteId_ []string
  32062. for _, v := range siteId {
  32063. siteId_ = append(siteId_, fmt.Sprint(v))
  32064. }
  32065. c.urlParams_.SetMulti("siteId", siteId_)
  32066. return c
  32067. }
  32068. // SortField sets the optional parameter "sortField": Field by which to
  32069. // sort the list.
  32070. //
  32071. // Possible values:
  32072. // "ID" (default)
  32073. // "NAME"
  32074. func (c *OrderDocumentsListCall) SortField(sortField string) *OrderDocumentsListCall {
  32075. c.urlParams_.Set("sortField", sortField)
  32076. return c
  32077. }
  32078. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  32079. // results.
  32080. //
  32081. // Possible values:
  32082. // "ASCENDING" (default)
  32083. // "DESCENDING"
  32084. func (c *OrderDocumentsListCall) SortOrder(sortOrder string) *OrderDocumentsListCall {
  32085. c.urlParams_.Set("sortOrder", sortOrder)
  32086. return c
  32087. }
  32088. // Fields allows partial responses to be retrieved. See
  32089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32090. // for more information.
  32091. func (c *OrderDocumentsListCall) Fields(s ...googleapi.Field) *OrderDocumentsListCall {
  32092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32093. return c
  32094. }
  32095. // IfNoneMatch sets the optional parameter which makes the operation
  32096. // fail if the object's ETag matches the given value. This is useful for
  32097. // getting updates only after the object has changed since the last
  32098. // request. Use googleapi.IsNotModified to check whether the response
  32099. // error from Do is the result of In-None-Match.
  32100. func (c *OrderDocumentsListCall) IfNoneMatch(entityTag string) *OrderDocumentsListCall {
  32101. c.ifNoneMatch_ = entityTag
  32102. return c
  32103. }
  32104. // Context sets the context to be used in this call's Do method. Any
  32105. // pending HTTP request will be aborted if the provided context is
  32106. // canceled.
  32107. func (c *OrderDocumentsListCall) Context(ctx context.Context) *OrderDocumentsListCall {
  32108. c.ctx_ = ctx
  32109. return c
  32110. }
  32111. // Header returns an http.Header that can be modified by the caller to
  32112. // add HTTP headers to the request.
  32113. func (c *OrderDocumentsListCall) Header() http.Header {
  32114. if c.header_ == nil {
  32115. c.header_ = make(http.Header)
  32116. }
  32117. return c.header_
  32118. }
  32119. func (c *OrderDocumentsListCall) doRequest(alt string) (*http.Response, error) {
  32120. reqHeaders := make(http.Header)
  32121. for k, v := range c.header_ {
  32122. reqHeaders[k] = v
  32123. }
  32124. reqHeaders.Set("User-Agent", c.s.userAgent())
  32125. if c.ifNoneMatch_ != "" {
  32126. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32127. }
  32128. var body io.Reader = nil
  32129. c.urlParams_.Set("alt", alt)
  32130. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orderDocuments")
  32131. urls += "?" + c.urlParams_.Encode()
  32132. req, _ := http.NewRequest("GET", urls, body)
  32133. req.Header = reqHeaders
  32134. googleapi.Expand(req.URL, map[string]string{
  32135. "profileId": strconv.FormatInt(c.profileId, 10),
  32136. "projectId": strconv.FormatInt(c.projectId, 10),
  32137. })
  32138. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32139. }
  32140. // Do executes the "dfareporting.orderDocuments.list" call.
  32141. // Exactly one of *OrderDocumentsListResponse or error will be non-nil.
  32142. // Any non-2xx status code is an error. Response headers are in either
  32143. // *OrderDocumentsListResponse.ServerResponse.Header or (if a response
  32144. // was returned at all) in error.(*googleapi.Error).Header. Use
  32145. // googleapi.IsNotModified to check whether the returned error was
  32146. // because http.StatusNotModified was returned.
  32147. func (c *OrderDocumentsListCall) Do(opts ...googleapi.CallOption) (*OrderDocumentsListResponse, error) {
  32148. gensupport.SetOptions(c.urlParams_, opts...)
  32149. res, err := c.doRequest("json")
  32150. if res != nil && res.StatusCode == http.StatusNotModified {
  32151. if res.Body != nil {
  32152. res.Body.Close()
  32153. }
  32154. return nil, &googleapi.Error{
  32155. Code: res.StatusCode,
  32156. Header: res.Header,
  32157. }
  32158. }
  32159. if err != nil {
  32160. return nil, err
  32161. }
  32162. defer googleapi.CloseBody(res)
  32163. if err := googleapi.CheckResponse(res); err != nil {
  32164. return nil, err
  32165. }
  32166. ret := &OrderDocumentsListResponse{
  32167. ServerResponse: googleapi.ServerResponse{
  32168. Header: res.Header,
  32169. HTTPStatusCode: res.StatusCode,
  32170. },
  32171. }
  32172. target := &ret
  32173. if err := gensupport.DecodeResponse(target, res); err != nil {
  32174. return nil, err
  32175. }
  32176. return ret, nil
  32177. // {
  32178. // "description": "Retrieves a list of order documents, possibly filtered. This method supports paging.",
  32179. // "httpMethod": "GET",
  32180. // "id": "dfareporting.orderDocuments.list",
  32181. // "parameterOrder": [
  32182. // "profileId",
  32183. // "projectId"
  32184. // ],
  32185. // "parameters": {
  32186. // "approved": {
  32187. // "description": "Select only order documents that have been approved by at least one user.",
  32188. // "location": "query",
  32189. // "type": "boolean"
  32190. // },
  32191. // "ids": {
  32192. // "description": "Select only order documents with these IDs.",
  32193. // "format": "int64",
  32194. // "location": "query",
  32195. // "repeated": true,
  32196. // "type": "string"
  32197. // },
  32198. // "maxResults": {
  32199. // "default": "1000",
  32200. // "description": "Maximum number of results to return.",
  32201. // "format": "int32",
  32202. // "location": "query",
  32203. // "maximum": "1000",
  32204. // "minimum": "0",
  32205. // "type": "integer"
  32206. // },
  32207. // "orderId": {
  32208. // "description": "Select only order documents for specified orders.",
  32209. // "format": "int64",
  32210. // "location": "query",
  32211. // "repeated": true,
  32212. // "type": "string"
  32213. // },
  32214. // "pageToken": {
  32215. // "description": "Value of the nextPageToken from the previous result page.",
  32216. // "location": "query",
  32217. // "type": "string"
  32218. // },
  32219. // "profileId": {
  32220. // "description": "User profile ID associated with this request.",
  32221. // "format": "int64",
  32222. // "location": "path",
  32223. // "required": true,
  32224. // "type": "string"
  32225. // },
  32226. // "projectId": {
  32227. // "description": "Project ID for order documents.",
  32228. // "format": "int64",
  32229. // "location": "path",
  32230. // "required": true,
  32231. // "type": "string"
  32232. // },
  32233. // "searchString": {
  32234. // "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\".",
  32235. // "location": "query",
  32236. // "type": "string"
  32237. // },
  32238. // "siteId": {
  32239. // "description": "Select only order documents that are associated with these sites.",
  32240. // "format": "int64",
  32241. // "location": "query",
  32242. // "repeated": true,
  32243. // "type": "string"
  32244. // },
  32245. // "sortField": {
  32246. // "default": "ID",
  32247. // "description": "Field by which to sort the list.",
  32248. // "enum": [
  32249. // "ID",
  32250. // "NAME"
  32251. // ],
  32252. // "enumDescriptions": [
  32253. // "",
  32254. // ""
  32255. // ],
  32256. // "location": "query",
  32257. // "type": "string"
  32258. // },
  32259. // "sortOrder": {
  32260. // "default": "ASCENDING",
  32261. // "description": "Order of sorted results.",
  32262. // "enum": [
  32263. // "ASCENDING",
  32264. // "DESCENDING"
  32265. // ],
  32266. // "enumDescriptions": [
  32267. // "",
  32268. // ""
  32269. // ],
  32270. // "location": "query",
  32271. // "type": "string"
  32272. // }
  32273. // },
  32274. // "path": "userprofiles/{profileId}/projects/{projectId}/orderDocuments",
  32275. // "response": {
  32276. // "$ref": "OrderDocumentsListResponse"
  32277. // },
  32278. // "scopes": [
  32279. // "https://www.googleapis.com/auth/dfatrafficking"
  32280. // ]
  32281. // }
  32282. }
  32283. // Pages invokes f for each page of results.
  32284. // A non-nil error returned from f will halt the iteration.
  32285. // The provided context supersedes any context provided to the Context method.
  32286. func (c *OrderDocumentsListCall) Pages(ctx context.Context, f func(*OrderDocumentsListResponse) error) error {
  32287. c.ctx_ = ctx
  32288. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32289. for {
  32290. x, err := c.Do()
  32291. if err != nil {
  32292. return err
  32293. }
  32294. if err := f(x); err != nil {
  32295. return err
  32296. }
  32297. if x.NextPageToken == "" {
  32298. return nil
  32299. }
  32300. c.PageToken(x.NextPageToken)
  32301. }
  32302. }
  32303. // method id "dfareporting.orders.get":
  32304. type OrdersGetCall struct {
  32305. s *Service
  32306. profileId int64
  32307. projectId int64
  32308. id int64
  32309. urlParams_ gensupport.URLParams
  32310. ifNoneMatch_ string
  32311. ctx_ context.Context
  32312. header_ http.Header
  32313. }
  32314. // Get: Gets one order by ID.
  32315. func (r *OrdersService) Get(profileId int64, projectId int64, id int64) *OrdersGetCall {
  32316. c := &OrdersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32317. c.profileId = profileId
  32318. c.projectId = projectId
  32319. c.id = id
  32320. return c
  32321. }
  32322. // Fields allows partial responses to be retrieved. See
  32323. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32324. // for more information.
  32325. func (c *OrdersGetCall) Fields(s ...googleapi.Field) *OrdersGetCall {
  32326. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32327. return c
  32328. }
  32329. // IfNoneMatch sets the optional parameter which makes the operation
  32330. // fail if the object's ETag matches the given value. This is useful for
  32331. // getting updates only after the object has changed since the last
  32332. // request. Use googleapi.IsNotModified to check whether the response
  32333. // error from Do is the result of In-None-Match.
  32334. func (c *OrdersGetCall) IfNoneMatch(entityTag string) *OrdersGetCall {
  32335. c.ifNoneMatch_ = entityTag
  32336. return c
  32337. }
  32338. // Context sets the context to be used in this call's Do method. Any
  32339. // pending HTTP request will be aborted if the provided context is
  32340. // canceled.
  32341. func (c *OrdersGetCall) Context(ctx context.Context) *OrdersGetCall {
  32342. c.ctx_ = ctx
  32343. return c
  32344. }
  32345. // Header returns an http.Header that can be modified by the caller to
  32346. // add HTTP headers to the request.
  32347. func (c *OrdersGetCall) Header() http.Header {
  32348. if c.header_ == nil {
  32349. c.header_ = make(http.Header)
  32350. }
  32351. return c.header_
  32352. }
  32353. func (c *OrdersGetCall) doRequest(alt string) (*http.Response, error) {
  32354. reqHeaders := make(http.Header)
  32355. for k, v := range c.header_ {
  32356. reqHeaders[k] = v
  32357. }
  32358. reqHeaders.Set("User-Agent", c.s.userAgent())
  32359. if c.ifNoneMatch_ != "" {
  32360. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32361. }
  32362. var body io.Reader = nil
  32363. c.urlParams_.Set("alt", alt)
  32364. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders/{id}")
  32365. urls += "?" + c.urlParams_.Encode()
  32366. req, _ := http.NewRequest("GET", urls, body)
  32367. req.Header = reqHeaders
  32368. googleapi.Expand(req.URL, map[string]string{
  32369. "profileId": strconv.FormatInt(c.profileId, 10),
  32370. "projectId": strconv.FormatInt(c.projectId, 10),
  32371. "id": strconv.FormatInt(c.id, 10),
  32372. })
  32373. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32374. }
  32375. // Do executes the "dfareporting.orders.get" call.
  32376. // Exactly one of *Order or error will be non-nil. Any non-2xx status
  32377. // code is an error. Response headers are in either
  32378. // *Order.ServerResponse.Header or (if a response was returned at all)
  32379. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  32380. // check whether the returned error was because http.StatusNotModified
  32381. // was returned.
  32382. func (c *OrdersGetCall) Do(opts ...googleapi.CallOption) (*Order, error) {
  32383. gensupport.SetOptions(c.urlParams_, opts...)
  32384. res, err := c.doRequest("json")
  32385. if res != nil && res.StatusCode == http.StatusNotModified {
  32386. if res.Body != nil {
  32387. res.Body.Close()
  32388. }
  32389. return nil, &googleapi.Error{
  32390. Code: res.StatusCode,
  32391. Header: res.Header,
  32392. }
  32393. }
  32394. if err != nil {
  32395. return nil, err
  32396. }
  32397. defer googleapi.CloseBody(res)
  32398. if err := googleapi.CheckResponse(res); err != nil {
  32399. return nil, err
  32400. }
  32401. ret := &Order{
  32402. ServerResponse: googleapi.ServerResponse{
  32403. Header: res.Header,
  32404. HTTPStatusCode: res.StatusCode,
  32405. },
  32406. }
  32407. target := &ret
  32408. if err := gensupport.DecodeResponse(target, res); err != nil {
  32409. return nil, err
  32410. }
  32411. return ret, nil
  32412. // {
  32413. // "description": "Gets one order by ID.",
  32414. // "httpMethod": "GET",
  32415. // "id": "dfareporting.orders.get",
  32416. // "parameterOrder": [
  32417. // "profileId",
  32418. // "projectId",
  32419. // "id"
  32420. // ],
  32421. // "parameters": {
  32422. // "id": {
  32423. // "description": "Order ID.",
  32424. // "format": "int64",
  32425. // "location": "path",
  32426. // "required": true,
  32427. // "type": "string"
  32428. // },
  32429. // "profileId": {
  32430. // "description": "User profile ID associated with this request.",
  32431. // "format": "int64",
  32432. // "location": "path",
  32433. // "required": true,
  32434. // "type": "string"
  32435. // },
  32436. // "projectId": {
  32437. // "description": "Project ID for orders.",
  32438. // "format": "int64",
  32439. // "location": "path",
  32440. // "required": true,
  32441. // "type": "string"
  32442. // }
  32443. // },
  32444. // "path": "userprofiles/{profileId}/projects/{projectId}/orders/{id}",
  32445. // "response": {
  32446. // "$ref": "Order"
  32447. // },
  32448. // "scopes": [
  32449. // "https://www.googleapis.com/auth/dfatrafficking"
  32450. // ]
  32451. // }
  32452. }
  32453. // method id "dfareporting.orders.list":
  32454. type OrdersListCall struct {
  32455. s *Service
  32456. profileId int64
  32457. projectId int64
  32458. urlParams_ gensupport.URLParams
  32459. ifNoneMatch_ string
  32460. ctx_ context.Context
  32461. header_ http.Header
  32462. }
  32463. // List: Retrieves a list of orders, possibly filtered. This method
  32464. // supports paging.
  32465. func (r *OrdersService) List(profileId int64, projectId int64) *OrdersListCall {
  32466. c := &OrdersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32467. c.profileId = profileId
  32468. c.projectId = projectId
  32469. return c
  32470. }
  32471. // Ids sets the optional parameter "ids": Select only orders with these
  32472. // IDs.
  32473. func (c *OrdersListCall) Ids(ids ...int64) *OrdersListCall {
  32474. var ids_ []string
  32475. for _, v := range ids {
  32476. ids_ = append(ids_, fmt.Sprint(v))
  32477. }
  32478. c.urlParams_.SetMulti("ids", ids_)
  32479. return c
  32480. }
  32481. // MaxResults sets the optional parameter "maxResults": Maximum number
  32482. // of results to return.
  32483. func (c *OrdersListCall) MaxResults(maxResults int64) *OrdersListCall {
  32484. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  32485. return c
  32486. }
  32487. // PageToken sets the optional parameter "pageToken": Value of the
  32488. // nextPageToken from the previous result page.
  32489. func (c *OrdersListCall) PageToken(pageToken string) *OrdersListCall {
  32490. c.urlParams_.Set("pageToken", pageToken)
  32491. return c
  32492. }
  32493. // SearchString sets the optional parameter "searchString": Allows
  32494. // searching for orders by name or ID. Wildcards (*) are allowed. For
  32495. // example, "order*2015" will return orders with names like "order June
  32496. // 2015", "order April 2015", or simply "order 2015". Most of the
  32497. // searches also add wildcards implicitly at the start and the end of
  32498. // the search string. For example, a search string of "order" will match
  32499. // orders with name "my order", "order 2015", or simply "order".
  32500. func (c *OrdersListCall) SearchString(searchString string) *OrdersListCall {
  32501. c.urlParams_.Set("searchString", searchString)
  32502. return c
  32503. }
  32504. // SiteId sets the optional parameter "siteId": Select only orders that
  32505. // are associated with these site IDs.
  32506. func (c *OrdersListCall) SiteId(siteId ...int64) *OrdersListCall {
  32507. var siteId_ []string
  32508. for _, v := range siteId {
  32509. siteId_ = append(siteId_, fmt.Sprint(v))
  32510. }
  32511. c.urlParams_.SetMulti("siteId", siteId_)
  32512. return c
  32513. }
  32514. // SortField sets the optional parameter "sortField": Field by which to
  32515. // sort the list.
  32516. //
  32517. // Possible values:
  32518. // "ID" (default)
  32519. // "NAME"
  32520. func (c *OrdersListCall) SortField(sortField string) *OrdersListCall {
  32521. c.urlParams_.Set("sortField", sortField)
  32522. return c
  32523. }
  32524. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  32525. // results.
  32526. //
  32527. // Possible values:
  32528. // "ASCENDING" (default)
  32529. // "DESCENDING"
  32530. func (c *OrdersListCall) SortOrder(sortOrder string) *OrdersListCall {
  32531. c.urlParams_.Set("sortOrder", sortOrder)
  32532. return c
  32533. }
  32534. // Fields allows partial responses to be retrieved. See
  32535. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32536. // for more information.
  32537. func (c *OrdersListCall) Fields(s ...googleapi.Field) *OrdersListCall {
  32538. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32539. return c
  32540. }
  32541. // IfNoneMatch sets the optional parameter which makes the operation
  32542. // fail if the object's ETag matches the given value. This is useful for
  32543. // getting updates only after the object has changed since the last
  32544. // request. Use googleapi.IsNotModified to check whether the response
  32545. // error from Do is the result of In-None-Match.
  32546. func (c *OrdersListCall) IfNoneMatch(entityTag string) *OrdersListCall {
  32547. c.ifNoneMatch_ = entityTag
  32548. return c
  32549. }
  32550. // Context sets the context to be used in this call's Do method. Any
  32551. // pending HTTP request will be aborted if the provided context is
  32552. // canceled.
  32553. func (c *OrdersListCall) Context(ctx context.Context) *OrdersListCall {
  32554. c.ctx_ = ctx
  32555. return c
  32556. }
  32557. // Header returns an http.Header that can be modified by the caller to
  32558. // add HTTP headers to the request.
  32559. func (c *OrdersListCall) Header() http.Header {
  32560. if c.header_ == nil {
  32561. c.header_ = make(http.Header)
  32562. }
  32563. return c.header_
  32564. }
  32565. func (c *OrdersListCall) doRequest(alt string) (*http.Response, error) {
  32566. reqHeaders := make(http.Header)
  32567. for k, v := range c.header_ {
  32568. reqHeaders[k] = v
  32569. }
  32570. reqHeaders.Set("User-Agent", c.s.userAgent())
  32571. if c.ifNoneMatch_ != "" {
  32572. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32573. }
  32574. var body io.Reader = nil
  32575. c.urlParams_.Set("alt", alt)
  32576. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{projectId}/orders")
  32577. urls += "?" + c.urlParams_.Encode()
  32578. req, _ := http.NewRequest("GET", urls, body)
  32579. req.Header = reqHeaders
  32580. googleapi.Expand(req.URL, map[string]string{
  32581. "profileId": strconv.FormatInt(c.profileId, 10),
  32582. "projectId": strconv.FormatInt(c.projectId, 10),
  32583. })
  32584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32585. }
  32586. // Do executes the "dfareporting.orders.list" call.
  32587. // Exactly one of *OrdersListResponse or error will be non-nil. Any
  32588. // non-2xx status code is an error. Response headers are in either
  32589. // *OrdersListResponse.ServerResponse.Header or (if a response was
  32590. // returned at all) in error.(*googleapi.Error).Header. Use
  32591. // googleapi.IsNotModified to check whether the returned error was
  32592. // because http.StatusNotModified was returned.
  32593. func (c *OrdersListCall) Do(opts ...googleapi.CallOption) (*OrdersListResponse, error) {
  32594. gensupport.SetOptions(c.urlParams_, opts...)
  32595. res, err := c.doRequest("json")
  32596. if res != nil && res.StatusCode == http.StatusNotModified {
  32597. if res.Body != nil {
  32598. res.Body.Close()
  32599. }
  32600. return nil, &googleapi.Error{
  32601. Code: res.StatusCode,
  32602. Header: res.Header,
  32603. }
  32604. }
  32605. if err != nil {
  32606. return nil, err
  32607. }
  32608. defer googleapi.CloseBody(res)
  32609. if err := googleapi.CheckResponse(res); err != nil {
  32610. return nil, err
  32611. }
  32612. ret := &OrdersListResponse{
  32613. ServerResponse: googleapi.ServerResponse{
  32614. Header: res.Header,
  32615. HTTPStatusCode: res.StatusCode,
  32616. },
  32617. }
  32618. target := &ret
  32619. if err := gensupport.DecodeResponse(target, res); err != nil {
  32620. return nil, err
  32621. }
  32622. return ret, nil
  32623. // {
  32624. // "description": "Retrieves a list of orders, possibly filtered. This method supports paging.",
  32625. // "httpMethod": "GET",
  32626. // "id": "dfareporting.orders.list",
  32627. // "parameterOrder": [
  32628. // "profileId",
  32629. // "projectId"
  32630. // ],
  32631. // "parameters": {
  32632. // "ids": {
  32633. // "description": "Select only orders with these IDs.",
  32634. // "format": "int64",
  32635. // "location": "query",
  32636. // "repeated": true,
  32637. // "type": "string"
  32638. // },
  32639. // "maxResults": {
  32640. // "default": "1000",
  32641. // "description": "Maximum number of results to return.",
  32642. // "format": "int32",
  32643. // "location": "query",
  32644. // "maximum": "1000",
  32645. // "minimum": "0",
  32646. // "type": "integer"
  32647. // },
  32648. // "pageToken": {
  32649. // "description": "Value of the nextPageToken from the previous result page.",
  32650. // "location": "query",
  32651. // "type": "string"
  32652. // },
  32653. // "profileId": {
  32654. // "description": "User profile ID associated with this request.",
  32655. // "format": "int64",
  32656. // "location": "path",
  32657. // "required": true,
  32658. // "type": "string"
  32659. // },
  32660. // "projectId": {
  32661. // "description": "Project ID for orders.",
  32662. // "format": "int64",
  32663. // "location": "path",
  32664. // "required": true,
  32665. // "type": "string"
  32666. // },
  32667. // "searchString": {
  32668. // "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\".",
  32669. // "location": "query",
  32670. // "type": "string"
  32671. // },
  32672. // "siteId": {
  32673. // "description": "Select only orders that are associated with these site IDs.",
  32674. // "format": "int64",
  32675. // "location": "query",
  32676. // "repeated": true,
  32677. // "type": "string"
  32678. // },
  32679. // "sortField": {
  32680. // "default": "ID",
  32681. // "description": "Field by which to sort the list.",
  32682. // "enum": [
  32683. // "ID",
  32684. // "NAME"
  32685. // ],
  32686. // "enumDescriptions": [
  32687. // "",
  32688. // ""
  32689. // ],
  32690. // "location": "query",
  32691. // "type": "string"
  32692. // },
  32693. // "sortOrder": {
  32694. // "default": "ASCENDING",
  32695. // "description": "Order of sorted results.",
  32696. // "enum": [
  32697. // "ASCENDING",
  32698. // "DESCENDING"
  32699. // ],
  32700. // "enumDescriptions": [
  32701. // "",
  32702. // ""
  32703. // ],
  32704. // "location": "query",
  32705. // "type": "string"
  32706. // }
  32707. // },
  32708. // "path": "userprofiles/{profileId}/projects/{projectId}/orders",
  32709. // "response": {
  32710. // "$ref": "OrdersListResponse"
  32711. // },
  32712. // "scopes": [
  32713. // "https://www.googleapis.com/auth/dfatrafficking"
  32714. // ]
  32715. // }
  32716. }
  32717. // Pages invokes f for each page of results.
  32718. // A non-nil error returned from f will halt the iteration.
  32719. // The provided context supersedes any context provided to the Context method.
  32720. func (c *OrdersListCall) Pages(ctx context.Context, f func(*OrdersListResponse) error) error {
  32721. c.ctx_ = ctx
  32722. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  32723. for {
  32724. x, err := c.Do()
  32725. if err != nil {
  32726. return err
  32727. }
  32728. if err := f(x); err != nil {
  32729. return err
  32730. }
  32731. if x.NextPageToken == "" {
  32732. return nil
  32733. }
  32734. c.PageToken(x.NextPageToken)
  32735. }
  32736. }
  32737. // method id "dfareporting.placementGroups.get":
  32738. type PlacementGroupsGetCall struct {
  32739. s *Service
  32740. profileId int64
  32741. id int64
  32742. urlParams_ gensupport.URLParams
  32743. ifNoneMatch_ string
  32744. ctx_ context.Context
  32745. header_ http.Header
  32746. }
  32747. // Get: Gets one placement group by ID.
  32748. func (r *PlacementGroupsService) Get(profileId int64, id int64) *PlacementGroupsGetCall {
  32749. c := &PlacementGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32750. c.profileId = profileId
  32751. c.id = id
  32752. return c
  32753. }
  32754. // Fields allows partial responses to be retrieved. See
  32755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32756. // for more information.
  32757. func (c *PlacementGroupsGetCall) Fields(s ...googleapi.Field) *PlacementGroupsGetCall {
  32758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32759. return c
  32760. }
  32761. // IfNoneMatch sets the optional parameter which makes the operation
  32762. // fail if the object's ETag matches the given value. This is useful for
  32763. // getting updates only after the object has changed since the last
  32764. // request. Use googleapi.IsNotModified to check whether the response
  32765. // error from Do is the result of In-None-Match.
  32766. func (c *PlacementGroupsGetCall) IfNoneMatch(entityTag string) *PlacementGroupsGetCall {
  32767. c.ifNoneMatch_ = entityTag
  32768. return c
  32769. }
  32770. // Context sets the context to be used in this call's Do method. Any
  32771. // pending HTTP request will be aborted if the provided context is
  32772. // canceled.
  32773. func (c *PlacementGroupsGetCall) Context(ctx context.Context) *PlacementGroupsGetCall {
  32774. c.ctx_ = ctx
  32775. return c
  32776. }
  32777. // Header returns an http.Header that can be modified by the caller to
  32778. // add HTTP headers to the request.
  32779. func (c *PlacementGroupsGetCall) Header() http.Header {
  32780. if c.header_ == nil {
  32781. c.header_ = make(http.Header)
  32782. }
  32783. return c.header_
  32784. }
  32785. func (c *PlacementGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  32786. reqHeaders := make(http.Header)
  32787. for k, v := range c.header_ {
  32788. reqHeaders[k] = v
  32789. }
  32790. reqHeaders.Set("User-Agent", c.s.userAgent())
  32791. if c.ifNoneMatch_ != "" {
  32792. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  32793. }
  32794. var body io.Reader = nil
  32795. c.urlParams_.Set("alt", alt)
  32796. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups/{id}")
  32797. urls += "?" + c.urlParams_.Encode()
  32798. req, _ := http.NewRequest("GET", urls, body)
  32799. req.Header = reqHeaders
  32800. googleapi.Expand(req.URL, map[string]string{
  32801. "profileId": strconv.FormatInt(c.profileId, 10),
  32802. "id": strconv.FormatInt(c.id, 10),
  32803. })
  32804. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32805. }
  32806. // Do executes the "dfareporting.placementGroups.get" call.
  32807. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  32808. // status code is an error. Response headers are in either
  32809. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  32810. // at all) in error.(*googleapi.Error).Header. Use
  32811. // googleapi.IsNotModified to check whether the returned error was
  32812. // because http.StatusNotModified was returned.
  32813. func (c *PlacementGroupsGetCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  32814. gensupport.SetOptions(c.urlParams_, opts...)
  32815. res, err := c.doRequest("json")
  32816. if res != nil && res.StatusCode == http.StatusNotModified {
  32817. if res.Body != nil {
  32818. res.Body.Close()
  32819. }
  32820. return nil, &googleapi.Error{
  32821. Code: res.StatusCode,
  32822. Header: res.Header,
  32823. }
  32824. }
  32825. if err != nil {
  32826. return nil, err
  32827. }
  32828. defer googleapi.CloseBody(res)
  32829. if err := googleapi.CheckResponse(res); err != nil {
  32830. return nil, err
  32831. }
  32832. ret := &PlacementGroup{
  32833. ServerResponse: googleapi.ServerResponse{
  32834. Header: res.Header,
  32835. HTTPStatusCode: res.StatusCode,
  32836. },
  32837. }
  32838. target := &ret
  32839. if err := gensupport.DecodeResponse(target, res); err != nil {
  32840. return nil, err
  32841. }
  32842. return ret, nil
  32843. // {
  32844. // "description": "Gets one placement group by ID.",
  32845. // "httpMethod": "GET",
  32846. // "id": "dfareporting.placementGroups.get",
  32847. // "parameterOrder": [
  32848. // "profileId",
  32849. // "id"
  32850. // ],
  32851. // "parameters": {
  32852. // "id": {
  32853. // "description": "Placement group ID.",
  32854. // "format": "int64",
  32855. // "location": "path",
  32856. // "required": true,
  32857. // "type": "string"
  32858. // },
  32859. // "profileId": {
  32860. // "description": "User profile ID associated with this request.",
  32861. // "format": "int64",
  32862. // "location": "path",
  32863. // "required": true,
  32864. // "type": "string"
  32865. // }
  32866. // },
  32867. // "path": "userprofiles/{profileId}/placementGroups/{id}",
  32868. // "response": {
  32869. // "$ref": "PlacementGroup"
  32870. // },
  32871. // "scopes": [
  32872. // "https://www.googleapis.com/auth/dfatrafficking"
  32873. // ]
  32874. // }
  32875. }
  32876. // method id "dfareporting.placementGroups.insert":
  32877. type PlacementGroupsInsertCall struct {
  32878. s *Service
  32879. profileId int64
  32880. placementgroup *PlacementGroup
  32881. urlParams_ gensupport.URLParams
  32882. ctx_ context.Context
  32883. header_ http.Header
  32884. }
  32885. // Insert: Inserts a new placement group.
  32886. func (r *PlacementGroupsService) Insert(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsInsertCall {
  32887. c := &PlacementGroupsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  32888. c.profileId = profileId
  32889. c.placementgroup = placementgroup
  32890. return c
  32891. }
  32892. // Fields allows partial responses to be retrieved. See
  32893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  32894. // for more information.
  32895. func (c *PlacementGroupsInsertCall) Fields(s ...googleapi.Field) *PlacementGroupsInsertCall {
  32896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  32897. return c
  32898. }
  32899. // Context sets the context to be used in this call's Do method. Any
  32900. // pending HTTP request will be aborted if the provided context is
  32901. // canceled.
  32902. func (c *PlacementGroupsInsertCall) Context(ctx context.Context) *PlacementGroupsInsertCall {
  32903. c.ctx_ = ctx
  32904. return c
  32905. }
  32906. // Header returns an http.Header that can be modified by the caller to
  32907. // add HTTP headers to the request.
  32908. func (c *PlacementGroupsInsertCall) Header() http.Header {
  32909. if c.header_ == nil {
  32910. c.header_ = make(http.Header)
  32911. }
  32912. return c.header_
  32913. }
  32914. func (c *PlacementGroupsInsertCall) doRequest(alt string) (*http.Response, error) {
  32915. reqHeaders := make(http.Header)
  32916. for k, v := range c.header_ {
  32917. reqHeaders[k] = v
  32918. }
  32919. reqHeaders.Set("User-Agent", c.s.userAgent())
  32920. var body io.Reader = nil
  32921. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  32922. if err != nil {
  32923. return nil, err
  32924. }
  32925. reqHeaders.Set("Content-Type", "application/json")
  32926. c.urlParams_.Set("alt", alt)
  32927. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  32928. urls += "?" + c.urlParams_.Encode()
  32929. req, _ := http.NewRequest("POST", urls, body)
  32930. req.Header = reqHeaders
  32931. googleapi.Expand(req.URL, map[string]string{
  32932. "profileId": strconv.FormatInt(c.profileId, 10),
  32933. })
  32934. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  32935. }
  32936. // Do executes the "dfareporting.placementGroups.insert" call.
  32937. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  32938. // status code is an error. Response headers are in either
  32939. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  32940. // at all) in error.(*googleapi.Error).Header. Use
  32941. // googleapi.IsNotModified to check whether the returned error was
  32942. // because http.StatusNotModified was returned.
  32943. func (c *PlacementGroupsInsertCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  32944. gensupport.SetOptions(c.urlParams_, opts...)
  32945. res, err := c.doRequest("json")
  32946. if res != nil && res.StatusCode == http.StatusNotModified {
  32947. if res.Body != nil {
  32948. res.Body.Close()
  32949. }
  32950. return nil, &googleapi.Error{
  32951. Code: res.StatusCode,
  32952. Header: res.Header,
  32953. }
  32954. }
  32955. if err != nil {
  32956. return nil, err
  32957. }
  32958. defer googleapi.CloseBody(res)
  32959. if err := googleapi.CheckResponse(res); err != nil {
  32960. return nil, err
  32961. }
  32962. ret := &PlacementGroup{
  32963. ServerResponse: googleapi.ServerResponse{
  32964. Header: res.Header,
  32965. HTTPStatusCode: res.StatusCode,
  32966. },
  32967. }
  32968. target := &ret
  32969. if err := gensupport.DecodeResponse(target, res); err != nil {
  32970. return nil, err
  32971. }
  32972. return ret, nil
  32973. // {
  32974. // "description": "Inserts a new placement group.",
  32975. // "httpMethod": "POST",
  32976. // "id": "dfareporting.placementGroups.insert",
  32977. // "parameterOrder": [
  32978. // "profileId"
  32979. // ],
  32980. // "parameters": {
  32981. // "profileId": {
  32982. // "description": "User profile ID associated with this request.",
  32983. // "format": "int64",
  32984. // "location": "path",
  32985. // "required": true,
  32986. // "type": "string"
  32987. // }
  32988. // },
  32989. // "path": "userprofiles/{profileId}/placementGroups",
  32990. // "request": {
  32991. // "$ref": "PlacementGroup"
  32992. // },
  32993. // "response": {
  32994. // "$ref": "PlacementGroup"
  32995. // },
  32996. // "scopes": [
  32997. // "https://www.googleapis.com/auth/dfatrafficking"
  32998. // ]
  32999. // }
  33000. }
  33001. // method id "dfareporting.placementGroups.list":
  33002. type PlacementGroupsListCall struct {
  33003. s *Service
  33004. profileId int64
  33005. urlParams_ gensupport.URLParams
  33006. ifNoneMatch_ string
  33007. ctx_ context.Context
  33008. header_ http.Header
  33009. }
  33010. // List: Retrieves a list of placement groups, possibly filtered. This
  33011. // method supports paging.
  33012. func (r *PlacementGroupsService) List(profileId int64) *PlacementGroupsListCall {
  33013. c := &PlacementGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33014. c.profileId = profileId
  33015. return c
  33016. }
  33017. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  33018. // only placement groups that belong to these advertisers.
  33019. func (c *PlacementGroupsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementGroupsListCall {
  33020. var advertiserIds_ []string
  33021. for _, v := range advertiserIds {
  33022. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  33023. }
  33024. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  33025. return c
  33026. }
  33027. // Archived sets the optional parameter "archived": Select only archived
  33028. // placements. Don't set this field to select both archived and
  33029. // non-archived placements.
  33030. func (c *PlacementGroupsListCall) Archived(archived bool) *PlacementGroupsListCall {
  33031. c.urlParams_.Set("archived", fmt.Sprint(archived))
  33032. return c
  33033. }
  33034. // CampaignIds sets the optional parameter "campaignIds": Select only
  33035. // placement groups that belong to these campaigns.
  33036. func (c *PlacementGroupsListCall) CampaignIds(campaignIds ...int64) *PlacementGroupsListCall {
  33037. var campaignIds_ []string
  33038. for _, v := range campaignIds {
  33039. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  33040. }
  33041. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  33042. return c
  33043. }
  33044. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  33045. // Select only placement groups that are associated with these content
  33046. // categories.
  33047. func (c *PlacementGroupsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementGroupsListCall {
  33048. var contentCategoryIds_ []string
  33049. for _, v := range contentCategoryIds {
  33050. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  33051. }
  33052. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  33053. return c
  33054. }
  33055. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  33056. // Select only placement groups that are associated with these directory
  33057. // sites.
  33058. func (c *PlacementGroupsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementGroupsListCall {
  33059. var directorySiteIds_ []string
  33060. for _, v := range directorySiteIds {
  33061. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  33062. }
  33063. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  33064. return c
  33065. }
  33066. // Ids sets the optional parameter "ids": Select only placement groups
  33067. // with these IDs.
  33068. func (c *PlacementGroupsListCall) Ids(ids ...int64) *PlacementGroupsListCall {
  33069. var ids_ []string
  33070. for _, v := range ids {
  33071. ids_ = append(ids_, fmt.Sprint(v))
  33072. }
  33073. c.urlParams_.SetMulti("ids", ids_)
  33074. return c
  33075. }
  33076. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  33077. // placements or placement groups whose end date is on or before the
  33078. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  33079. func (c *PlacementGroupsListCall) MaxEndDate(maxEndDate string) *PlacementGroupsListCall {
  33080. c.urlParams_.Set("maxEndDate", maxEndDate)
  33081. return c
  33082. }
  33083. // MaxResults sets the optional parameter "maxResults": Maximum number
  33084. // of results to return.
  33085. func (c *PlacementGroupsListCall) MaxResults(maxResults int64) *PlacementGroupsListCall {
  33086. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  33087. return c
  33088. }
  33089. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  33090. // placements or placement groups whose start date is on or before the
  33091. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  33092. func (c *PlacementGroupsListCall) MaxStartDate(maxStartDate string) *PlacementGroupsListCall {
  33093. c.urlParams_.Set("maxStartDate", maxStartDate)
  33094. return c
  33095. }
  33096. // MinEndDate sets the optional parameter "minEndDate": Select only
  33097. // placements or placement groups whose end date is on or after the
  33098. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  33099. func (c *PlacementGroupsListCall) MinEndDate(minEndDate string) *PlacementGroupsListCall {
  33100. c.urlParams_.Set("minEndDate", minEndDate)
  33101. return c
  33102. }
  33103. // MinStartDate sets the optional parameter "minStartDate": Select only
  33104. // placements or placement groups whose start date is on or after the
  33105. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  33106. func (c *PlacementGroupsListCall) MinStartDate(minStartDate string) *PlacementGroupsListCall {
  33107. c.urlParams_.Set("minStartDate", minStartDate)
  33108. return c
  33109. }
  33110. // PageToken sets the optional parameter "pageToken": Value of the
  33111. // nextPageToken from the previous result page.
  33112. func (c *PlacementGroupsListCall) PageToken(pageToken string) *PlacementGroupsListCall {
  33113. c.urlParams_.Set("pageToken", pageToken)
  33114. return c
  33115. }
  33116. // PlacementGroupType sets the optional parameter "placementGroupType":
  33117. // Select only placement groups belonging with this group type. A
  33118. // package is a simple group of placements that acts as a single pricing
  33119. // point for a group of tags. A roadblock is a group of placements that
  33120. // not only acts as a single pricing point but also assumes that all the
  33121. // tags in it will be served at the same time. A roadblock requires one
  33122. // of its assigned placements to be marked as primary for reporting.
  33123. //
  33124. // Possible values:
  33125. // "PLACEMENT_PACKAGE"
  33126. // "PLACEMENT_ROADBLOCK"
  33127. func (c *PlacementGroupsListCall) PlacementGroupType(placementGroupType string) *PlacementGroupsListCall {
  33128. c.urlParams_.Set("placementGroupType", placementGroupType)
  33129. return c
  33130. }
  33131. // PlacementStrategyIds sets the optional parameter
  33132. // "placementStrategyIds": Select only placement groups that are
  33133. // associated with these placement strategies.
  33134. func (c *PlacementGroupsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementGroupsListCall {
  33135. var placementStrategyIds_ []string
  33136. for _, v := range placementStrategyIds {
  33137. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  33138. }
  33139. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  33140. return c
  33141. }
  33142. // PricingTypes sets the optional parameter "pricingTypes": Select only
  33143. // placement groups with these pricing types.
  33144. //
  33145. // Possible values:
  33146. // "PRICING_TYPE_CPA"
  33147. // "PRICING_TYPE_CPC"
  33148. // "PRICING_TYPE_CPM"
  33149. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  33150. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  33151. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  33152. func (c *PlacementGroupsListCall) PricingTypes(pricingTypes ...string) *PlacementGroupsListCall {
  33153. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  33154. return c
  33155. }
  33156. // SearchString sets the optional parameter "searchString": Allows
  33157. // searching for placement groups by name or ID. Wildcards (*) are
  33158. // allowed. For example, "placement*2015" will return placement groups
  33159. // with names like "placement group June 2015", "placement group May
  33160. // 2015", or simply "placements 2015". Most of the searches also add
  33161. // wildcards implicitly at the start and the end of the search string.
  33162. // For example, a search string of "placementgroup" will match placement
  33163. // groups with name "my placementgroup", "placementgroup 2015", or
  33164. // simply "placementgroup".
  33165. func (c *PlacementGroupsListCall) SearchString(searchString string) *PlacementGroupsListCall {
  33166. c.urlParams_.Set("searchString", searchString)
  33167. return c
  33168. }
  33169. // SiteIds sets the optional parameter "siteIds": Select only placement
  33170. // groups that are associated with these sites.
  33171. func (c *PlacementGroupsListCall) SiteIds(siteIds ...int64) *PlacementGroupsListCall {
  33172. var siteIds_ []string
  33173. for _, v := range siteIds {
  33174. siteIds_ = append(siteIds_, fmt.Sprint(v))
  33175. }
  33176. c.urlParams_.SetMulti("siteIds", siteIds_)
  33177. return c
  33178. }
  33179. // SortField sets the optional parameter "sortField": Field by which to
  33180. // sort the list.
  33181. //
  33182. // Possible values:
  33183. // "ID" (default)
  33184. // "NAME"
  33185. func (c *PlacementGroupsListCall) SortField(sortField string) *PlacementGroupsListCall {
  33186. c.urlParams_.Set("sortField", sortField)
  33187. return c
  33188. }
  33189. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  33190. // results.
  33191. //
  33192. // Possible values:
  33193. // "ASCENDING" (default)
  33194. // "DESCENDING"
  33195. func (c *PlacementGroupsListCall) SortOrder(sortOrder string) *PlacementGroupsListCall {
  33196. c.urlParams_.Set("sortOrder", sortOrder)
  33197. return c
  33198. }
  33199. // Fields allows partial responses to be retrieved. See
  33200. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33201. // for more information.
  33202. func (c *PlacementGroupsListCall) Fields(s ...googleapi.Field) *PlacementGroupsListCall {
  33203. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33204. return c
  33205. }
  33206. // IfNoneMatch sets the optional parameter which makes the operation
  33207. // fail if the object's ETag matches the given value. This is useful for
  33208. // getting updates only after the object has changed since the last
  33209. // request. Use googleapi.IsNotModified to check whether the response
  33210. // error from Do is the result of In-None-Match.
  33211. func (c *PlacementGroupsListCall) IfNoneMatch(entityTag string) *PlacementGroupsListCall {
  33212. c.ifNoneMatch_ = entityTag
  33213. return c
  33214. }
  33215. // Context sets the context to be used in this call's Do method. Any
  33216. // pending HTTP request will be aborted if the provided context is
  33217. // canceled.
  33218. func (c *PlacementGroupsListCall) Context(ctx context.Context) *PlacementGroupsListCall {
  33219. c.ctx_ = ctx
  33220. return c
  33221. }
  33222. // Header returns an http.Header that can be modified by the caller to
  33223. // add HTTP headers to the request.
  33224. func (c *PlacementGroupsListCall) Header() http.Header {
  33225. if c.header_ == nil {
  33226. c.header_ = make(http.Header)
  33227. }
  33228. return c.header_
  33229. }
  33230. func (c *PlacementGroupsListCall) doRequest(alt string) (*http.Response, error) {
  33231. reqHeaders := make(http.Header)
  33232. for k, v := range c.header_ {
  33233. reqHeaders[k] = v
  33234. }
  33235. reqHeaders.Set("User-Agent", c.s.userAgent())
  33236. if c.ifNoneMatch_ != "" {
  33237. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33238. }
  33239. var body io.Reader = nil
  33240. c.urlParams_.Set("alt", alt)
  33241. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33242. urls += "?" + c.urlParams_.Encode()
  33243. req, _ := http.NewRequest("GET", urls, body)
  33244. req.Header = reqHeaders
  33245. googleapi.Expand(req.URL, map[string]string{
  33246. "profileId": strconv.FormatInt(c.profileId, 10),
  33247. })
  33248. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33249. }
  33250. // Do executes the "dfareporting.placementGroups.list" call.
  33251. // Exactly one of *PlacementGroupsListResponse or error will be non-nil.
  33252. // Any non-2xx status code is an error. Response headers are in either
  33253. // *PlacementGroupsListResponse.ServerResponse.Header or (if a response
  33254. // was returned at all) in error.(*googleapi.Error).Header. Use
  33255. // googleapi.IsNotModified to check whether the returned error was
  33256. // because http.StatusNotModified was returned.
  33257. func (c *PlacementGroupsListCall) Do(opts ...googleapi.CallOption) (*PlacementGroupsListResponse, error) {
  33258. gensupport.SetOptions(c.urlParams_, opts...)
  33259. res, err := c.doRequest("json")
  33260. if res != nil && res.StatusCode == http.StatusNotModified {
  33261. if res.Body != nil {
  33262. res.Body.Close()
  33263. }
  33264. return nil, &googleapi.Error{
  33265. Code: res.StatusCode,
  33266. Header: res.Header,
  33267. }
  33268. }
  33269. if err != nil {
  33270. return nil, err
  33271. }
  33272. defer googleapi.CloseBody(res)
  33273. if err := googleapi.CheckResponse(res); err != nil {
  33274. return nil, err
  33275. }
  33276. ret := &PlacementGroupsListResponse{
  33277. ServerResponse: googleapi.ServerResponse{
  33278. Header: res.Header,
  33279. HTTPStatusCode: res.StatusCode,
  33280. },
  33281. }
  33282. target := &ret
  33283. if err := gensupport.DecodeResponse(target, res); err != nil {
  33284. return nil, err
  33285. }
  33286. return ret, nil
  33287. // {
  33288. // "description": "Retrieves a list of placement groups, possibly filtered. This method supports paging.",
  33289. // "httpMethod": "GET",
  33290. // "id": "dfareporting.placementGroups.list",
  33291. // "parameterOrder": [
  33292. // "profileId"
  33293. // ],
  33294. // "parameters": {
  33295. // "advertiserIds": {
  33296. // "description": "Select only placement groups that belong to these advertisers.",
  33297. // "format": "int64",
  33298. // "location": "query",
  33299. // "repeated": true,
  33300. // "type": "string"
  33301. // },
  33302. // "archived": {
  33303. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  33304. // "location": "query",
  33305. // "type": "boolean"
  33306. // },
  33307. // "campaignIds": {
  33308. // "description": "Select only placement groups that belong to these campaigns.",
  33309. // "format": "int64",
  33310. // "location": "query",
  33311. // "repeated": true,
  33312. // "type": "string"
  33313. // },
  33314. // "contentCategoryIds": {
  33315. // "description": "Select only placement groups that are associated with these content categories.",
  33316. // "format": "int64",
  33317. // "location": "query",
  33318. // "repeated": true,
  33319. // "type": "string"
  33320. // },
  33321. // "directorySiteIds": {
  33322. // "description": "Select only placement groups that are associated with these directory sites.",
  33323. // "format": "int64",
  33324. // "location": "query",
  33325. // "repeated": true,
  33326. // "type": "string"
  33327. // },
  33328. // "ids": {
  33329. // "description": "Select only placement groups with these IDs.",
  33330. // "format": "int64",
  33331. // "location": "query",
  33332. // "repeated": true,
  33333. // "type": "string"
  33334. // },
  33335. // "maxEndDate": {
  33336. // "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\".",
  33337. // "location": "query",
  33338. // "type": "string"
  33339. // },
  33340. // "maxResults": {
  33341. // "default": "800",
  33342. // "description": "Maximum number of results to return.",
  33343. // "format": "int32",
  33344. // "location": "query",
  33345. // "maximum": "800",
  33346. // "minimum": "0",
  33347. // "type": "integer"
  33348. // },
  33349. // "maxStartDate": {
  33350. // "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\".",
  33351. // "location": "query",
  33352. // "type": "string"
  33353. // },
  33354. // "minEndDate": {
  33355. // "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\".",
  33356. // "location": "query",
  33357. // "type": "string"
  33358. // },
  33359. // "minStartDate": {
  33360. // "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\".",
  33361. // "location": "query",
  33362. // "type": "string"
  33363. // },
  33364. // "pageToken": {
  33365. // "description": "Value of the nextPageToken from the previous result page.",
  33366. // "location": "query",
  33367. // "type": "string"
  33368. // },
  33369. // "placementGroupType": {
  33370. // "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.",
  33371. // "enum": [
  33372. // "PLACEMENT_PACKAGE",
  33373. // "PLACEMENT_ROADBLOCK"
  33374. // ],
  33375. // "enumDescriptions": [
  33376. // "",
  33377. // ""
  33378. // ],
  33379. // "location": "query",
  33380. // "type": "string"
  33381. // },
  33382. // "placementStrategyIds": {
  33383. // "description": "Select only placement groups that are associated with these placement strategies.",
  33384. // "format": "int64",
  33385. // "location": "query",
  33386. // "repeated": true,
  33387. // "type": "string"
  33388. // },
  33389. // "pricingTypes": {
  33390. // "description": "Select only placement groups with these pricing types.",
  33391. // "enum": [
  33392. // "PRICING_TYPE_CPA",
  33393. // "PRICING_TYPE_CPC",
  33394. // "PRICING_TYPE_CPM",
  33395. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  33396. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  33397. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  33398. // ],
  33399. // "enumDescriptions": [
  33400. // "",
  33401. // "",
  33402. // "",
  33403. // "",
  33404. // "",
  33405. // ""
  33406. // ],
  33407. // "location": "query",
  33408. // "repeated": true,
  33409. // "type": "string"
  33410. // },
  33411. // "profileId": {
  33412. // "description": "User profile ID associated with this request.",
  33413. // "format": "int64",
  33414. // "location": "path",
  33415. // "required": true,
  33416. // "type": "string"
  33417. // },
  33418. // "searchString": {
  33419. // "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\".",
  33420. // "location": "query",
  33421. // "type": "string"
  33422. // },
  33423. // "siteIds": {
  33424. // "description": "Select only placement groups that are associated with these sites.",
  33425. // "format": "int64",
  33426. // "location": "query",
  33427. // "repeated": true,
  33428. // "type": "string"
  33429. // },
  33430. // "sortField": {
  33431. // "default": "ID",
  33432. // "description": "Field by which to sort the list.",
  33433. // "enum": [
  33434. // "ID",
  33435. // "NAME"
  33436. // ],
  33437. // "enumDescriptions": [
  33438. // "",
  33439. // ""
  33440. // ],
  33441. // "location": "query",
  33442. // "type": "string"
  33443. // },
  33444. // "sortOrder": {
  33445. // "default": "ASCENDING",
  33446. // "description": "Order of sorted results.",
  33447. // "enum": [
  33448. // "ASCENDING",
  33449. // "DESCENDING"
  33450. // ],
  33451. // "enumDescriptions": [
  33452. // "",
  33453. // ""
  33454. // ],
  33455. // "location": "query",
  33456. // "type": "string"
  33457. // }
  33458. // },
  33459. // "path": "userprofiles/{profileId}/placementGroups",
  33460. // "response": {
  33461. // "$ref": "PlacementGroupsListResponse"
  33462. // },
  33463. // "scopes": [
  33464. // "https://www.googleapis.com/auth/dfatrafficking"
  33465. // ]
  33466. // }
  33467. }
  33468. // Pages invokes f for each page of results.
  33469. // A non-nil error returned from f will halt the iteration.
  33470. // The provided context supersedes any context provided to the Context method.
  33471. func (c *PlacementGroupsListCall) Pages(ctx context.Context, f func(*PlacementGroupsListResponse) error) error {
  33472. c.ctx_ = ctx
  33473. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  33474. for {
  33475. x, err := c.Do()
  33476. if err != nil {
  33477. return err
  33478. }
  33479. if err := f(x); err != nil {
  33480. return err
  33481. }
  33482. if x.NextPageToken == "" {
  33483. return nil
  33484. }
  33485. c.PageToken(x.NextPageToken)
  33486. }
  33487. }
  33488. // method id "dfareporting.placementGroups.patch":
  33489. type PlacementGroupsPatchCall struct {
  33490. s *Service
  33491. profileId int64
  33492. placementgroup *PlacementGroup
  33493. urlParams_ gensupport.URLParams
  33494. ctx_ context.Context
  33495. header_ http.Header
  33496. }
  33497. // Patch: Updates an existing placement group. This method supports
  33498. // patch semantics.
  33499. func (r *PlacementGroupsService) Patch(profileId int64, id int64, placementgroup *PlacementGroup) *PlacementGroupsPatchCall {
  33500. c := &PlacementGroupsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33501. c.profileId = profileId
  33502. c.urlParams_.Set("id", fmt.Sprint(id))
  33503. c.placementgroup = placementgroup
  33504. return c
  33505. }
  33506. // Fields allows partial responses to be retrieved. See
  33507. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33508. // for more information.
  33509. func (c *PlacementGroupsPatchCall) Fields(s ...googleapi.Field) *PlacementGroupsPatchCall {
  33510. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33511. return c
  33512. }
  33513. // Context sets the context to be used in this call's Do method. Any
  33514. // pending HTTP request will be aborted if the provided context is
  33515. // canceled.
  33516. func (c *PlacementGroupsPatchCall) Context(ctx context.Context) *PlacementGroupsPatchCall {
  33517. c.ctx_ = ctx
  33518. return c
  33519. }
  33520. // Header returns an http.Header that can be modified by the caller to
  33521. // add HTTP headers to the request.
  33522. func (c *PlacementGroupsPatchCall) Header() http.Header {
  33523. if c.header_ == nil {
  33524. c.header_ = make(http.Header)
  33525. }
  33526. return c.header_
  33527. }
  33528. func (c *PlacementGroupsPatchCall) doRequest(alt string) (*http.Response, error) {
  33529. reqHeaders := make(http.Header)
  33530. for k, v := range c.header_ {
  33531. reqHeaders[k] = v
  33532. }
  33533. reqHeaders.Set("User-Agent", c.s.userAgent())
  33534. var body io.Reader = nil
  33535. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  33536. if err != nil {
  33537. return nil, err
  33538. }
  33539. reqHeaders.Set("Content-Type", "application/json")
  33540. c.urlParams_.Set("alt", alt)
  33541. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33542. urls += "?" + c.urlParams_.Encode()
  33543. req, _ := http.NewRequest("PATCH", urls, body)
  33544. req.Header = reqHeaders
  33545. googleapi.Expand(req.URL, map[string]string{
  33546. "profileId": strconv.FormatInt(c.profileId, 10),
  33547. })
  33548. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33549. }
  33550. // Do executes the "dfareporting.placementGroups.patch" call.
  33551. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33552. // status code is an error. Response headers are in either
  33553. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33554. // at all) in error.(*googleapi.Error).Header. Use
  33555. // googleapi.IsNotModified to check whether the returned error was
  33556. // because http.StatusNotModified was returned.
  33557. func (c *PlacementGroupsPatchCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33558. gensupport.SetOptions(c.urlParams_, opts...)
  33559. res, err := c.doRequest("json")
  33560. if res != nil && res.StatusCode == http.StatusNotModified {
  33561. if res.Body != nil {
  33562. res.Body.Close()
  33563. }
  33564. return nil, &googleapi.Error{
  33565. Code: res.StatusCode,
  33566. Header: res.Header,
  33567. }
  33568. }
  33569. if err != nil {
  33570. return nil, err
  33571. }
  33572. defer googleapi.CloseBody(res)
  33573. if err := googleapi.CheckResponse(res); err != nil {
  33574. return nil, err
  33575. }
  33576. ret := &PlacementGroup{
  33577. ServerResponse: googleapi.ServerResponse{
  33578. Header: res.Header,
  33579. HTTPStatusCode: res.StatusCode,
  33580. },
  33581. }
  33582. target := &ret
  33583. if err := gensupport.DecodeResponse(target, res); err != nil {
  33584. return nil, err
  33585. }
  33586. return ret, nil
  33587. // {
  33588. // "description": "Updates an existing placement group. This method supports patch semantics.",
  33589. // "httpMethod": "PATCH",
  33590. // "id": "dfareporting.placementGroups.patch",
  33591. // "parameterOrder": [
  33592. // "profileId",
  33593. // "id"
  33594. // ],
  33595. // "parameters": {
  33596. // "id": {
  33597. // "description": "Placement group ID.",
  33598. // "format": "int64",
  33599. // "location": "query",
  33600. // "required": true,
  33601. // "type": "string"
  33602. // },
  33603. // "profileId": {
  33604. // "description": "User profile ID associated with this request.",
  33605. // "format": "int64",
  33606. // "location": "path",
  33607. // "required": true,
  33608. // "type": "string"
  33609. // }
  33610. // },
  33611. // "path": "userprofiles/{profileId}/placementGroups",
  33612. // "request": {
  33613. // "$ref": "PlacementGroup"
  33614. // },
  33615. // "response": {
  33616. // "$ref": "PlacementGroup"
  33617. // },
  33618. // "scopes": [
  33619. // "https://www.googleapis.com/auth/dfatrafficking"
  33620. // ]
  33621. // }
  33622. }
  33623. // method id "dfareporting.placementGroups.update":
  33624. type PlacementGroupsUpdateCall struct {
  33625. s *Service
  33626. profileId int64
  33627. placementgroup *PlacementGroup
  33628. urlParams_ gensupport.URLParams
  33629. ctx_ context.Context
  33630. header_ http.Header
  33631. }
  33632. // Update: Updates an existing placement group.
  33633. func (r *PlacementGroupsService) Update(profileId int64, placementgroup *PlacementGroup) *PlacementGroupsUpdateCall {
  33634. c := &PlacementGroupsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33635. c.profileId = profileId
  33636. c.placementgroup = placementgroup
  33637. return c
  33638. }
  33639. // Fields allows partial responses to be retrieved. See
  33640. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33641. // for more information.
  33642. func (c *PlacementGroupsUpdateCall) Fields(s ...googleapi.Field) *PlacementGroupsUpdateCall {
  33643. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33644. return c
  33645. }
  33646. // Context sets the context to be used in this call's Do method. Any
  33647. // pending HTTP request will be aborted if the provided context is
  33648. // canceled.
  33649. func (c *PlacementGroupsUpdateCall) Context(ctx context.Context) *PlacementGroupsUpdateCall {
  33650. c.ctx_ = ctx
  33651. return c
  33652. }
  33653. // Header returns an http.Header that can be modified by the caller to
  33654. // add HTTP headers to the request.
  33655. func (c *PlacementGroupsUpdateCall) Header() http.Header {
  33656. if c.header_ == nil {
  33657. c.header_ = make(http.Header)
  33658. }
  33659. return c.header_
  33660. }
  33661. func (c *PlacementGroupsUpdateCall) doRequest(alt string) (*http.Response, error) {
  33662. reqHeaders := make(http.Header)
  33663. for k, v := range c.header_ {
  33664. reqHeaders[k] = v
  33665. }
  33666. reqHeaders.Set("User-Agent", c.s.userAgent())
  33667. var body io.Reader = nil
  33668. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementgroup)
  33669. if err != nil {
  33670. return nil, err
  33671. }
  33672. reqHeaders.Set("Content-Type", "application/json")
  33673. c.urlParams_.Set("alt", alt)
  33674. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementGroups")
  33675. urls += "?" + c.urlParams_.Encode()
  33676. req, _ := http.NewRequest("PUT", urls, body)
  33677. req.Header = reqHeaders
  33678. googleapi.Expand(req.URL, map[string]string{
  33679. "profileId": strconv.FormatInt(c.profileId, 10),
  33680. })
  33681. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33682. }
  33683. // Do executes the "dfareporting.placementGroups.update" call.
  33684. // Exactly one of *PlacementGroup or error will be non-nil. Any non-2xx
  33685. // status code is an error. Response headers are in either
  33686. // *PlacementGroup.ServerResponse.Header or (if a response was returned
  33687. // at all) in error.(*googleapi.Error).Header. Use
  33688. // googleapi.IsNotModified to check whether the returned error was
  33689. // because http.StatusNotModified was returned.
  33690. func (c *PlacementGroupsUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementGroup, error) {
  33691. gensupport.SetOptions(c.urlParams_, opts...)
  33692. res, err := c.doRequest("json")
  33693. if res != nil && res.StatusCode == http.StatusNotModified {
  33694. if res.Body != nil {
  33695. res.Body.Close()
  33696. }
  33697. return nil, &googleapi.Error{
  33698. Code: res.StatusCode,
  33699. Header: res.Header,
  33700. }
  33701. }
  33702. if err != nil {
  33703. return nil, err
  33704. }
  33705. defer googleapi.CloseBody(res)
  33706. if err := googleapi.CheckResponse(res); err != nil {
  33707. return nil, err
  33708. }
  33709. ret := &PlacementGroup{
  33710. ServerResponse: googleapi.ServerResponse{
  33711. Header: res.Header,
  33712. HTTPStatusCode: res.StatusCode,
  33713. },
  33714. }
  33715. target := &ret
  33716. if err := gensupport.DecodeResponse(target, res); err != nil {
  33717. return nil, err
  33718. }
  33719. return ret, nil
  33720. // {
  33721. // "description": "Updates an existing placement group.",
  33722. // "httpMethod": "PUT",
  33723. // "id": "dfareporting.placementGroups.update",
  33724. // "parameterOrder": [
  33725. // "profileId"
  33726. // ],
  33727. // "parameters": {
  33728. // "profileId": {
  33729. // "description": "User profile ID associated with this request.",
  33730. // "format": "int64",
  33731. // "location": "path",
  33732. // "required": true,
  33733. // "type": "string"
  33734. // }
  33735. // },
  33736. // "path": "userprofiles/{profileId}/placementGroups",
  33737. // "request": {
  33738. // "$ref": "PlacementGroup"
  33739. // },
  33740. // "response": {
  33741. // "$ref": "PlacementGroup"
  33742. // },
  33743. // "scopes": [
  33744. // "https://www.googleapis.com/auth/dfatrafficking"
  33745. // ]
  33746. // }
  33747. }
  33748. // method id "dfareporting.placementStrategies.delete":
  33749. type PlacementStrategiesDeleteCall struct {
  33750. s *Service
  33751. profileId int64
  33752. id int64
  33753. urlParams_ gensupport.URLParams
  33754. ctx_ context.Context
  33755. header_ http.Header
  33756. }
  33757. // Delete: Deletes an existing placement strategy.
  33758. func (r *PlacementStrategiesService) Delete(profileId int64, id int64) *PlacementStrategiesDeleteCall {
  33759. c := &PlacementStrategiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33760. c.profileId = profileId
  33761. c.id = id
  33762. return c
  33763. }
  33764. // Fields allows partial responses to be retrieved. See
  33765. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33766. // for more information.
  33767. func (c *PlacementStrategiesDeleteCall) Fields(s ...googleapi.Field) *PlacementStrategiesDeleteCall {
  33768. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33769. return c
  33770. }
  33771. // Context sets the context to be used in this call's Do method. Any
  33772. // pending HTTP request will be aborted if the provided context is
  33773. // canceled.
  33774. func (c *PlacementStrategiesDeleteCall) Context(ctx context.Context) *PlacementStrategiesDeleteCall {
  33775. c.ctx_ = ctx
  33776. return c
  33777. }
  33778. // Header returns an http.Header that can be modified by the caller to
  33779. // add HTTP headers to the request.
  33780. func (c *PlacementStrategiesDeleteCall) Header() http.Header {
  33781. if c.header_ == nil {
  33782. c.header_ = make(http.Header)
  33783. }
  33784. return c.header_
  33785. }
  33786. func (c *PlacementStrategiesDeleteCall) doRequest(alt string) (*http.Response, error) {
  33787. reqHeaders := make(http.Header)
  33788. for k, v := range c.header_ {
  33789. reqHeaders[k] = v
  33790. }
  33791. reqHeaders.Set("User-Agent", c.s.userAgent())
  33792. var body io.Reader = nil
  33793. c.urlParams_.Set("alt", alt)
  33794. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  33795. urls += "?" + c.urlParams_.Encode()
  33796. req, _ := http.NewRequest("DELETE", urls, body)
  33797. req.Header = reqHeaders
  33798. googleapi.Expand(req.URL, map[string]string{
  33799. "profileId": strconv.FormatInt(c.profileId, 10),
  33800. "id": strconv.FormatInt(c.id, 10),
  33801. })
  33802. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33803. }
  33804. // Do executes the "dfareporting.placementStrategies.delete" call.
  33805. func (c *PlacementStrategiesDeleteCall) Do(opts ...googleapi.CallOption) error {
  33806. gensupport.SetOptions(c.urlParams_, opts...)
  33807. res, err := c.doRequest("json")
  33808. if err != nil {
  33809. return err
  33810. }
  33811. defer googleapi.CloseBody(res)
  33812. if err := googleapi.CheckResponse(res); err != nil {
  33813. return err
  33814. }
  33815. return nil
  33816. // {
  33817. // "description": "Deletes an existing placement strategy.",
  33818. // "httpMethod": "DELETE",
  33819. // "id": "dfareporting.placementStrategies.delete",
  33820. // "parameterOrder": [
  33821. // "profileId",
  33822. // "id"
  33823. // ],
  33824. // "parameters": {
  33825. // "id": {
  33826. // "description": "Placement strategy ID.",
  33827. // "format": "int64",
  33828. // "location": "path",
  33829. // "required": true,
  33830. // "type": "string"
  33831. // },
  33832. // "profileId": {
  33833. // "description": "User profile ID associated with this request.",
  33834. // "format": "int64",
  33835. // "location": "path",
  33836. // "required": true,
  33837. // "type": "string"
  33838. // }
  33839. // },
  33840. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  33841. // "scopes": [
  33842. // "https://www.googleapis.com/auth/dfatrafficking"
  33843. // ]
  33844. // }
  33845. }
  33846. // method id "dfareporting.placementStrategies.get":
  33847. type PlacementStrategiesGetCall struct {
  33848. s *Service
  33849. profileId int64
  33850. id int64
  33851. urlParams_ gensupport.URLParams
  33852. ifNoneMatch_ string
  33853. ctx_ context.Context
  33854. header_ http.Header
  33855. }
  33856. // Get: Gets one placement strategy by ID.
  33857. func (r *PlacementStrategiesService) Get(profileId int64, id int64) *PlacementStrategiesGetCall {
  33858. c := &PlacementStrategiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33859. c.profileId = profileId
  33860. c.id = id
  33861. return c
  33862. }
  33863. // Fields allows partial responses to be retrieved. See
  33864. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  33865. // for more information.
  33866. func (c *PlacementStrategiesGetCall) Fields(s ...googleapi.Field) *PlacementStrategiesGetCall {
  33867. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  33868. return c
  33869. }
  33870. // IfNoneMatch sets the optional parameter which makes the operation
  33871. // fail if the object's ETag matches the given value. This is useful for
  33872. // getting updates only after the object has changed since the last
  33873. // request. Use googleapi.IsNotModified to check whether the response
  33874. // error from Do is the result of In-None-Match.
  33875. func (c *PlacementStrategiesGetCall) IfNoneMatch(entityTag string) *PlacementStrategiesGetCall {
  33876. c.ifNoneMatch_ = entityTag
  33877. return c
  33878. }
  33879. // Context sets the context to be used in this call's Do method. Any
  33880. // pending HTTP request will be aborted if the provided context is
  33881. // canceled.
  33882. func (c *PlacementStrategiesGetCall) Context(ctx context.Context) *PlacementStrategiesGetCall {
  33883. c.ctx_ = ctx
  33884. return c
  33885. }
  33886. // Header returns an http.Header that can be modified by the caller to
  33887. // add HTTP headers to the request.
  33888. func (c *PlacementStrategiesGetCall) Header() http.Header {
  33889. if c.header_ == nil {
  33890. c.header_ = make(http.Header)
  33891. }
  33892. return c.header_
  33893. }
  33894. func (c *PlacementStrategiesGetCall) doRequest(alt string) (*http.Response, error) {
  33895. reqHeaders := make(http.Header)
  33896. for k, v := range c.header_ {
  33897. reqHeaders[k] = v
  33898. }
  33899. reqHeaders.Set("User-Agent", c.s.userAgent())
  33900. if c.ifNoneMatch_ != "" {
  33901. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  33902. }
  33903. var body io.Reader = nil
  33904. c.urlParams_.Set("alt", alt)
  33905. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies/{id}")
  33906. urls += "?" + c.urlParams_.Encode()
  33907. req, _ := http.NewRequest("GET", urls, body)
  33908. req.Header = reqHeaders
  33909. googleapi.Expand(req.URL, map[string]string{
  33910. "profileId": strconv.FormatInt(c.profileId, 10),
  33911. "id": strconv.FormatInt(c.id, 10),
  33912. })
  33913. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  33914. }
  33915. // Do executes the "dfareporting.placementStrategies.get" call.
  33916. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  33917. // non-2xx status code is an error. Response headers are in either
  33918. // *PlacementStrategy.ServerResponse.Header or (if a response was
  33919. // returned at all) in error.(*googleapi.Error).Header. Use
  33920. // googleapi.IsNotModified to check whether the returned error was
  33921. // because http.StatusNotModified was returned.
  33922. func (c *PlacementStrategiesGetCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  33923. gensupport.SetOptions(c.urlParams_, opts...)
  33924. res, err := c.doRequest("json")
  33925. if res != nil && res.StatusCode == http.StatusNotModified {
  33926. if res.Body != nil {
  33927. res.Body.Close()
  33928. }
  33929. return nil, &googleapi.Error{
  33930. Code: res.StatusCode,
  33931. Header: res.Header,
  33932. }
  33933. }
  33934. if err != nil {
  33935. return nil, err
  33936. }
  33937. defer googleapi.CloseBody(res)
  33938. if err := googleapi.CheckResponse(res); err != nil {
  33939. return nil, err
  33940. }
  33941. ret := &PlacementStrategy{
  33942. ServerResponse: googleapi.ServerResponse{
  33943. Header: res.Header,
  33944. HTTPStatusCode: res.StatusCode,
  33945. },
  33946. }
  33947. target := &ret
  33948. if err := gensupport.DecodeResponse(target, res); err != nil {
  33949. return nil, err
  33950. }
  33951. return ret, nil
  33952. // {
  33953. // "description": "Gets one placement strategy by ID.",
  33954. // "httpMethod": "GET",
  33955. // "id": "dfareporting.placementStrategies.get",
  33956. // "parameterOrder": [
  33957. // "profileId",
  33958. // "id"
  33959. // ],
  33960. // "parameters": {
  33961. // "id": {
  33962. // "description": "Placement strategy ID.",
  33963. // "format": "int64",
  33964. // "location": "path",
  33965. // "required": true,
  33966. // "type": "string"
  33967. // },
  33968. // "profileId": {
  33969. // "description": "User profile ID associated with this request.",
  33970. // "format": "int64",
  33971. // "location": "path",
  33972. // "required": true,
  33973. // "type": "string"
  33974. // }
  33975. // },
  33976. // "path": "userprofiles/{profileId}/placementStrategies/{id}",
  33977. // "response": {
  33978. // "$ref": "PlacementStrategy"
  33979. // },
  33980. // "scopes": [
  33981. // "https://www.googleapis.com/auth/dfatrafficking"
  33982. // ]
  33983. // }
  33984. }
  33985. // method id "dfareporting.placementStrategies.insert":
  33986. type PlacementStrategiesInsertCall struct {
  33987. s *Service
  33988. profileId int64
  33989. placementstrategy *PlacementStrategy
  33990. urlParams_ gensupport.URLParams
  33991. ctx_ context.Context
  33992. header_ http.Header
  33993. }
  33994. // Insert: Inserts a new placement strategy.
  33995. func (r *PlacementStrategiesService) Insert(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesInsertCall {
  33996. c := &PlacementStrategiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  33997. c.profileId = profileId
  33998. c.placementstrategy = placementstrategy
  33999. return c
  34000. }
  34001. // Fields allows partial responses to be retrieved. See
  34002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34003. // for more information.
  34004. func (c *PlacementStrategiesInsertCall) Fields(s ...googleapi.Field) *PlacementStrategiesInsertCall {
  34005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34006. return c
  34007. }
  34008. // Context sets the context to be used in this call's Do method. Any
  34009. // pending HTTP request will be aborted if the provided context is
  34010. // canceled.
  34011. func (c *PlacementStrategiesInsertCall) Context(ctx context.Context) *PlacementStrategiesInsertCall {
  34012. c.ctx_ = ctx
  34013. return c
  34014. }
  34015. // Header returns an http.Header that can be modified by the caller to
  34016. // add HTTP headers to the request.
  34017. func (c *PlacementStrategiesInsertCall) Header() http.Header {
  34018. if c.header_ == nil {
  34019. c.header_ = make(http.Header)
  34020. }
  34021. return c.header_
  34022. }
  34023. func (c *PlacementStrategiesInsertCall) doRequest(alt string) (*http.Response, error) {
  34024. reqHeaders := make(http.Header)
  34025. for k, v := range c.header_ {
  34026. reqHeaders[k] = v
  34027. }
  34028. reqHeaders.Set("User-Agent", c.s.userAgent())
  34029. var body io.Reader = nil
  34030. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34031. if err != nil {
  34032. return nil, err
  34033. }
  34034. reqHeaders.Set("Content-Type", "application/json")
  34035. c.urlParams_.Set("alt", alt)
  34036. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34037. urls += "?" + c.urlParams_.Encode()
  34038. req, _ := http.NewRequest("POST", urls, body)
  34039. req.Header = reqHeaders
  34040. googleapi.Expand(req.URL, map[string]string{
  34041. "profileId": strconv.FormatInt(c.profileId, 10),
  34042. })
  34043. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34044. }
  34045. // Do executes the "dfareporting.placementStrategies.insert" call.
  34046. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34047. // non-2xx status code is an error. Response headers are in either
  34048. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34049. // returned at all) in error.(*googleapi.Error).Header. Use
  34050. // googleapi.IsNotModified to check whether the returned error was
  34051. // because http.StatusNotModified was returned.
  34052. func (c *PlacementStrategiesInsertCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34053. gensupport.SetOptions(c.urlParams_, opts...)
  34054. res, err := c.doRequest("json")
  34055. if res != nil && res.StatusCode == http.StatusNotModified {
  34056. if res.Body != nil {
  34057. res.Body.Close()
  34058. }
  34059. return nil, &googleapi.Error{
  34060. Code: res.StatusCode,
  34061. Header: res.Header,
  34062. }
  34063. }
  34064. if err != nil {
  34065. return nil, err
  34066. }
  34067. defer googleapi.CloseBody(res)
  34068. if err := googleapi.CheckResponse(res); err != nil {
  34069. return nil, err
  34070. }
  34071. ret := &PlacementStrategy{
  34072. ServerResponse: googleapi.ServerResponse{
  34073. Header: res.Header,
  34074. HTTPStatusCode: res.StatusCode,
  34075. },
  34076. }
  34077. target := &ret
  34078. if err := gensupport.DecodeResponse(target, res); err != nil {
  34079. return nil, err
  34080. }
  34081. return ret, nil
  34082. // {
  34083. // "description": "Inserts a new placement strategy.",
  34084. // "httpMethod": "POST",
  34085. // "id": "dfareporting.placementStrategies.insert",
  34086. // "parameterOrder": [
  34087. // "profileId"
  34088. // ],
  34089. // "parameters": {
  34090. // "profileId": {
  34091. // "description": "User profile ID associated with this request.",
  34092. // "format": "int64",
  34093. // "location": "path",
  34094. // "required": true,
  34095. // "type": "string"
  34096. // }
  34097. // },
  34098. // "path": "userprofiles/{profileId}/placementStrategies",
  34099. // "request": {
  34100. // "$ref": "PlacementStrategy"
  34101. // },
  34102. // "response": {
  34103. // "$ref": "PlacementStrategy"
  34104. // },
  34105. // "scopes": [
  34106. // "https://www.googleapis.com/auth/dfatrafficking"
  34107. // ]
  34108. // }
  34109. }
  34110. // method id "dfareporting.placementStrategies.list":
  34111. type PlacementStrategiesListCall struct {
  34112. s *Service
  34113. profileId int64
  34114. urlParams_ gensupport.URLParams
  34115. ifNoneMatch_ string
  34116. ctx_ context.Context
  34117. header_ http.Header
  34118. }
  34119. // List: Retrieves a list of placement strategies, possibly filtered.
  34120. // This method supports paging.
  34121. func (r *PlacementStrategiesService) List(profileId int64) *PlacementStrategiesListCall {
  34122. c := &PlacementStrategiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34123. c.profileId = profileId
  34124. return c
  34125. }
  34126. // Ids sets the optional parameter "ids": Select only placement
  34127. // strategies with these IDs.
  34128. func (c *PlacementStrategiesListCall) Ids(ids ...int64) *PlacementStrategiesListCall {
  34129. var ids_ []string
  34130. for _, v := range ids {
  34131. ids_ = append(ids_, fmt.Sprint(v))
  34132. }
  34133. c.urlParams_.SetMulti("ids", ids_)
  34134. return c
  34135. }
  34136. // MaxResults sets the optional parameter "maxResults": Maximum number
  34137. // of results to return.
  34138. func (c *PlacementStrategiesListCall) MaxResults(maxResults int64) *PlacementStrategiesListCall {
  34139. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  34140. return c
  34141. }
  34142. // PageToken sets the optional parameter "pageToken": Value of the
  34143. // nextPageToken from the previous result page.
  34144. func (c *PlacementStrategiesListCall) PageToken(pageToken string) *PlacementStrategiesListCall {
  34145. c.urlParams_.Set("pageToken", pageToken)
  34146. return c
  34147. }
  34148. // SearchString sets the optional parameter "searchString": Allows
  34149. // searching for objects by name or ID. Wildcards (*) are allowed. For
  34150. // example, "placementstrategy*2015" will return objects with names like
  34151. // "placementstrategy June 2015", "placementstrategy April 2015", or
  34152. // simply "placementstrategy 2015". Most of the searches also add
  34153. // wildcards implicitly at the start and the end of the search string.
  34154. // For example, a search string of "placementstrategy" will match
  34155. // objects with name "my placementstrategy", "placementstrategy 2015",
  34156. // or simply "placementstrategy".
  34157. func (c *PlacementStrategiesListCall) SearchString(searchString string) *PlacementStrategiesListCall {
  34158. c.urlParams_.Set("searchString", searchString)
  34159. return c
  34160. }
  34161. // SortField sets the optional parameter "sortField": Field by which to
  34162. // sort the list.
  34163. //
  34164. // Possible values:
  34165. // "ID" (default)
  34166. // "NAME"
  34167. func (c *PlacementStrategiesListCall) SortField(sortField string) *PlacementStrategiesListCall {
  34168. c.urlParams_.Set("sortField", sortField)
  34169. return c
  34170. }
  34171. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  34172. // results.
  34173. //
  34174. // Possible values:
  34175. // "ASCENDING" (default)
  34176. // "DESCENDING"
  34177. func (c *PlacementStrategiesListCall) SortOrder(sortOrder string) *PlacementStrategiesListCall {
  34178. c.urlParams_.Set("sortOrder", sortOrder)
  34179. return c
  34180. }
  34181. // Fields allows partial responses to be retrieved. See
  34182. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34183. // for more information.
  34184. func (c *PlacementStrategiesListCall) Fields(s ...googleapi.Field) *PlacementStrategiesListCall {
  34185. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34186. return c
  34187. }
  34188. // IfNoneMatch sets the optional parameter which makes the operation
  34189. // fail if the object's ETag matches the given value. This is useful for
  34190. // getting updates only after the object has changed since the last
  34191. // request. Use googleapi.IsNotModified to check whether the response
  34192. // error from Do is the result of In-None-Match.
  34193. func (c *PlacementStrategiesListCall) IfNoneMatch(entityTag string) *PlacementStrategiesListCall {
  34194. c.ifNoneMatch_ = entityTag
  34195. return c
  34196. }
  34197. // Context sets the context to be used in this call's Do method. Any
  34198. // pending HTTP request will be aborted if the provided context is
  34199. // canceled.
  34200. func (c *PlacementStrategiesListCall) Context(ctx context.Context) *PlacementStrategiesListCall {
  34201. c.ctx_ = ctx
  34202. return c
  34203. }
  34204. // Header returns an http.Header that can be modified by the caller to
  34205. // add HTTP headers to the request.
  34206. func (c *PlacementStrategiesListCall) Header() http.Header {
  34207. if c.header_ == nil {
  34208. c.header_ = make(http.Header)
  34209. }
  34210. return c.header_
  34211. }
  34212. func (c *PlacementStrategiesListCall) doRequest(alt string) (*http.Response, error) {
  34213. reqHeaders := make(http.Header)
  34214. for k, v := range c.header_ {
  34215. reqHeaders[k] = v
  34216. }
  34217. reqHeaders.Set("User-Agent", c.s.userAgent())
  34218. if c.ifNoneMatch_ != "" {
  34219. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34220. }
  34221. var body io.Reader = nil
  34222. c.urlParams_.Set("alt", alt)
  34223. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34224. urls += "?" + c.urlParams_.Encode()
  34225. req, _ := http.NewRequest("GET", urls, body)
  34226. req.Header = reqHeaders
  34227. googleapi.Expand(req.URL, map[string]string{
  34228. "profileId": strconv.FormatInt(c.profileId, 10),
  34229. })
  34230. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34231. }
  34232. // Do executes the "dfareporting.placementStrategies.list" call.
  34233. // Exactly one of *PlacementStrategiesListResponse or error will be
  34234. // non-nil. Any non-2xx status code is an error. Response headers are in
  34235. // either *PlacementStrategiesListResponse.ServerResponse.Header or (if
  34236. // a response was returned at all) in error.(*googleapi.Error).Header.
  34237. // Use googleapi.IsNotModified to check whether the returned error was
  34238. // because http.StatusNotModified was returned.
  34239. func (c *PlacementStrategiesListCall) Do(opts ...googleapi.CallOption) (*PlacementStrategiesListResponse, error) {
  34240. gensupport.SetOptions(c.urlParams_, opts...)
  34241. res, err := c.doRequest("json")
  34242. if res != nil && res.StatusCode == http.StatusNotModified {
  34243. if res.Body != nil {
  34244. res.Body.Close()
  34245. }
  34246. return nil, &googleapi.Error{
  34247. Code: res.StatusCode,
  34248. Header: res.Header,
  34249. }
  34250. }
  34251. if err != nil {
  34252. return nil, err
  34253. }
  34254. defer googleapi.CloseBody(res)
  34255. if err := googleapi.CheckResponse(res); err != nil {
  34256. return nil, err
  34257. }
  34258. ret := &PlacementStrategiesListResponse{
  34259. ServerResponse: googleapi.ServerResponse{
  34260. Header: res.Header,
  34261. HTTPStatusCode: res.StatusCode,
  34262. },
  34263. }
  34264. target := &ret
  34265. if err := gensupport.DecodeResponse(target, res); err != nil {
  34266. return nil, err
  34267. }
  34268. return ret, nil
  34269. // {
  34270. // "description": "Retrieves a list of placement strategies, possibly filtered. This method supports paging.",
  34271. // "httpMethod": "GET",
  34272. // "id": "dfareporting.placementStrategies.list",
  34273. // "parameterOrder": [
  34274. // "profileId"
  34275. // ],
  34276. // "parameters": {
  34277. // "ids": {
  34278. // "description": "Select only placement strategies with these IDs.",
  34279. // "format": "int64",
  34280. // "location": "query",
  34281. // "repeated": true,
  34282. // "type": "string"
  34283. // },
  34284. // "maxResults": {
  34285. // "default": "1000",
  34286. // "description": "Maximum number of results to return.",
  34287. // "format": "int32",
  34288. // "location": "query",
  34289. // "maximum": "1000",
  34290. // "minimum": "0",
  34291. // "type": "integer"
  34292. // },
  34293. // "pageToken": {
  34294. // "description": "Value of the nextPageToken from the previous result page.",
  34295. // "location": "query",
  34296. // "type": "string"
  34297. // },
  34298. // "profileId": {
  34299. // "description": "User profile ID associated with this request.",
  34300. // "format": "int64",
  34301. // "location": "path",
  34302. // "required": true,
  34303. // "type": "string"
  34304. // },
  34305. // "searchString": {
  34306. // "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\".",
  34307. // "location": "query",
  34308. // "type": "string"
  34309. // },
  34310. // "sortField": {
  34311. // "default": "ID",
  34312. // "description": "Field by which to sort the list.",
  34313. // "enum": [
  34314. // "ID",
  34315. // "NAME"
  34316. // ],
  34317. // "enumDescriptions": [
  34318. // "",
  34319. // ""
  34320. // ],
  34321. // "location": "query",
  34322. // "type": "string"
  34323. // },
  34324. // "sortOrder": {
  34325. // "default": "ASCENDING",
  34326. // "description": "Order of sorted results.",
  34327. // "enum": [
  34328. // "ASCENDING",
  34329. // "DESCENDING"
  34330. // ],
  34331. // "enumDescriptions": [
  34332. // "",
  34333. // ""
  34334. // ],
  34335. // "location": "query",
  34336. // "type": "string"
  34337. // }
  34338. // },
  34339. // "path": "userprofiles/{profileId}/placementStrategies",
  34340. // "response": {
  34341. // "$ref": "PlacementStrategiesListResponse"
  34342. // },
  34343. // "scopes": [
  34344. // "https://www.googleapis.com/auth/dfatrafficking"
  34345. // ]
  34346. // }
  34347. }
  34348. // Pages invokes f for each page of results.
  34349. // A non-nil error returned from f will halt the iteration.
  34350. // The provided context supersedes any context provided to the Context method.
  34351. func (c *PlacementStrategiesListCall) Pages(ctx context.Context, f func(*PlacementStrategiesListResponse) error) error {
  34352. c.ctx_ = ctx
  34353. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  34354. for {
  34355. x, err := c.Do()
  34356. if err != nil {
  34357. return err
  34358. }
  34359. if err := f(x); err != nil {
  34360. return err
  34361. }
  34362. if x.NextPageToken == "" {
  34363. return nil
  34364. }
  34365. c.PageToken(x.NextPageToken)
  34366. }
  34367. }
  34368. // method id "dfareporting.placementStrategies.patch":
  34369. type PlacementStrategiesPatchCall struct {
  34370. s *Service
  34371. profileId int64
  34372. placementstrategy *PlacementStrategy
  34373. urlParams_ gensupport.URLParams
  34374. ctx_ context.Context
  34375. header_ http.Header
  34376. }
  34377. // Patch: Updates an existing placement strategy. This method supports
  34378. // patch semantics.
  34379. func (r *PlacementStrategiesService) Patch(profileId int64, id int64, placementstrategy *PlacementStrategy) *PlacementStrategiesPatchCall {
  34380. c := &PlacementStrategiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34381. c.profileId = profileId
  34382. c.urlParams_.Set("id", fmt.Sprint(id))
  34383. c.placementstrategy = placementstrategy
  34384. return c
  34385. }
  34386. // Fields allows partial responses to be retrieved. See
  34387. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34388. // for more information.
  34389. func (c *PlacementStrategiesPatchCall) Fields(s ...googleapi.Field) *PlacementStrategiesPatchCall {
  34390. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34391. return c
  34392. }
  34393. // Context sets the context to be used in this call's Do method. Any
  34394. // pending HTTP request will be aborted if the provided context is
  34395. // canceled.
  34396. func (c *PlacementStrategiesPatchCall) Context(ctx context.Context) *PlacementStrategiesPatchCall {
  34397. c.ctx_ = ctx
  34398. return c
  34399. }
  34400. // Header returns an http.Header that can be modified by the caller to
  34401. // add HTTP headers to the request.
  34402. func (c *PlacementStrategiesPatchCall) Header() http.Header {
  34403. if c.header_ == nil {
  34404. c.header_ = make(http.Header)
  34405. }
  34406. return c.header_
  34407. }
  34408. func (c *PlacementStrategiesPatchCall) doRequest(alt string) (*http.Response, error) {
  34409. reqHeaders := make(http.Header)
  34410. for k, v := range c.header_ {
  34411. reqHeaders[k] = v
  34412. }
  34413. reqHeaders.Set("User-Agent", c.s.userAgent())
  34414. var body io.Reader = nil
  34415. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34416. if err != nil {
  34417. return nil, err
  34418. }
  34419. reqHeaders.Set("Content-Type", "application/json")
  34420. c.urlParams_.Set("alt", alt)
  34421. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34422. urls += "?" + c.urlParams_.Encode()
  34423. req, _ := http.NewRequest("PATCH", urls, body)
  34424. req.Header = reqHeaders
  34425. googleapi.Expand(req.URL, map[string]string{
  34426. "profileId": strconv.FormatInt(c.profileId, 10),
  34427. })
  34428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34429. }
  34430. // Do executes the "dfareporting.placementStrategies.patch" call.
  34431. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34432. // non-2xx status code is an error. Response headers are in either
  34433. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34434. // returned at all) in error.(*googleapi.Error).Header. Use
  34435. // googleapi.IsNotModified to check whether the returned error was
  34436. // because http.StatusNotModified was returned.
  34437. func (c *PlacementStrategiesPatchCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34438. gensupport.SetOptions(c.urlParams_, opts...)
  34439. res, err := c.doRequest("json")
  34440. if res != nil && res.StatusCode == http.StatusNotModified {
  34441. if res.Body != nil {
  34442. res.Body.Close()
  34443. }
  34444. return nil, &googleapi.Error{
  34445. Code: res.StatusCode,
  34446. Header: res.Header,
  34447. }
  34448. }
  34449. if err != nil {
  34450. return nil, err
  34451. }
  34452. defer googleapi.CloseBody(res)
  34453. if err := googleapi.CheckResponse(res); err != nil {
  34454. return nil, err
  34455. }
  34456. ret := &PlacementStrategy{
  34457. ServerResponse: googleapi.ServerResponse{
  34458. Header: res.Header,
  34459. HTTPStatusCode: res.StatusCode,
  34460. },
  34461. }
  34462. target := &ret
  34463. if err := gensupport.DecodeResponse(target, res); err != nil {
  34464. return nil, err
  34465. }
  34466. return ret, nil
  34467. // {
  34468. // "description": "Updates an existing placement strategy. This method supports patch semantics.",
  34469. // "httpMethod": "PATCH",
  34470. // "id": "dfareporting.placementStrategies.patch",
  34471. // "parameterOrder": [
  34472. // "profileId",
  34473. // "id"
  34474. // ],
  34475. // "parameters": {
  34476. // "id": {
  34477. // "description": "Placement strategy ID.",
  34478. // "format": "int64",
  34479. // "location": "query",
  34480. // "required": true,
  34481. // "type": "string"
  34482. // },
  34483. // "profileId": {
  34484. // "description": "User profile ID associated with this request.",
  34485. // "format": "int64",
  34486. // "location": "path",
  34487. // "required": true,
  34488. // "type": "string"
  34489. // }
  34490. // },
  34491. // "path": "userprofiles/{profileId}/placementStrategies",
  34492. // "request": {
  34493. // "$ref": "PlacementStrategy"
  34494. // },
  34495. // "response": {
  34496. // "$ref": "PlacementStrategy"
  34497. // },
  34498. // "scopes": [
  34499. // "https://www.googleapis.com/auth/dfatrafficking"
  34500. // ]
  34501. // }
  34502. }
  34503. // method id "dfareporting.placementStrategies.update":
  34504. type PlacementStrategiesUpdateCall struct {
  34505. s *Service
  34506. profileId int64
  34507. placementstrategy *PlacementStrategy
  34508. urlParams_ gensupport.URLParams
  34509. ctx_ context.Context
  34510. header_ http.Header
  34511. }
  34512. // Update: Updates an existing placement strategy.
  34513. func (r *PlacementStrategiesService) Update(profileId int64, placementstrategy *PlacementStrategy) *PlacementStrategiesUpdateCall {
  34514. c := &PlacementStrategiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34515. c.profileId = profileId
  34516. c.placementstrategy = placementstrategy
  34517. return c
  34518. }
  34519. // Fields allows partial responses to be retrieved. See
  34520. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34521. // for more information.
  34522. func (c *PlacementStrategiesUpdateCall) Fields(s ...googleapi.Field) *PlacementStrategiesUpdateCall {
  34523. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34524. return c
  34525. }
  34526. // Context sets the context to be used in this call's Do method. Any
  34527. // pending HTTP request will be aborted if the provided context is
  34528. // canceled.
  34529. func (c *PlacementStrategiesUpdateCall) Context(ctx context.Context) *PlacementStrategiesUpdateCall {
  34530. c.ctx_ = ctx
  34531. return c
  34532. }
  34533. // Header returns an http.Header that can be modified by the caller to
  34534. // add HTTP headers to the request.
  34535. func (c *PlacementStrategiesUpdateCall) Header() http.Header {
  34536. if c.header_ == nil {
  34537. c.header_ = make(http.Header)
  34538. }
  34539. return c.header_
  34540. }
  34541. func (c *PlacementStrategiesUpdateCall) doRequest(alt string) (*http.Response, error) {
  34542. reqHeaders := make(http.Header)
  34543. for k, v := range c.header_ {
  34544. reqHeaders[k] = v
  34545. }
  34546. reqHeaders.Set("User-Agent", c.s.userAgent())
  34547. var body io.Reader = nil
  34548. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placementstrategy)
  34549. if err != nil {
  34550. return nil, err
  34551. }
  34552. reqHeaders.Set("Content-Type", "application/json")
  34553. c.urlParams_.Set("alt", alt)
  34554. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placementStrategies")
  34555. urls += "?" + c.urlParams_.Encode()
  34556. req, _ := http.NewRequest("PUT", urls, body)
  34557. req.Header = reqHeaders
  34558. googleapi.Expand(req.URL, map[string]string{
  34559. "profileId": strconv.FormatInt(c.profileId, 10),
  34560. })
  34561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34562. }
  34563. // Do executes the "dfareporting.placementStrategies.update" call.
  34564. // Exactly one of *PlacementStrategy or error will be non-nil. Any
  34565. // non-2xx status code is an error. Response headers are in either
  34566. // *PlacementStrategy.ServerResponse.Header or (if a response was
  34567. // returned at all) in error.(*googleapi.Error).Header. Use
  34568. // googleapi.IsNotModified to check whether the returned error was
  34569. // because http.StatusNotModified was returned.
  34570. func (c *PlacementStrategiesUpdateCall) Do(opts ...googleapi.CallOption) (*PlacementStrategy, error) {
  34571. gensupport.SetOptions(c.urlParams_, opts...)
  34572. res, err := c.doRequest("json")
  34573. if res != nil && res.StatusCode == http.StatusNotModified {
  34574. if res.Body != nil {
  34575. res.Body.Close()
  34576. }
  34577. return nil, &googleapi.Error{
  34578. Code: res.StatusCode,
  34579. Header: res.Header,
  34580. }
  34581. }
  34582. if err != nil {
  34583. return nil, err
  34584. }
  34585. defer googleapi.CloseBody(res)
  34586. if err := googleapi.CheckResponse(res); err != nil {
  34587. return nil, err
  34588. }
  34589. ret := &PlacementStrategy{
  34590. ServerResponse: googleapi.ServerResponse{
  34591. Header: res.Header,
  34592. HTTPStatusCode: res.StatusCode,
  34593. },
  34594. }
  34595. target := &ret
  34596. if err := gensupport.DecodeResponse(target, res); err != nil {
  34597. return nil, err
  34598. }
  34599. return ret, nil
  34600. // {
  34601. // "description": "Updates an existing placement strategy.",
  34602. // "httpMethod": "PUT",
  34603. // "id": "dfareporting.placementStrategies.update",
  34604. // "parameterOrder": [
  34605. // "profileId"
  34606. // ],
  34607. // "parameters": {
  34608. // "profileId": {
  34609. // "description": "User profile ID associated with this request.",
  34610. // "format": "int64",
  34611. // "location": "path",
  34612. // "required": true,
  34613. // "type": "string"
  34614. // }
  34615. // },
  34616. // "path": "userprofiles/{profileId}/placementStrategies",
  34617. // "request": {
  34618. // "$ref": "PlacementStrategy"
  34619. // },
  34620. // "response": {
  34621. // "$ref": "PlacementStrategy"
  34622. // },
  34623. // "scopes": [
  34624. // "https://www.googleapis.com/auth/dfatrafficking"
  34625. // ]
  34626. // }
  34627. }
  34628. // method id "dfareporting.placements.generatetags":
  34629. type PlacementsGeneratetagsCall struct {
  34630. s *Service
  34631. profileId int64
  34632. urlParams_ gensupport.URLParams
  34633. ctx_ context.Context
  34634. header_ http.Header
  34635. }
  34636. // Generatetags: Generates tags for a placement.
  34637. func (r *PlacementsService) Generatetags(profileId int64) *PlacementsGeneratetagsCall {
  34638. c := &PlacementsGeneratetagsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34639. c.profileId = profileId
  34640. return c
  34641. }
  34642. // CampaignId sets the optional parameter "campaignId": Generate
  34643. // placements belonging to this campaign. This is a required field.
  34644. func (c *PlacementsGeneratetagsCall) CampaignId(campaignId int64) *PlacementsGeneratetagsCall {
  34645. c.urlParams_.Set("campaignId", fmt.Sprint(campaignId))
  34646. return c
  34647. }
  34648. // PlacementIds sets the optional parameter "placementIds": Generate
  34649. // tags for these placements.
  34650. func (c *PlacementsGeneratetagsCall) PlacementIds(placementIds ...int64) *PlacementsGeneratetagsCall {
  34651. var placementIds_ []string
  34652. for _, v := range placementIds {
  34653. placementIds_ = append(placementIds_, fmt.Sprint(v))
  34654. }
  34655. c.urlParams_.SetMulti("placementIds", placementIds_)
  34656. return c
  34657. }
  34658. // TagFormats sets the optional parameter "tagFormats": Tag formats to
  34659. // generate for these placements.
  34660. //
  34661. // Note: PLACEMENT_TAG_STANDARD can only be generated for 1x1
  34662. // placements.
  34663. //
  34664. // Possible values:
  34665. // "PLACEMENT_TAG_CLICK_COMMANDS"
  34666. // "PLACEMENT_TAG_IFRAME_ILAYER"
  34667. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT"
  34668. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY"
  34669. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH"
  34670. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3"
  34671. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4"
  34672. // "PLACEMENT_TAG_INTERNAL_REDIRECT"
  34673. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT"
  34674. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY"
  34675. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT"
  34676. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT"
  34677. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY"
  34678. // "PLACEMENT_TAG_JAVASCRIPT"
  34679. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY"
  34680. // "PLACEMENT_TAG_STANDARD"
  34681. // "PLACEMENT_TAG_TRACKING"
  34682. // "PLACEMENT_TAG_TRACKING_IFRAME"
  34683. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  34684. func (c *PlacementsGeneratetagsCall) TagFormats(tagFormats ...string) *PlacementsGeneratetagsCall {
  34685. c.urlParams_.SetMulti("tagFormats", append([]string{}, tagFormats...))
  34686. return c
  34687. }
  34688. // Fields allows partial responses to be retrieved. See
  34689. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34690. // for more information.
  34691. func (c *PlacementsGeneratetagsCall) Fields(s ...googleapi.Field) *PlacementsGeneratetagsCall {
  34692. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34693. return c
  34694. }
  34695. // Context sets the context to be used in this call's Do method. Any
  34696. // pending HTTP request will be aborted if the provided context is
  34697. // canceled.
  34698. func (c *PlacementsGeneratetagsCall) Context(ctx context.Context) *PlacementsGeneratetagsCall {
  34699. c.ctx_ = ctx
  34700. return c
  34701. }
  34702. // Header returns an http.Header that can be modified by the caller to
  34703. // add HTTP headers to the request.
  34704. func (c *PlacementsGeneratetagsCall) Header() http.Header {
  34705. if c.header_ == nil {
  34706. c.header_ = make(http.Header)
  34707. }
  34708. return c.header_
  34709. }
  34710. func (c *PlacementsGeneratetagsCall) doRequest(alt string) (*http.Response, error) {
  34711. reqHeaders := make(http.Header)
  34712. for k, v := range c.header_ {
  34713. reqHeaders[k] = v
  34714. }
  34715. reqHeaders.Set("User-Agent", c.s.userAgent())
  34716. var body io.Reader = nil
  34717. c.urlParams_.Set("alt", alt)
  34718. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/generatetags")
  34719. urls += "?" + c.urlParams_.Encode()
  34720. req, _ := http.NewRequest("POST", urls, body)
  34721. req.Header = reqHeaders
  34722. googleapi.Expand(req.URL, map[string]string{
  34723. "profileId": strconv.FormatInt(c.profileId, 10),
  34724. })
  34725. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34726. }
  34727. // Do executes the "dfareporting.placements.generatetags" call.
  34728. // Exactly one of *PlacementsGenerateTagsResponse or error will be
  34729. // non-nil. Any non-2xx status code is an error. Response headers are in
  34730. // either *PlacementsGenerateTagsResponse.ServerResponse.Header or (if a
  34731. // response was returned at all) in error.(*googleapi.Error).Header. Use
  34732. // googleapi.IsNotModified to check whether the returned error was
  34733. // because http.StatusNotModified was returned.
  34734. func (c *PlacementsGeneratetagsCall) Do(opts ...googleapi.CallOption) (*PlacementsGenerateTagsResponse, error) {
  34735. gensupport.SetOptions(c.urlParams_, opts...)
  34736. res, err := c.doRequest("json")
  34737. if res != nil && res.StatusCode == http.StatusNotModified {
  34738. if res.Body != nil {
  34739. res.Body.Close()
  34740. }
  34741. return nil, &googleapi.Error{
  34742. Code: res.StatusCode,
  34743. Header: res.Header,
  34744. }
  34745. }
  34746. if err != nil {
  34747. return nil, err
  34748. }
  34749. defer googleapi.CloseBody(res)
  34750. if err := googleapi.CheckResponse(res); err != nil {
  34751. return nil, err
  34752. }
  34753. ret := &PlacementsGenerateTagsResponse{
  34754. ServerResponse: googleapi.ServerResponse{
  34755. Header: res.Header,
  34756. HTTPStatusCode: res.StatusCode,
  34757. },
  34758. }
  34759. target := &ret
  34760. if err := gensupport.DecodeResponse(target, res); err != nil {
  34761. return nil, err
  34762. }
  34763. return ret, nil
  34764. // {
  34765. // "description": "Generates tags for a placement.",
  34766. // "httpMethod": "POST",
  34767. // "id": "dfareporting.placements.generatetags",
  34768. // "parameterOrder": [
  34769. // "profileId"
  34770. // ],
  34771. // "parameters": {
  34772. // "campaignId": {
  34773. // "description": "Generate placements belonging to this campaign. This is a required field.",
  34774. // "format": "int64",
  34775. // "location": "query",
  34776. // "type": "string"
  34777. // },
  34778. // "placementIds": {
  34779. // "description": "Generate tags for these placements.",
  34780. // "format": "int64",
  34781. // "location": "query",
  34782. // "repeated": true,
  34783. // "type": "string"
  34784. // },
  34785. // "profileId": {
  34786. // "description": "User profile ID associated with this request.",
  34787. // "format": "int64",
  34788. // "location": "path",
  34789. // "required": true,
  34790. // "type": "string"
  34791. // },
  34792. // "tagFormats": {
  34793. // "description": "Tag formats to generate for these placements.\n\nNote: PLACEMENT_TAG_STANDARD can only be generated for 1x1 placements.",
  34794. // "enum": [
  34795. // "PLACEMENT_TAG_CLICK_COMMANDS",
  34796. // "PLACEMENT_TAG_IFRAME_ILAYER",
  34797. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT",
  34798. // "PLACEMENT_TAG_IFRAME_JAVASCRIPT_LEGACY",
  34799. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH",
  34800. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_3",
  34801. // "PLACEMENT_TAG_INSTREAM_VIDEO_PREFETCH_VAST_4",
  34802. // "PLACEMENT_TAG_INTERNAL_REDIRECT",
  34803. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT",
  34804. // "PLACEMENT_TAG_INTERSTITIAL_IFRAME_JAVASCRIPT_LEGACY",
  34805. // "PLACEMENT_TAG_INTERSTITIAL_INTERNAL_REDIRECT",
  34806. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT",
  34807. // "PLACEMENT_TAG_INTERSTITIAL_JAVASCRIPT_LEGACY",
  34808. // "PLACEMENT_TAG_JAVASCRIPT",
  34809. // "PLACEMENT_TAG_JAVASCRIPT_LEGACY",
  34810. // "PLACEMENT_TAG_STANDARD",
  34811. // "PLACEMENT_TAG_TRACKING",
  34812. // "PLACEMENT_TAG_TRACKING_IFRAME",
  34813. // "PLACEMENT_TAG_TRACKING_JAVASCRIPT"
  34814. // ],
  34815. // "enumDescriptions": [
  34816. // "",
  34817. // "",
  34818. // "",
  34819. // "",
  34820. // "",
  34821. // "",
  34822. // "",
  34823. // "",
  34824. // "",
  34825. // "",
  34826. // "",
  34827. // "",
  34828. // "",
  34829. // "",
  34830. // "",
  34831. // "",
  34832. // "",
  34833. // "",
  34834. // ""
  34835. // ],
  34836. // "location": "query",
  34837. // "repeated": true,
  34838. // "type": "string"
  34839. // }
  34840. // },
  34841. // "path": "userprofiles/{profileId}/placements/generatetags",
  34842. // "response": {
  34843. // "$ref": "PlacementsGenerateTagsResponse"
  34844. // },
  34845. // "scopes": [
  34846. // "https://www.googleapis.com/auth/dfatrafficking"
  34847. // ]
  34848. // }
  34849. }
  34850. // method id "dfareporting.placements.get":
  34851. type PlacementsGetCall struct {
  34852. s *Service
  34853. profileId int64
  34854. id int64
  34855. urlParams_ gensupport.URLParams
  34856. ifNoneMatch_ string
  34857. ctx_ context.Context
  34858. header_ http.Header
  34859. }
  34860. // Get: Gets one placement by ID.
  34861. func (r *PlacementsService) Get(profileId int64, id int64) *PlacementsGetCall {
  34862. c := &PlacementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  34863. c.profileId = profileId
  34864. c.id = id
  34865. return c
  34866. }
  34867. // Fields allows partial responses to be retrieved. See
  34868. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  34869. // for more information.
  34870. func (c *PlacementsGetCall) Fields(s ...googleapi.Field) *PlacementsGetCall {
  34871. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  34872. return c
  34873. }
  34874. // IfNoneMatch sets the optional parameter which makes the operation
  34875. // fail if the object's ETag matches the given value. This is useful for
  34876. // getting updates only after the object has changed since the last
  34877. // request. Use googleapi.IsNotModified to check whether the response
  34878. // error from Do is the result of In-None-Match.
  34879. func (c *PlacementsGetCall) IfNoneMatch(entityTag string) *PlacementsGetCall {
  34880. c.ifNoneMatch_ = entityTag
  34881. return c
  34882. }
  34883. // Context sets the context to be used in this call's Do method. Any
  34884. // pending HTTP request will be aborted if the provided context is
  34885. // canceled.
  34886. func (c *PlacementsGetCall) Context(ctx context.Context) *PlacementsGetCall {
  34887. c.ctx_ = ctx
  34888. return c
  34889. }
  34890. // Header returns an http.Header that can be modified by the caller to
  34891. // add HTTP headers to the request.
  34892. func (c *PlacementsGetCall) Header() http.Header {
  34893. if c.header_ == nil {
  34894. c.header_ = make(http.Header)
  34895. }
  34896. return c.header_
  34897. }
  34898. func (c *PlacementsGetCall) doRequest(alt string) (*http.Response, error) {
  34899. reqHeaders := make(http.Header)
  34900. for k, v := range c.header_ {
  34901. reqHeaders[k] = v
  34902. }
  34903. reqHeaders.Set("User-Agent", c.s.userAgent())
  34904. if c.ifNoneMatch_ != "" {
  34905. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  34906. }
  34907. var body io.Reader = nil
  34908. c.urlParams_.Set("alt", alt)
  34909. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements/{id}")
  34910. urls += "?" + c.urlParams_.Encode()
  34911. req, _ := http.NewRequest("GET", urls, body)
  34912. req.Header = reqHeaders
  34913. googleapi.Expand(req.URL, map[string]string{
  34914. "profileId": strconv.FormatInt(c.profileId, 10),
  34915. "id": strconv.FormatInt(c.id, 10),
  34916. })
  34917. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  34918. }
  34919. // Do executes the "dfareporting.placements.get" call.
  34920. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  34921. // status code is an error. Response headers are in either
  34922. // *Placement.ServerResponse.Header or (if a response was returned at
  34923. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  34924. // to check whether the returned error was because
  34925. // http.StatusNotModified was returned.
  34926. func (c *PlacementsGetCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  34927. gensupport.SetOptions(c.urlParams_, opts...)
  34928. res, err := c.doRequest("json")
  34929. if res != nil && res.StatusCode == http.StatusNotModified {
  34930. if res.Body != nil {
  34931. res.Body.Close()
  34932. }
  34933. return nil, &googleapi.Error{
  34934. Code: res.StatusCode,
  34935. Header: res.Header,
  34936. }
  34937. }
  34938. if err != nil {
  34939. return nil, err
  34940. }
  34941. defer googleapi.CloseBody(res)
  34942. if err := googleapi.CheckResponse(res); err != nil {
  34943. return nil, err
  34944. }
  34945. ret := &Placement{
  34946. ServerResponse: googleapi.ServerResponse{
  34947. Header: res.Header,
  34948. HTTPStatusCode: res.StatusCode,
  34949. },
  34950. }
  34951. target := &ret
  34952. if err := gensupport.DecodeResponse(target, res); err != nil {
  34953. return nil, err
  34954. }
  34955. return ret, nil
  34956. // {
  34957. // "description": "Gets one placement by ID.",
  34958. // "httpMethod": "GET",
  34959. // "id": "dfareporting.placements.get",
  34960. // "parameterOrder": [
  34961. // "profileId",
  34962. // "id"
  34963. // ],
  34964. // "parameters": {
  34965. // "id": {
  34966. // "description": "Placement ID.",
  34967. // "format": "int64",
  34968. // "location": "path",
  34969. // "required": true,
  34970. // "type": "string"
  34971. // },
  34972. // "profileId": {
  34973. // "description": "User profile ID associated with this request.",
  34974. // "format": "int64",
  34975. // "location": "path",
  34976. // "required": true,
  34977. // "type": "string"
  34978. // }
  34979. // },
  34980. // "path": "userprofiles/{profileId}/placements/{id}",
  34981. // "response": {
  34982. // "$ref": "Placement"
  34983. // },
  34984. // "scopes": [
  34985. // "https://www.googleapis.com/auth/dfatrafficking"
  34986. // ]
  34987. // }
  34988. }
  34989. // method id "dfareporting.placements.insert":
  34990. type PlacementsInsertCall struct {
  34991. s *Service
  34992. profileId int64
  34993. placement *Placement
  34994. urlParams_ gensupport.URLParams
  34995. ctx_ context.Context
  34996. header_ http.Header
  34997. }
  34998. // Insert: Inserts a new placement.
  34999. func (r *PlacementsService) Insert(profileId int64, placement *Placement) *PlacementsInsertCall {
  35000. c := &PlacementsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35001. c.profileId = profileId
  35002. c.placement = placement
  35003. return c
  35004. }
  35005. // Fields allows partial responses to be retrieved. See
  35006. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35007. // for more information.
  35008. func (c *PlacementsInsertCall) Fields(s ...googleapi.Field) *PlacementsInsertCall {
  35009. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35010. return c
  35011. }
  35012. // Context sets the context to be used in this call's Do method. Any
  35013. // pending HTTP request will be aborted if the provided context is
  35014. // canceled.
  35015. func (c *PlacementsInsertCall) Context(ctx context.Context) *PlacementsInsertCall {
  35016. c.ctx_ = ctx
  35017. return c
  35018. }
  35019. // Header returns an http.Header that can be modified by the caller to
  35020. // add HTTP headers to the request.
  35021. func (c *PlacementsInsertCall) Header() http.Header {
  35022. if c.header_ == nil {
  35023. c.header_ = make(http.Header)
  35024. }
  35025. return c.header_
  35026. }
  35027. func (c *PlacementsInsertCall) doRequest(alt string) (*http.Response, error) {
  35028. reqHeaders := make(http.Header)
  35029. for k, v := range c.header_ {
  35030. reqHeaders[k] = v
  35031. }
  35032. reqHeaders.Set("User-Agent", c.s.userAgent())
  35033. var body io.Reader = nil
  35034. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  35035. if err != nil {
  35036. return nil, err
  35037. }
  35038. reqHeaders.Set("Content-Type", "application/json")
  35039. c.urlParams_.Set("alt", alt)
  35040. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35041. urls += "?" + c.urlParams_.Encode()
  35042. req, _ := http.NewRequest("POST", urls, body)
  35043. req.Header = reqHeaders
  35044. googleapi.Expand(req.URL, map[string]string{
  35045. "profileId": strconv.FormatInt(c.profileId, 10),
  35046. })
  35047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35048. }
  35049. // Do executes the "dfareporting.placements.insert" call.
  35050. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35051. // status code is an error. Response headers are in either
  35052. // *Placement.ServerResponse.Header or (if a response was returned at
  35053. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35054. // to check whether the returned error was because
  35055. // http.StatusNotModified was returned.
  35056. func (c *PlacementsInsertCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35057. gensupport.SetOptions(c.urlParams_, opts...)
  35058. res, err := c.doRequest("json")
  35059. if res != nil && res.StatusCode == http.StatusNotModified {
  35060. if res.Body != nil {
  35061. res.Body.Close()
  35062. }
  35063. return nil, &googleapi.Error{
  35064. Code: res.StatusCode,
  35065. Header: res.Header,
  35066. }
  35067. }
  35068. if err != nil {
  35069. return nil, err
  35070. }
  35071. defer googleapi.CloseBody(res)
  35072. if err := googleapi.CheckResponse(res); err != nil {
  35073. return nil, err
  35074. }
  35075. ret := &Placement{
  35076. ServerResponse: googleapi.ServerResponse{
  35077. Header: res.Header,
  35078. HTTPStatusCode: res.StatusCode,
  35079. },
  35080. }
  35081. target := &ret
  35082. if err := gensupport.DecodeResponse(target, res); err != nil {
  35083. return nil, err
  35084. }
  35085. return ret, nil
  35086. // {
  35087. // "description": "Inserts a new placement.",
  35088. // "httpMethod": "POST",
  35089. // "id": "dfareporting.placements.insert",
  35090. // "parameterOrder": [
  35091. // "profileId"
  35092. // ],
  35093. // "parameters": {
  35094. // "profileId": {
  35095. // "description": "User profile ID associated with this request.",
  35096. // "format": "int64",
  35097. // "location": "path",
  35098. // "required": true,
  35099. // "type": "string"
  35100. // }
  35101. // },
  35102. // "path": "userprofiles/{profileId}/placements",
  35103. // "request": {
  35104. // "$ref": "Placement"
  35105. // },
  35106. // "response": {
  35107. // "$ref": "Placement"
  35108. // },
  35109. // "scopes": [
  35110. // "https://www.googleapis.com/auth/dfatrafficking"
  35111. // ]
  35112. // }
  35113. }
  35114. // method id "dfareporting.placements.list":
  35115. type PlacementsListCall struct {
  35116. s *Service
  35117. profileId int64
  35118. urlParams_ gensupport.URLParams
  35119. ifNoneMatch_ string
  35120. ctx_ context.Context
  35121. header_ http.Header
  35122. }
  35123. // List: Retrieves a list of placements, possibly filtered. This method
  35124. // supports paging.
  35125. func (r *PlacementsService) List(profileId int64) *PlacementsListCall {
  35126. c := &PlacementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35127. c.profileId = profileId
  35128. return c
  35129. }
  35130. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  35131. // only placements that belong to these advertisers.
  35132. func (c *PlacementsListCall) AdvertiserIds(advertiserIds ...int64) *PlacementsListCall {
  35133. var advertiserIds_ []string
  35134. for _, v := range advertiserIds {
  35135. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  35136. }
  35137. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  35138. return c
  35139. }
  35140. // Archived sets the optional parameter "archived": Select only archived
  35141. // placements. Don't set this field to select both archived and
  35142. // non-archived placements.
  35143. func (c *PlacementsListCall) Archived(archived bool) *PlacementsListCall {
  35144. c.urlParams_.Set("archived", fmt.Sprint(archived))
  35145. return c
  35146. }
  35147. // CampaignIds sets the optional parameter "campaignIds": Select only
  35148. // placements that belong to these campaigns.
  35149. func (c *PlacementsListCall) CampaignIds(campaignIds ...int64) *PlacementsListCall {
  35150. var campaignIds_ []string
  35151. for _, v := range campaignIds {
  35152. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  35153. }
  35154. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  35155. return c
  35156. }
  35157. // Compatibilities sets the optional parameter "compatibilities": Select
  35158. // only placements that are associated with these compatibilities.
  35159. // DISPLAY and DISPLAY_INTERSTITIAL refer to rendering either on desktop
  35160. // or on mobile devices for regular or interstitial ads respectively.
  35161. // APP and APP_INTERSTITIAL are for rendering in mobile apps.
  35162. // IN_STREAM_VIDEO refers to rendering in in-stream video ads developed
  35163. // with the VAST standard.
  35164. //
  35165. // Possible values:
  35166. // "APP"
  35167. // "APP_INTERSTITIAL"
  35168. // "DISPLAY"
  35169. // "DISPLAY_INTERSTITIAL"
  35170. // "IN_STREAM_VIDEO"
  35171. func (c *PlacementsListCall) Compatibilities(compatibilities ...string) *PlacementsListCall {
  35172. c.urlParams_.SetMulti("compatibilities", append([]string{}, compatibilities...))
  35173. return c
  35174. }
  35175. // ContentCategoryIds sets the optional parameter "contentCategoryIds":
  35176. // Select only placements that are associated with these content
  35177. // categories.
  35178. func (c *PlacementsListCall) ContentCategoryIds(contentCategoryIds ...int64) *PlacementsListCall {
  35179. var contentCategoryIds_ []string
  35180. for _, v := range contentCategoryIds {
  35181. contentCategoryIds_ = append(contentCategoryIds_, fmt.Sprint(v))
  35182. }
  35183. c.urlParams_.SetMulti("contentCategoryIds", contentCategoryIds_)
  35184. return c
  35185. }
  35186. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  35187. // Select only placements that are associated with these directory
  35188. // sites.
  35189. func (c *PlacementsListCall) DirectorySiteIds(directorySiteIds ...int64) *PlacementsListCall {
  35190. var directorySiteIds_ []string
  35191. for _, v := range directorySiteIds {
  35192. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  35193. }
  35194. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  35195. return c
  35196. }
  35197. // GroupIds sets the optional parameter "groupIds": Select only
  35198. // placements that belong to these placement groups.
  35199. func (c *PlacementsListCall) GroupIds(groupIds ...int64) *PlacementsListCall {
  35200. var groupIds_ []string
  35201. for _, v := range groupIds {
  35202. groupIds_ = append(groupIds_, fmt.Sprint(v))
  35203. }
  35204. c.urlParams_.SetMulti("groupIds", groupIds_)
  35205. return c
  35206. }
  35207. // Ids sets the optional parameter "ids": Select only placements with
  35208. // these IDs.
  35209. func (c *PlacementsListCall) Ids(ids ...int64) *PlacementsListCall {
  35210. var ids_ []string
  35211. for _, v := range ids {
  35212. ids_ = append(ids_, fmt.Sprint(v))
  35213. }
  35214. c.urlParams_.SetMulti("ids", ids_)
  35215. return c
  35216. }
  35217. // MaxEndDate sets the optional parameter "maxEndDate": Select only
  35218. // placements or placement groups whose end date is on or before the
  35219. // specified maxEndDate. The date should be formatted as "yyyy-MM-dd".
  35220. func (c *PlacementsListCall) MaxEndDate(maxEndDate string) *PlacementsListCall {
  35221. c.urlParams_.Set("maxEndDate", maxEndDate)
  35222. return c
  35223. }
  35224. // MaxResults sets the optional parameter "maxResults": Maximum number
  35225. // of results to return.
  35226. func (c *PlacementsListCall) MaxResults(maxResults int64) *PlacementsListCall {
  35227. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  35228. return c
  35229. }
  35230. // MaxStartDate sets the optional parameter "maxStartDate": Select only
  35231. // placements or placement groups whose start date is on or before the
  35232. // specified maxStartDate. The date should be formatted as "yyyy-MM-dd".
  35233. func (c *PlacementsListCall) MaxStartDate(maxStartDate string) *PlacementsListCall {
  35234. c.urlParams_.Set("maxStartDate", maxStartDate)
  35235. return c
  35236. }
  35237. // MinEndDate sets the optional parameter "minEndDate": Select only
  35238. // placements or placement groups whose end date is on or after the
  35239. // specified minEndDate. The date should be formatted as "yyyy-MM-dd".
  35240. func (c *PlacementsListCall) MinEndDate(minEndDate string) *PlacementsListCall {
  35241. c.urlParams_.Set("minEndDate", minEndDate)
  35242. return c
  35243. }
  35244. // MinStartDate sets the optional parameter "minStartDate": Select only
  35245. // placements or placement groups whose start date is on or after the
  35246. // specified minStartDate. The date should be formatted as "yyyy-MM-dd".
  35247. func (c *PlacementsListCall) MinStartDate(minStartDate string) *PlacementsListCall {
  35248. c.urlParams_.Set("minStartDate", minStartDate)
  35249. return c
  35250. }
  35251. // PageToken sets the optional parameter "pageToken": Value of the
  35252. // nextPageToken from the previous result page.
  35253. func (c *PlacementsListCall) PageToken(pageToken string) *PlacementsListCall {
  35254. c.urlParams_.Set("pageToken", pageToken)
  35255. return c
  35256. }
  35257. // PaymentSource sets the optional parameter "paymentSource": Select
  35258. // only placements with this payment source.
  35259. //
  35260. // Possible values:
  35261. // "PLACEMENT_AGENCY_PAID"
  35262. // "PLACEMENT_PUBLISHER_PAID"
  35263. func (c *PlacementsListCall) PaymentSource(paymentSource string) *PlacementsListCall {
  35264. c.urlParams_.Set("paymentSource", paymentSource)
  35265. return c
  35266. }
  35267. // PlacementStrategyIds sets the optional parameter
  35268. // "placementStrategyIds": Select only placements that are associated
  35269. // with these placement strategies.
  35270. func (c *PlacementsListCall) PlacementStrategyIds(placementStrategyIds ...int64) *PlacementsListCall {
  35271. var placementStrategyIds_ []string
  35272. for _, v := range placementStrategyIds {
  35273. placementStrategyIds_ = append(placementStrategyIds_, fmt.Sprint(v))
  35274. }
  35275. c.urlParams_.SetMulti("placementStrategyIds", placementStrategyIds_)
  35276. return c
  35277. }
  35278. // PricingTypes sets the optional parameter "pricingTypes": Select only
  35279. // placements with these pricing types.
  35280. //
  35281. // Possible values:
  35282. // "PRICING_TYPE_CPA"
  35283. // "PRICING_TYPE_CPC"
  35284. // "PRICING_TYPE_CPM"
  35285. // "PRICING_TYPE_CPM_ACTIVEVIEW"
  35286. // "PRICING_TYPE_FLAT_RATE_CLICKS"
  35287. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  35288. func (c *PlacementsListCall) PricingTypes(pricingTypes ...string) *PlacementsListCall {
  35289. c.urlParams_.SetMulti("pricingTypes", append([]string{}, pricingTypes...))
  35290. return c
  35291. }
  35292. // SearchString sets the optional parameter "searchString": Allows
  35293. // searching for placements by name or ID. Wildcards (*) are allowed.
  35294. // For example, "placement*2015" will return placements with names like
  35295. // "placement June 2015", "placement May 2015", or simply "placements
  35296. // 2015". Most of the searches also add wildcards implicitly at the
  35297. // start and the end of the search string. For example, a search string
  35298. // of "placement" will match placements with name "my placement",
  35299. // "placement 2015", or simply "placement".
  35300. func (c *PlacementsListCall) SearchString(searchString string) *PlacementsListCall {
  35301. c.urlParams_.Set("searchString", searchString)
  35302. return c
  35303. }
  35304. // SiteIds sets the optional parameter "siteIds": Select only placements
  35305. // that are associated with these sites.
  35306. func (c *PlacementsListCall) SiteIds(siteIds ...int64) *PlacementsListCall {
  35307. var siteIds_ []string
  35308. for _, v := range siteIds {
  35309. siteIds_ = append(siteIds_, fmt.Sprint(v))
  35310. }
  35311. c.urlParams_.SetMulti("siteIds", siteIds_)
  35312. return c
  35313. }
  35314. // SizeIds sets the optional parameter "sizeIds": Select only placements
  35315. // that are associated with these sizes.
  35316. func (c *PlacementsListCall) SizeIds(sizeIds ...int64) *PlacementsListCall {
  35317. var sizeIds_ []string
  35318. for _, v := range sizeIds {
  35319. sizeIds_ = append(sizeIds_, fmt.Sprint(v))
  35320. }
  35321. c.urlParams_.SetMulti("sizeIds", sizeIds_)
  35322. return c
  35323. }
  35324. // SortField sets the optional parameter "sortField": Field by which to
  35325. // sort the list.
  35326. //
  35327. // Possible values:
  35328. // "ID" (default)
  35329. // "NAME"
  35330. func (c *PlacementsListCall) SortField(sortField string) *PlacementsListCall {
  35331. c.urlParams_.Set("sortField", sortField)
  35332. return c
  35333. }
  35334. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  35335. // results.
  35336. //
  35337. // Possible values:
  35338. // "ASCENDING" (default)
  35339. // "DESCENDING"
  35340. func (c *PlacementsListCall) SortOrder(sortOrder string) *PlacementsListCall {
  35341. c.urlParams_.Set("sortOrder", sortOrder)
  35342. return c
  35343. }
  35344. // Fields allows partial responses to be retrieved. See
  35345. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35346. // for more information.
  35347. func (c *PlacementsListCall) Fields(s ...googleapi.Field) *PlacementsListCall {
  35348. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35349. return c
  35350. }
  35351. // IfNoneMatch sets the optional parameter which makes the operation
  35352. // fail if the object's ETag matches the given value. This is useful for
  35353. // getting updates only after the object has changed since the last
  35354. // request. Use googleapi.IsNotModified to check whether the response
  35355. // error from Do is the result of In-None-Match.
  35356. func (c *PlacementsListCall) IfNoneMatch(entityTag string) *PlacementsListCall {
  35357. c.ifNoneMatch_ = entityTag
  35358. return c
  35359. }
  35360. // Context sets the context to be used in this call's Do method. Any
  35361. // pending HTTP request will be aborted if the provided context is
  35362. // canceled.
  35363. func (c *PlacementsListCall) Context(ctx context.Context) *PlacementsListCall {
  35364. c.ctx_ = ctx
  35365. return c
  35366. }
  35367. // Header returns an http.Header that can be modified by the caller to
  35368. // add HTTP headers to the request.
  35369. func (c *PlacementsListCall) Header() http.Header {
  35370. if c.header_ == nil {
  35371. c.header_ = make(http.Header)
  35372. }
  35373. return c.header_
  35374. }
  35375. func (c *PlacementsListCall) doRequest(alt string) (*http.Response, error) {
  35376. reqHeaders := make(http.Header)
  35377. for k, v := range c.header_ {
  35378. reqHeaders[k] = v
  35379. }
  35380. reqHeaders.Set("User-Agent", c.s.userAgent())
  35381. if c.ifNoneMatch_ != "" {
  35382. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35383. }
  35384. var body io.Reader = nil
  35385. c.urlParams_.Set("alt", alt)
  35386. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35387. urls += "?" + c.urlParams_.Encode()
  35388. req, _ := http.NewRequest("GET", urls, body)
  35389. req.Header = reqHeaders
  35390. googleapi.Expand(req.URL, map[string]string{
  35391. "profileId": strconv.FormatInt(c.profileId, 10),
  35392. })
  35393. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35394. }
  35395. // Do executes the "dfareporting.placements.list" call.
  35396. // Exactly one of *PlacementsListResponse or error will be non-nil. Any
  35397. // non-2xx status code is an error. Response headers are in either
  35398. // *PlacementsListResponse.ServerResponse.Header or (if a response was
  35399. // returned at all) in error.(*googleapi.Error).Header. Use
  35400. // googleapi.IsNotModified to check whether the returned error was
  35401. // because http.StatusNotModified was returned.
  35402. func (c *PlacementsListCall) Do(opts ...googleapi.CallOption) (*PlacementsListResponse, error) {
  35403. gensupport.SetOptions(c.urlParams_, opts...)
  35404. res, err := c.doRequest("json")
  35405. if res != nil && res.StatusCode == http.StatusNotModified {
  35406. if res.Body != nil {
  35407. res.Body.Close()
  35408. }
  35409. return nil, &googleapi.Error{
  35410. Code: res.StatusCode,
  35411. Header: res.Header,
  35412. }
  35413. }
  35414. if err != nil {
  35415. return nil, err
  35416. }
  35417. defer googleapi.CloseBody(res)
  35418. if err := googleapi.CheckResponse(res); err != nil {
  35419. return nil, err
  35420. }
  35421. ret := &PlacementsListResponse{
  35422. ServerResponse: googleapi.ServerResponse{
  35423. Header: res.Header,
  35424. HTTPStatusCode: res.StatusCode,
  35425. },
  35426. }
  35427. target := &ret
  35428. if err := gensupport.DecodeResponse(target, res); err != nil {
  35429. return nil, err
  35430. }
  35431. return ret, nil
  35432. // {
  35433. // "description": "Retrieves a list of placements, possibly filtered. This method supports paging.",
  35434. // "httpMethod": "GET",
  35435. // "id": "dfareporting.placements.list",
  35436. // "parameterOrder": [
  35437. // "profileId"
  35438. // ],
  35439. // "parameters": {
  35440. // "advertiserIds": {
  35441. // "description": "Select only placements that belong to these advertisers.",
  35442. // "format": "int64",
  35443. // "location": "query",
  35444. // "repeated": true,
  35445. // "type": "string"
  35446. // },
  35447. // "archived": {
  35448. // "description": "Select only archived placements. Don't set this field to select both archived and non-archived placements.",
  35449. // "location": "query",
  35450. // "type": "boolean"
  35451. // },
  35452. // "campaignIds": {
  35453. // "description": "Select only placements that belong to these campaigns.",
  35454. // "format": "int64",
  35455. // "location": "query",
  35456. // "repeated": true,
  35457. // "type": "string"
  35458. // },
  35459. // "compatibilities": {
  35460. // "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.",
  35461. // "enum": [
  35462. // "APP",
  35463. // "APP_INTERSTITIAL",
  35464. // "DISPLAY",
  35465. // "DISPLAY_INTERSTITIAL",
  35466. // "IN_STREAM_VIDEO"
  35467. // ],
  35468. // "enumDescriptions": [
  35469. // "",
  35470. // "",
  35471. // "",
  35472. // "",
  35473. // ""
  35474. // ],
  35475. // "location": "query",
  35476. // "repeated": true,
  35477. // "type": "string"
  35478. // },
  35479. // "contentCategoryIds": {
  35480. // "description": "Select only placements that are associated with these content categories.",
  35481. // "format": "int64",
  35482. // "location": "query",
  35483. // "repeated": true,
  35484. // "type": "string"
  35485. // },
  35486. // "directorySiteIds": {
  35487. // "description": "Select only placements that are associated with these directory sites.",
  35488. // "format": "int64",
  35489. // "location": "query",
  35490. // "repeated": true,
  35491. // "type": "string"
  35492. // },
  35493. // "groupIds": {
  35494. // "description": "Select only placements that belong to these placement groups.",
  35495. // "format": "int64",
  35496. // "location": "query",
  35497. // "repeated": true,
  35498. // "type": "string"
  35499. // },
  35500. // "ids": {
  35501. // "description": "Select only placements with these IDs.",
  35502. // "format": "int64",
  35503. // "location": "query",
  35504. // "repeated": true,
  35505. // "type": "string"
  35506. // },
  35507. // "maxEndDate": {
  35508. // "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\".",
  35509. // "location": "query",
  35510. // "type": "string"
  35511. // },
  35512. // "maxResults": {
  35513. // "default": "1000",
  35514. // "description": "Maximum number of results to return.",
  35515. // "format": "int32",
  35516. // "location": "query",
  35517. // "maximum": "1000",
  35518. // "minimum": "0",
  35519. // "type": "integer"
  35520. // },
  35521. // "maxStartDate": {
  35522. // "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\".",
  35523. // "location": "query",
  35524. // "type": "string"
  35525. // },
  35526. // "minEndDate": {
  35527. // "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\".",
  35528. // "location": "query",
  35529. // "type": "string"
  35530. // },
  35531. // "minStartDate": {
  35532. // "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\".",
  35533. // "location": "query",
  35534. // "type": "string"
  35535. // },
  35536. // "pageToken": {
  35537. // "description": "Value of the nextPageToken from the previous result page.",
  35538. // "location": "query",
  35539. // "type": "string"
  35540. // },
  35541. // "paymentSource": {
  35542. // "description": "Select only placements with this payment source.",
  35543. // "enum": [
  35544. // "PLACEMENT_AGENCY_PAID",
  35545. // "PLACEMENT_PUBLISHER_PAID"
  35546. // ],
  35547. // "enumDescriptions": [
  35548. // "",
  35549. // ""
  35550. // ],
  35551. // "location": "query",
  35552. // "type": "string"
  35553. // },
  35554. // "placementStrategyIds": {
  35555. // "description": "Select only placements that are associated with these placement strategies.",
  35556. // "format": "int64",
  35557. // "location": "query",
  35558. // "repeated": true,
  35559. // "type": "string"
  35560. // },
  35561. // "pricingTypes": {
  35562. // "description": "Select only placements with these pricing types.",
  35563. // "enum": [
  35564. // "PRICING_TYPE_CPA",
  35565. // "PRICING_TYPE_CPC",
  35566. // "PRICING_TYPE_CPM",
  35567. // "PRICING_TYPE_CPM_ACTIVEVIEW",
  35568. // "PRICING_TYPE_FLAT_RATE_CLICKS",
  35569. // "PRICING_TYPE_FLAT_RATE_IMPRESSIONS"
  35570. // ],
  35571. // "enumDescriptions": [
  35572. // "",
  35573. // "",
  35574. // "",
  35575. // "",
  35576. // "",
  35577. // ""
  35578. // ],
  35579. // "location": "query",
  35580. // "repeated": true,
  35581. // "type": "string"
  35582. // },
  35583. // "profileId": {
  35584. // "description": "User profile ID associated with this request.",
  35585. // "format": "int64",
  35586. // "location": "path",
  35587. // "required": true,
  35588. // "type": "string"
  35589. // },
  35590. // "searchString": {
  35591. // "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\".",
  35592. // "location": "query",
  35593. // "type": "string"
  35594. // },
  35595. // "siteIds": {
  35596. // "description": "Select only placements that are associated with these sites.",
  35597. // "format": "int64",
  35598. // "location": "query",
  35599. // "repeated": true,
  35600. // "type": "string"
  35601. // },
  35602. // "sizeIds": {
  35603. // "description": "Select only placements that are associated with these sizes.",
  35604. // "format": "int64",
  35605. // "location": "query",
  35606. // "repeated": true,
  35607. // "type": "string"
  35608. // },
  35609. // "sortField": {
  35610. // "default": "ID",
  35611. // "description": "Field by which to sort the list.",
  35612. // "enum": [
  35613. // "ID",
  35614. // "NAME"
  35615. // ],
  35616. // "enumDescriptions": [
  35617. // "",
  35618. // ""
  35619. // ],
  35620. // "location": "query",
  35621. // "type": "string"
  35622. // },
  35623. // "sortOrder": {
  35624. // "default": "ASCENDING",
  35625. // "description": "Order of sorted results.",
  35626. // "enum": [
  35627. // "ASCENDING",
  35628. // "DESCENDING"
  35629. // ],
  35630. // "enumDescriptions": [
  35631. // "",
  35632. // ""
  35633. // ],
  35634. // "location": "query",
  35635. // "type": "string"
  35636. // }
  35637. // },
  35638. // "path": "userprofiles/{profileId}/placements",
  35639. // "response": {
  35640. // "$ref": "PlacementsListResponse"
  35641. // },
  35642. // "scopes": [
  35643. // "https://www.googleapis.com/auth/dfatrafficking"
  35644. // ]
  35645. // }
  35646. }
  35647. // Pages invokes f for each page of results.
  35648. // A non-nil error returned from f will halt the iteration.
  35649. // The provided context supersedes any context provided to the Context method.
  35650. func (c *PlacementsListCall) Pages(ctx context.Context, f func(*PlacementsListResponse) error) error {
  35651. c.ctx_ = ctx
  35652. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  35653. for {
  35654. x, err := c.Do()
  35655. if err != nil {
  35656. return err
  35657. }
  35658. if err := f(x); err != nil {
  35659. return err
  35660. }
  35661. if x.NextPageToken == "" {
  35662. return nil
  35663. }
  35664. c.PageToken(x.NextPageToken)
  35665. }
  35666. }
  35667. // method id "dfareporting.placements.patch":
  35668. type PlacementsPatchCall struct {
  35669. s *Service
  35670. profileId int64
  35671. placement *Placement
  35672. urlParams_ gensupport.URLParams
  35673. ctx_ context.Context
  35674. header_ http.Header
  35675. }
  35676. // Patch: Updates an existing placement. This method supports patch
  35677. // semantics.
  35678. func (r *PlacementsService) Patch(profileId int64, id int64, placement *Placement) *PlacementsPatchCall {
  35679. c := &PlacementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35680. c.profileId = profileId
  35681. c.urlParams_.Set("id", fmt.Sprint(id))
  35682. c.placement = placement
  35683. return c
  35684. }
  35685. // Fields allows partial responses to be retrieved. See
  35686. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35687. // for more information.
  35688. func (c *PlacementsPatchCall) Fields(s ...googleapi.Field) *PlacementsPatchCall {
  35689. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35690. return c
  35691. }
  35692. // Context sets the context to be used in this call's Do method. Any
  35693. // pending HTTP request will be aborted if the provided context is
  35694. // canceled.
  35695. func (c *PlacementsPatchCall) Context(ctx context.Context) *PlacementsPatchCall {
  35696. c.ctx_ = ctx
  35697. return c
  35698. }
  35699. // Header returns an http.Header that can be modified by the caller to
  35700. // add HTTP headers to the request.
  35701. func (c *PlacementsPatchCall) Header() http.Header {
  35702. if c.header_ == nil {
  35703. c.header_ = make(http.Header)
  35704. }
  35705. return c.header_
  35706. }
  35707. func (c *PlacementsPatchCall) doRequest(alt string) (*http.Response, error) {
  35708. reqHeaders := make(http.Header)
  35709. for k, v := range c.header_ {
  35710. reqHeaders[k] = v
  35711. }
  35712. reqHeaders.Set("User-Agent", c.s.userAgent())
  35713. var body io.Reader = nil
  35714. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  35715. if err != nil {
  35716. return nil, err
  35717. }
  35718. reqHeaders.Set("Content-Type", "application/json")
  35719. c.urlParams_.Set("alt", alt)
  35720. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35721. urls += "?" + c.urlParams_.Encode()
  35722. req, _ := http.NewRequest("PATCH", urls, body)
  35723. req.Header = reqHeaders
  35724. googleapi.Expand(req.URL, map[string]string{
  35725. "profileId": strconv.FormatInt(c.profileId, 10),
  35726. })
  35727. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35728. }
  35729. // Do executes the "dfareporting.placements.patch" call.
  35730. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35731. // status code is an error. Response headers are in either
  35732. // *Placement.ServerResponse.Header or (if a response was returned at
  35733. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35734. // to check whether the returned error was because
  35735. // http.StatusNotModified was returned.
  35736. func (c *PlacementsPatchCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35737. gensupport.SetOptions(c.urlParams_, opts...)
  35738. res, err := c.doRequest("json")
  35739. if res != nil && res.StatusCode == http.StatusNotModified {
  35740. if res.Body != nil {
  35741. res.Body.Close()
  35742. }
  35743. return nil, &googleapi.Error{
  35744. Code: res.StatusCode,
  35745. Header: res.Header,
  35746. }
  35747. }
  35748. if err != nil {
  35749. return nil, err
  35750. }
  35751. defer googleapi.CloseBody(res)
  35752. if err := googleapi.CheckResponse(res); err != nil {
  35753. return nil, err
  35754. }
  35755. ret := &Placement{
  35756. ServerResponse: googleapi.ServerResponse{
  35757. Header: res.Header,
  35758. HTTPStatusCode: res.StatusCode,
  35759. },
  35760. }
  35761. target := &ret
  35762. if err := gensupport.DecodeResponse(target, res); err != nil {
  35763. return nil, err
  35764. }
  35765. return ret, nil
  35766. // {
  35767. // "description": "Updates an existing placement. This method supports patch semantics.",
  35768. // "httpMethod": "PATCH",
  35769. // "id": "dfareporting.placements.patch",
  35770. // "parameterOrder": [
  35771. // "profileId",
  35772. // "id"
  35773. // ],
  35774. // "parameters": {
  35775. // "id": {
  35776. // "description": "Placement ID.",
  35777. // "format": "int64",
  35778. // "location": "query",
  35779. // "required": true,
  35780. // "type": "string"
  35781. // },
  35782. // "profileId": {
  35783. // "description": "User profile ID associated with this request.",
  35784. // "format": "int64",
  35785. // "location": "path",
  35786. // "required": true,
  35787. // "type": "string"
  35788. // }
  35789. // },
  35790. // "path": "userprofiles/{profileId}/placements",
  35791. // "request": {
  35792. // "$ref": "Placement"
  35793. // },
  35794. // "response": {
  35795. // "$ref": "Placement"
  35796. // },
  35797. // "scopes": [
  35798. // "https://www.googleapis.com/auth/dfatrafficking"
  35799. // ]
  35800. // }
  35801. }
  35802. // method id "dfareporting.placements.update":
  35803. type PlacementsUpdateCall struct {
  35804. s *Service
  35805. profileId int64
  35806. placement *Placement
  35807. urlParams_ gensupport.URLParams
  35808. ctx_ context.Context
  35809. header_ http.Header
  35810. }
  35811. // Update: Updates an existing placement.
  35812. func (r *PlacementsService) Update(profileId int64, placement *Placement) *PlacementsUpdateCall {
  35813. c := &PlacementsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35814. c.profileId = profileId
  35815. c.placement = placement
  35816. return c
  35817. }
  35818. // Fields allows partial responses to be retrieved. See
  35819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35820. // for more information.
  35821. func (c *PlacementsUpdateCall) Fields(s ...googleapi.Field) *PlacementsUpdateCall {
  35822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35823. return c
  35824. }
  35825. // Context sets the context to be used in this call's Do method. Any
  35826. // pending HTTP request will be aborted if the provided context is
  35827. // canceled.
  35828. func (c *PlacementsUpdateCall) Context(ctx context.Context) *PlacementsUpdateCall {
  35829. c.ctx_ = ctx
  35830. return c
  35831. }
  35832. // Header returns an http.Header that can be modified by the caller to
  35833. // add HTTP headers to the request.
  35834. func (c *PlacementsUpdateCall) Header() http.Header {
  35835. if c.header_ == nil {
  35836. c.header_ = make(http.Header)
  35837. }
  35838. return c.header_
  35839. }
  35840. func (c *PlacementsUpdateCall) doRequest(alt string) (*http.Response, error) {
  35841. reqHeaders := make(http.Header)
  35842. for k, v := range c.header_ {
  35843. reqHeaders[k] = v
  35844. }
  35845. reqHeaders.Set("User-Agent", c.s.userAgent())
  35846. var body io.Reader = nil
  35847. body, err := googleapi.WithoutDataWrapper.JSONReader(c.placement)
  35848. if err != nil {
  35849. return nil, err
  35850. }
  35851. reqHeaders.Set("Content-Type", "application/json")
  35852. c.urlParams_.Set("alt", alt)
  35853. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/placements")
  35854. urls += "?" + c.urlParams_.Encode()
  35855. req, _ := http.NewRequest("PUT", urls, body)
  35856. req.Header = reqHeaders
  35857. googleapi.Expand(req.URL, map[string]string{
  35858. "profileId": strconv.FormatInt(c.profileId, 10),
  35859. })
  35860. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35861. }
  35862. // Do executes the "dfareporting.placements.update" call.
  35863. // Exactly one of *Placement or error will be non-nil. Any non-2xx
  35864. // status code is an error. Response headers are in either
  35865. // *Placement.ServerResponse.Header or (if a response was returned at
  35866. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  35867. // to check whether the returned error was because
  35868. // http.StatusNotModified was returned.
  35869. func (c *PlacementsUpdateCall) Do(opts ...googleapi.CallOption) (*Placement, error) {
  35870. gensupport.SetOptions(c.urlParams_, opts...)
  35871. res, err := c.doRequest("json")
  35872. if res != nil && res.StatusCode == http.StatusNotModified {
  35873. if res.Body != nil {
  35874. res.Body.Close()
  35875. }
  35876. return nil, &googleapi.Error{
  35877. Code: res.StatusCode,
  35878. Header: res.Header,
  35879. }
  35880. }
  35881. if err != nil {
  35882. return nil, err
  35883. }
  35884. defer googleapi.CloseBody(res)
  35885. if err := googleapi.CheckResponse(res); err != nil {
  35886. return nil, err
  35887. }
  35888. ret := &Placement{
  35889. ServerResponse: googleapi.ServerResponse{
  35890. Header: res.Header,
  35891. HTTPStatusCode: res.StatusCode,
  35892. },
  35893. }
  35894. target := &ret
  35895. if err := gensupport.DecodeResponse(target, res); err != nil {
  35896. return nil, err
  35897. }
  35898. return ret, nil
  35899. // {
  35900. // "description": "Updates an existing placement.",
  35901. // "httpMethod": "PUT",
  35902. // "id": "dfareporting.placements.update",
  35903. // "parameterOrder": [
  35904. // "profileId"
  35905. // ],
  35906. // "parameters": {
  35907. // "profileId": {
  35908. // "description": "User profile ID associated with this request.",
  35909. // "format": "int64",
  35910. // "location": "path",
  35911. // "required": true,
  35912. // "type": "string"
  35913. // }
  35914. // },
  35915. // "path": "userprofiles/{profileId}/placements",
  35916. // "request": {
  35917. // "$ref": "Placement"
  35918. // },
  35919. // "response": {
  35920. // "$ref": "Placement"
  35921. // },
  35922. // "scopes": [
  35923. // "https://www.googleapis.com/auth/dfatrafficking"
  35924. // ]
  35925. // }
  35926. }
  35927. // method id "dfareporting.platformTypes.get":
  35928. type PlatformTypesGetCall struct {
  35929. s *Service
  35930. profileId int64
  35931. id int64
  35932. urlParams_ gensupport.URLParams
  35933. ifNoneMatch_ string
  35934. ctx_ context.Context
  35935. header_ http.Header
  35936. }
  35937. // Get: Gets one platform type by ID.
  35938. func (r *PlatformTypesService) Get(profileId int64, id int64) *PlatformTypesGetCall {
  35939. c := &PlatformTypesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  35940. c.profileId = profileId
  35941. c.id = id
  35942. return c
  35943. }
  35944. // Fields allows partial responses to be retrieved. See
  35945. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  35946. // for more information.
  35947. func (c *PlatformTypesGetCall) Fields(s ...googleapi.Field) *PlatformTypesGetCall {
  35948. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  35949. return c
  35950. }
  35951. // IfNoneMatch sets the optional parameter which makes the operation
  35952. // fail if the object's ETag matches the given value. This is useful for
  35953. // getting updates only after the object has changed since the last
  35954. // request. Use googleapi.IsNotModified to check whether the response
  35955. // error from Do is the result of In-None-Match.
  35956. func (c *PlatformTypesGetCall) IfNoneMatch(entityTag string) *PlatformTypesGetCall {
  35957. c.ifNoneMatch_ = entityTag
  35958. return c
  35959. }
  35960. // Context sets the context to be used in this call's Do method. Any
  35961. // pending HTTP request will be aborted if the provided context is
  35962. // canceled.
  35963. func (c *PlatformTypesGetCall) Context(ctx context.Context) *PlatformTypesGetCall {
  35964. c.ctx_ = ctx
  35965. return c
  35966. }
  35967. // Header returns an http.Header that can be modified by the caller to
  35968. // add HTTP headers to the request.
  35969. func (c *PlatformTypesGetCall) Header() http.Header {
  35970. if c.header_ == nil {
  35971. c.header_ = make(http.Header)
  35972. }
  35973. return c.header_
  35974. }
  35975. func (c *PlatformTypesGetCall) doRequest(alt string) (*http.Response, error) {
  35976. reqHeaders := make(http.Header)
  35977. for k, v := range c.header_ {
  35978. reqHeaders[k] = v
  35979. }
  35980. reqHeaders.Set("User-Agent", c.s.userAgent())
  35981. if c.ifNoneMatch_ != "" {
  35982. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  35983. }
  35984. var body io.Reader = nil
  35985. c.urlParams_.Set("alt", alt)
  35986. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes/{id}")
  35987. urls += "?" + c.urlParams_.Encode()
  35988. req, _ := http.NewRequest("GET", urls, body)
  35989. req.Header = reqHeaders
  35990. googleapi.Expand(req.URL, map[string]string{
  35991. "profileId": strconv.FormatInt(c.profileId, 10),
  35992. "id": strconv.FormatInt(c.id, 10),
  35993. })
  35994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  35995. }
  35996. // Do executes the "dfareporting.platformTypes.get" call.
  35997. // Exactly one of *PlatformType or error will be non-nil. Any non-2xx
  35998. // status code is an error. Response headers are in either
  35999. // *PlatformType.ServerResponse.Header or (if a response was returned at
  36000. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36001. // to check whether the returned error was because
  36002. // http.StatusNotModified was returned.
  36003. func (c *PlatformTypesGetCall) Do(opts ...googleapi.CallOption) (*PlatformType, error) {
  36004. gensupport.SetOptions(c.urlParams_, opts...)
  36005. res, err := c.doRequest("json")
  36006. if res != nil && res.StatusCode == http.StatusNotModified {
  36007. if res.Body != nil {
  36008. res.Body.Close()
  36009. }
  36010. return nil, &googleapi.Error{
  36011. Code: res.StatusCode,
  36012. Header: res.Header,
  36013. }
  36014. }
  36015. if err != nil {
  36016. return nil, err
  36017. }
  36018. defer googleapi.CloseBody(res)
  36019. if err := googleapi.CheckResponse(res); err != nil {
  36020. return nil, err
  36021. }
  36022. ret := &PlatformType{
  36023. ServerResponse: googleapi.ServerResponse{
  36024. Header: res.Header,
  36025. HTTPStatusCode: res.StatusCode,
  36026. },
  36027. }
  36028. target := &ret
  36029. if err := gensupport.DecodeResponse(target, res); err != nil {
  36030. return nil, err
  36031. }
  36032. return ret, nil
  36033. // {
  36034. // "description": "Gets one platform type by ID.",
  36035. // "httpMethod": "GET",
  36036. // "id": "dfareporting.platformTypes.get",
  36037. // "parameterOrder": [
  36038. // "profileId",
  36039. // "id"
  36040. // ],
  36041. // "parameters": {
  36042. // "id": {
  36043. // "description": "Platform type ID.",
  36044. // "format": "int64",
  36045. // "location": "path",
  36046. // "required": true,
  36047. // "type": "string"
  36048. // },
  36049. // "profileId": {
  36050. // "description": "User profile ID associated with this request.",
  36051. // "format": "int64",
  36052. // "location": "path",
  36053. // "required": true,
  36054. // "type": "string"
  36055. // }
  36056. // },
  36057. // "path": "userprofiles/{profileId}/platformTypes/{id}",
  36058. // "response": {
  36059. // "$ref": "PlatformType"
  36060. // },
  36061. // "scopes": [
  36062. // "https://www.googleapis.com/auth/dfatrafficking"
  36063. // ]
  36064. // }
  36065. }
  36066. // method id "dfareporting.platformTypes.list":
  36067. type PlatformTypesListCall struct {
  36068. s *Service
  36069. profileId int64
  36070. urlParams_ gensupport.URLParams
  36071. ifNoneMatch_ string
  36072. ctx_ context.Context
  36073. header_ http.Header
  36074. }
  36075. // List: Retrieves a list of platform types.
  36076. func (r *PlatformTypesService) List(profileId int64) *PlatformTypesListCall {
  36077. c := &PlatformTypesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36078. c.profileId = profileId
  36079. return c
  36080. }
  36081. // Fields allows partial responses to be retrieved. See
  36082. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36083. // for more information.
  36084. func (c *PlatformTypesListCall) Fields(s ...googleapi.Field) *PlatformTypesListCall {
  36085. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36086. return c
  36087. }
  36088. // IfNoneMatch sets the optional parameter which makes the operation
  36089. // fail if the object's ETag matches the given value. This is useful for
  36090. // getting updates only after the object has changed since the last
  36091. // request. Use googleapi.IsNotModified to check whether the response
  36092. // error from Do is the result of In-None-Match.
  36093. func (c *PlatformTypesListCall) IfNoneMatch(entityTag string) *PlatformTypesListCall {
  36094. c.ifNoneMatch_ = entityTag
  36095. return c
  36096. }
  36097. // Context sets the context to be used in this call's Do method. Any
  36098. // pending HTTP request will be aborted if the provided context is
  36099. // canceled.
  36100. func (c *PlatformTypesListCall) Context(ctx context.Context) *PlatformTypesListCall {
  36101. c.ctx_ = ctx
  36102. return c
  36103. }
  36104. // Header returns an http.Header that can be modified by the caller to
  36105. // add HTTP headers to the request.
  36106. func (c *PlatformTypesListCall) Header() http.Header {
  36107. if c.header_ == nil {
  36108. c.header_ = make(http.Header)
  36109. }
  36110. return c.header_
  36111. }
  36112. func (c *PlatformTypesListCall) doRequest(alt string) (*http.Response, error) {
  36113. reqHeaders := make(http.Header)
  36114. for k, v := range c.header_ {
  36115. reqHeaders[k] = v
  36116. }
  36117. reqHeaders.Set("User-Agent", c.s.userAgent())
  36118. if c.ifNoneMatch_ != "" {
  36119. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36120. }
  36121. var body io.Reader = nil
  36122. c.urlParams_.Set("alt", alt)
  36123. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/platformTypes")
  36124. urls += "?" + c.urlParams_.Encode()
  36125. req, _ := http.NewRequest("GET", urls, body)
  36126. req.Header = reqHeaders
  36127. googleapi.Expand(req.URL, map[string]string{
  36128. "profileId": strconv.FormatInt(c.profileId, 10),
  36129. })
  36130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36131. }
  36132. // Do executes the "dfareporting.platformTypes.list" call.
  36133. // Exactly one of *PlatformTypesListResponse or error will be non-nil.
  36134. // Any non-2xx status code is an error. Response headers are in either
  36135. // *PlatformTypesListResponse.ServerResponse.Header or (if a response
  36136. // was returned at all) in error.(*googleapi.Error).Header. Use
  36137. // googleapi.IsNotModified to check whether the returned error was
  36138. // because http.StatusNotModified was returned.
  36139. func (c *PlatformTypesListCall) Do(opts ...googleapi.CallOption) (*PlatformTypesListResponse, error) {
  36140. gensupport.SetOptions(c.urlParams_, opts...)
  36141. res, err := c.doRequest("json")
  36142. if res != nil && res.StatusCode == http.StatusNotModified {
  36143. if res.Body != nil {
  36144. res.Body.Close()
  36145. }
  36146. return nil, &googleapi.Error{
  36147. Code: res.StatusCode,
  36148. Header: res.Header,
  36149. }
  36150. }
  36151. if err != nil {
  36152. return nil, err
  36153. }
  36154. defer googleapi.CloseBody(res)
  36155. if err := googleapi.CheckResponse(res); err != nil {
  36156. return nil, err
  36157. }
  36158. ret := &PlatformTypesListResponse{
  36159. ServerResponse: googleapi.ServerResponse{
  36160. Header: res.Header,
  36161. HTTPStatusCode: res.StatusCode,
  36162. },
  36163. }
  36164. target := &ret
  36165. if err := gensupport.DecodeResponse(target, res); err != nil {
  36166. return nil, err
  36167. }
  36168. return ret, nil
  36169. // {
  36170. // "description": "Retrieves a list of platform types.",
  36171. // "httpMethod": "GET",
  36172. // "id": "dfareporting.platformTypes.list",
  36173. // "parameterOrder": [
  36174. // "profileId"
  36175. // ],
  36176. // "parameters": {
  36177. // "profileId": {
  36178. // "description": "User profile ID associated with this request.",
  36179. // "format": "int64",
  36180. // "location": "path",
  36181. // "required": true,
  36182. // "type": "string"
  36183. // }
  36184. // },
  36185. // "path": "userprofiles/{profileId}/platformTypes",
  36186. // "response": {
  36187. // "$ref": "PlatformTypesListResponse"
  36188. // },
  36189. // "scopes": [
  36190. // "https://www.googleapis.com/auth/dfatrafficking"
  36191. // ]
  36192. // }
  36193. }
  36194. // method id "dfareporting.postalCodes.get":
  36195. type PostalCodesGetCall struct {
  36196. s *Service
  36197. profileId int64
  36198. code string
  36199. urlParams_ gensupport.URLParams
  36200. ifNoneMatch_ string
  36201. ctx_ context.Context
  36202. header_ http.Header
  36203. }
  36204. // Get: Gets one postal code by ID.
  36205. func (r *PostalCodesService) Get(profileId int64, code string) *PostalCodesGetCall {
  36206. c := &PostalCodesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36207. c.profileId = profileId
  36208. c.code = code
  36209. return c
  36210. }
  36211. // Fields allows partial responses to be retrieved. See
  36212. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36213. // for more information.
  36214. func (c *PostalCodesGetCall) Fields(s ...googleapi.Field) *PostalCodesGetCall {
  36215. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36216. return c
  36217. }
  36218. // IfNoneMatch sets the optional parameter which makes the operation
  36219. // fail if the object's ETag matches the given value. This is useful for
  36220. // getting updates only after the object has changed since the last
  36221. // request. Use googleapi.IsNotModified to check whether the response
  36222. // error from Do is the result of In-None-Match.
  36223. func (c *PostalCodesGetCall) IfNoneMatch(entityTag string) *PostalCodesGetCall {
  36224. c.ifNoneMatch_ = entityTag
  36225. return c
  36226. }
  36227. // Context sets the context to be used in this call's Do method. Any
  36228. // pending HTTP request will be aborted if the provided context is
  36229. // canceled.
  36230. func (c *PostalCodesGetCall) Context(ctx context.Context) *PostalCodesGetCall {
  36231. c.ctx_ = ctx
  36232. return c
  36233. }
  36234. // Header returns an http.Header that can be modified by the caller to
  36235. // add HTTP headers to the request.
  36236. func (c *PostalCodesGetCall) Header() http.Header {
  36237. if c.header_ == nil {
  36238. c.header_ = make(http.Header)
  36239. }
  36240. return c.header_
  36241. }
  36242. func (c *PostalCodesGetCall) doRequest(alt string) (*http.Response, error) {
  36243. reqHeaders := make(http.Header)
  36244. for k, v := range c.header_ {
  36245. reqHeaders[k] = v
  36246. }
  36247. reqHeaders.Set("User-Agent", c.s.userAgent())
  36248. if c.ifNoneMatch_ != "" {
  36249. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36250. }
  36251. var body io.Reader = nil
  36252. c.urlParams_.Set("alt", alt)
  36253. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes/{code}")
  36254. urls += "?" + c.urlParams_.Encode()
  36255. req, _ := http.NewRequest("GET", urls, body)
  36256. req.Header = reqHeaders
  36257. googleapi.Expand(req.URL, map[string]string{
  36258. "profileId": strconv.FormatInt(c.profileId, 10),
  36259. "code": c.code,
  36260. })
  36261. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36262. }
  36263. // Do executes the "dfareporting.postalCodes.get" call.
  36264. // Exactly one of *PostalCode or error will be non-nil. Any non-2xx
  36265. // status code is an error. Response headers are in either
  36266. // *PostalCode.ServerResponse.Header or (if a response was returned at
  36267. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  36268. // to check whether the returned error was because
  36269. // http.StatusNotModified was returned.
  36270. func (c *PostalCodesGetCall) Do(opts ...googleapi.CallOption) (*PostalCode, error) {
  36271. gensupport.SetOptions(c.urlParams_, opts...)
  36272. res, err := c.doRequest("json")
  36273. if res != nil && res.StatusCode == http.StatusNotModified {
  36274. if res.Body != nil {
  36275. res.Body.Close()
  36276. }
  36277. return nil, &googleapi.Error{
  36278. Code: res.StatusCode,
  36279. Header: res.Header,
  36280. }
  36281. }
  36282. if err != nil {
  36283. return nil, err
  36284. }
  36285. defer googleapi.CloseBody(res)
  36286. if err := googleapi.CheckResponse(res); err != nil {
  36287. return nil, err
  36288. }
  36289. ret := &PostalCode{
  36290. ServerResponse: googleapi.ServerResponse{
  36291. Header: res.Header,
  36292. HTTPStatusCode: res.StatusCode,
  36293. },
  36294. }
  36295. target := &ret
  36296. if err := gensupport.DecodeResponse(target, res); err != nil {
  36297. return nil, err
  36298. }
  36299. return ret, nil
  36300. // {
  36301. // "description": "Gets one postal code by ID.",
  36302. // "httpMethod": "GET",
  36303. // "id": "dfareporting.postalCodes.get",
  36304. // "parameterOrder": [
  36305. // "profileId",
  36306. // "code"
  36307. // ],
  36308. // "parameters": {
  36309. // "code": {
  36310. // "description": "Postal code ID.",
  36311. // "location": "path",
  36312. // "required": true,
  36313. // "type": "string"
  36314. // },
  36315. // "profileId": {
  36316. // "description": "User profile ID associated with this request.",
  36317. // "format": "int64",
  36318. // "location": "path",
  36319. // "required": true,
  36320. // "type": "string"
  36321. // }
  36322. // },
  36323. // "path": "userprofiles/{profileId}/postalCodes/{code}",
  36324. // "response": {
  36325. // "$ref": "PostalCode"
  36326. // },
  36327. // "scopes": [
  36328. // "https://www.googleapis.com/auth/dfatrafficking"
  36329. // ]
  36330. // }
  36331. }
  36332. // method id "dfareporting.postalCodes.list":
  36333. type PostalCodesListCall struct {
  36334. s *Service
  36335. profileId int64
  36336. urlParams_ gensupport.URLParams
  36337. ifNoneMatch_ string
  36338. ctx_ context.Context
  36339. header_ http.Header
  36340. }
  36341. // List: Retrieves a list of postal codes.
  36342. func (r *PostalCodesService) List(profileId int64) *PostalCodesListCall {
  36343. c := &PostalCodesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36344. c.profileId = profileId
  36345. return c
  36346. }
  36347. // Fields allows partial responses to be retrieved. See
  36348. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36349. // for more information.
  36350. func (c *PostalCodesListCall) Fields(s ...googleapi.Field) *PostalCodesListCall {
  36351. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36352. return c
  36353. }
  36354. // IfNoneMatch sets the optional parameter which makes the operation
  36355. // fail if the object's ETag matches the given value. This is useful for
  36356. // getting updates only after the object has changed since the last
  36357. // request. Use googleapi.IsNotModified to check whether the response
  36358. // error from Do is the result of In-None-Match.
  36359. func (c *PostalCodesListCall) IfNoneMatch(entityTag string) *PostalCodesListCall {
  36360. c.ifNoneMatch_ = entityTag
  36361. return c
  36362. }
  36363. // Context sets the context to be used in this call's Do method. Any
  36364. // pending HTTP request will be aborted if the provided context is
  36365. // canceled.
  36366. func (c *PostalCodesListCall) Context(ctx context.Context) *PostalCodesListCall {
  36367. c.ctx_ = ctx
  36368. return c
  36369. }
  36370. // Header returns an http.Header that can be modified by the caller to
  36371. // add HTTP headers to the request.
  36372. func (c *PostalCodesListCall) Header() http.Header {
  36373. if c.header_ == nil {
  36374. c.header_ = make(http.Header)
  36375. }
  36376. return c.header_
  36377. }
  36378. func (c *PostalCodesListCall) doRequest(alt string) (*http.Response, error) {
  36379. reqHeaders := make(http.Header)
  36380. for k, v := range c.header_ {
  36381. reqHeaders[k] = v
  36382. }
  36383. reqHeaders.Set("User-Agent", c.s.userAgent())
  36384. if c.ifNoneMatch_ != "" {
  36385. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36386. }
  36387. var body io.Reader = nil
  36388. c.urlParams_.Set("alt", alt)
  36389. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/postalCodes")
  36390. urls += "?" + c.urlParams_.Encode()
  36391. req, _ := http.NewRequest("GET", urls, body)
  36392. req.Header = reqHeaders
  36393. googleapi.Expand(req.URL, map[string]string{
  36394. "profileId": strconv.FormatInt(c.profileId, 10),
  36395. })
  36396. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36397. }
  36398. // Do executes the "dfareporting.postalCodes.list" call.
  36399. // Exactly one of *PostalCodesListResponse or error will be non-nil. Any
  36400. // non-2xx status code is an error. Response headers are in either
  36401. // *PostalCodesListResponse.ServerResponse.Header or (if a response was
  36402. // returned at all) in error.(*googleapi.Error).Header. Use
  36403. // googleapi.IsNotModified to check whether the returned error was
  36404. // because http.StatusNotModified was returned.
  36405. func (c *PostalCodesListCall) Do(opts ...googleapi.CallOption) (*PostalCodesListResponse, error) {
  36406. gensupport.SetOptions(c.urlParams_, opts...)
  36407. res, err := c.doRequest("json")
  36408. if res != nil && res.StatusCode == http.StatusNotModified {
  36409. if res.Body != nil {
  36410. res.Body.Close()
  36411. }
  36412. return nil, &googleapi.Error{
  36413. Code: res.StatusCode,
  36414. Header: res.Header,
  36415. }
  36416. }
  36417. if err != nil {
  36418. return nil, err
  36419. }
  36420. defer googleapi.CloseBody(res)
  36421. if err := googleapi.CheckResponse(res); err != nil {
  36422. return nil, err
  36423. }
  36424. ret := &PostalCodesListResponse{
  36425. ServerResponse: googleapi.ServerResponse{
  36426. Header: res.Header,
  36427. HTTPStatusCode: res.StatusCode,
  36428. },
  36429. }
  36430. target := &ret
  36431. if err := gensupport.DecodeResponse(target, res); err != nil {
  36432. return nil, err
  36433. }
  36434. return ret, nil
  36435. // {
  36436. // "description": "Retrieves a list of postal codes.",
  36437. // "httpMethod": "GET",
  36438. // "id": "dfareporting.postalCodes.list",
  36439. // "parameterOrder": [
  36440. // "profileId"
  36441. // ],
  36442. // "parameters": {
  36443. // "profileId": {
  36444. // "description": "User profile ID associated with this request.",
  36445. // "format": "int64",
  36446. // "location": "path",
  36447. // "required": true,
  36448. // "type": "string"
  36449. // }
  36450. // },
  36451. // "path": "userprofiles/{profileId}/postalCodes",
  36452. // "response": {
  36453. // "$ref": "PostalCodesListResponse"
  36454. // },
  36455. // "scopes": [
  36456. // "https://www.googleapis.com/auth/dfatrafficking"
  36457. // ]
  36458. // }
  36459. }
  36460. // method id "dfareporting.projects.get":
  36461. type ProjectsGetCall struct {
  36462. s *Service
  36463. profileId int64
  36464. id int64
  36465. urlParams_ gensupport.URLParams
  36466. ifNoneMatch_ string
  36467. ctx_ context.Context
  36468. header_ http.Header
  36469. }
  36470. // Get: Gets one project by ID.
  36471. func (r *ProjectsService) Get(profileId int64, id int64) *ProjectsGetCall {
  36472. c := &ProjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36473. c.profileId = profileId
  36474. c.id = id
  36475. return c
  36476. }
  36477. // Fields allows partial responses to be retrieved. See
  36478. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36479. // for more information.
  36480. func (c *ProjectsGetCall) Fields(s ...googleapi.Field) *ProjectsGetCall {
  36481. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36482. return c
  36483. }
  36484. // IfNoneMatch sets the optional parameter which makes the operation
  36485. // fail if the object's ETag matches the given value. This is useful for
  36486. // getting updates only after the object has changed since the last
  36487. // request. Use googleapi.IsNotModified to check whether the response
  36488. // error from Do is the result of In-None-Match.
  36489. func (c *ProjectsGetCall) IfNoneMatch(entityTag string) *ProjectsGetCall {
  36490. c.ifNoneMatch_ = entityTag
  36491. return c
  36492. }
  36493. // Context sets the context to be used in this call's Do method. Any
  36494. // pending HTTP request will be aborted if the provided context is
  36495. // canceled.
  36496. func (c *ProjectsGetCall) Context(ctx context.Context) *ProjectsGetCall {
  36497. c.ctx_ = ctx
  36498. return c
  36499. }
  36500. // Header returns an http.Header that can be modified by the caller to
  36501. // add HTTP headers to the request.
  36502. func (c *ProjectsGetCall) Header() http.Header {
  36503. if c.header_ == nil {
  36504. c.header_ = make(http.Header)
  36505. }
  36506. return c.header_
  36507. }
  36508. func (c *ProjectsGetCall) doRequest(alt string) (*http.Response, error) {
  36509. reqHeaders := make(http.Header)
  36510. for k, v := range c.header_ {
  36511. reqHeaders[k] = v
  36512. }
  36513. reqHeaders.Set("User-Agent", c.s.userAgent())
  36514. if c.ifNoneMatch_ != "" {
  36515. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36516. }
  36517. var body io.Reader = nil
  36518. c.urlParams_.Set("alt", alt)
  36519. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects/{id}")
  36520. urls += "?" + c.urlParams_.Encode()
  36521. req, _ := http.NewRequest("GET", urls, body)
  36522. req.Header = reqHeaders
  36523. googleapi.Expand(req.URL, map[string]string{
  36524. "profileId": strconv.FormatInt(c.profileId, 10),
  36525. "id": strconv.FormatInt(c.id, 10),
  36526. })
  36527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36528. }
  36529. // Do executes the "dfareporting.projects.get" call.
  36530. // Exactly one of *Project or error will be non-nil. Any non-2xx status
  36531. // code is an error. Response headers are in either
  36532. // *Project.ServerResponse.Header or (if a response was returned at all)
  36533. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  36534. // check whether the returned error was because http.StatusNotModified
  36535. // was returned.
  36536. func (c *ProjectsGetCall) Do(opts ...googleapi.CallOption) (*Project, error) {
  36537. gensupport.SetOptions(c.urlParams_, opts...)
  36538. res, err := c.doRequest("json")
  36539. if res != nil && res.StatusCode == http.StatusNotModified {
  36540. if res.Body != nil {
  36541. res.Body.Close()
  36542. }
  36543. return nil, &googleapi.Error{
  36544. Code: res.StatusCode,
  36545. Header: res.Header,
  36546. }
  36547. }
  36548. if err != nil {
  36549. return nil, err
  36550. }
  36551. defer googleapi.CloseBody(res)
  36552. if err := googleapi.CheckResponse(res); err != nil {
  36553. return nil, err
  36554. }
  36555. ret := &Project{
  36556. ServerResponse: googleapi.ServerResponse{
  36557. Header: res.Header,
  36558. HTTPStatusCode: res.StatusCode,
  36559. },
  36560. }
  36561. target := &ret
  36562. if err := gensupport.DecodeResponse(target, res); err != nil {
  36563. return nil, err
  36564. }
  36565. return ret, nil
  36566. // {
  36567. // "description": "Gets one project by ID.",
  36568. // "httpMethod": "GET",
  36569. // "id": "dfareporting.projects.get",
  36570. // "parameterOrder": [
  36571. // "profileId",
  36572. // "id"
  36573. // ],
  36574. // "parameters": {
  36575. // "id": {
  36576. // "description": "Project ID.",
  36577. // "format": "int64",
  36578. // "location": "path",
  36579. // "required": true,
  36580. // "type": "string"
  36581. // },
  36582. // "profileId": {
  36583. // "description": "User profile ID associated with this request.",
  36584. // "format": "int64",
  36585. // "location": "path",
  36586. // "required": true,
  36587. // "type": "string"
  36588. // }
  36589. // },
  36590. // "path": "userprofiles/{profileId}/projects/{id}",
  36591. // "response": {
  36592. // "$ref": "Project"
  36593. // },
  36594. // "scopes": [
  36595. // "https://www.googleapis.com/auth/dfatrafficking"
  36596. // ]
  36597. // }
  36598. }
  36599. // method id "dfareporting.projects.list":
  36600. type ProjectsListCall struct {
  36601. s *Service
  36602. profileId int64
  36603. urlParams_ gensupport.URLParams
  36604. ifNoneMatch_ string
  36605. ctx_ context.Context
  36606. header_ http.Header
  36607. }
  36608. // List: Retrieves a list of projects, possibly filtered. This method
  36609. // supports paging.
  36610. func (r *ProjectsService) List(profileId int64) *ProjectsListCall {
  36611. c := &ProjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36612. c.profileId = profileId
  36613. return c
  36614. }
  36615. // AdvertiserIds sets the optional parameter "advertiserIds": Select
  36616. // only projects with these advertiser IDs.
  36617. func (c *ProjectsListCall) AdvertiserIds(advertiserIds ...int64) *ProjectsListCall {
  36618. var advertiserIds_ []string
  36619. for _, v := range advertiserIds {
  36620. advertiserIds_ = append(advertiserIds_, fmt.Sprint(v))
  36621. }
  36622. c.urlParams_.SetMulti("advertiserIds", advertiserIds_)
  36623. return c
  36624. }
  36625. // Ids sets the optional parameter "ids": Select only projects with
  36626. // these IDs.
  36627. func (c *ProjectsListCall) Ids(ids ...int64) *ProjectsListCall {
  36628. var ids_ []string
  36629. for _, v := range ids {
  36630. ids_ = append(ids_, fmt.Sprint(v))
  36631. }
  36632. c.urlParams_.SetMulti("ids", ids_)
  36633. return c
  36634. }
  36635. // MaxResults sets the optional parameter "maxResults": Maximum number
  36636. // of results to return.
  36637. func (c *ProjectsListCall) MaxResults(maxResults int64) *ProjectsListCall {
  36638. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  36639. return c
  36640. }
  36641. // PageToken sets the optional parameter "pageToken": Value of the
  36642. // nextPageToken from the previous result page.
  36643. func (c *ProjectsListCall) PageToken(pageToken string) *ProjectsListCall {
  36644. c.urlParams_.Set("pageToken", pageToken)
  36645. return c
  36646. }
  36647. // SearchString sets the optional parameter "searchString": Allows
  36648. // searching for projects by name or ID. Wildcards (*) are allowed. For
  36649. // example, "project*2015" will return projects with names like "project
  36650. // June 2015", "project April 2015", or simply "project 2015". Most of
  36651. // the searches also add wildcards implicitly at the start and the end
  36652. // of the search string. For example, a search string of "project" will
  36653. // match projects with name "my project", "project 2015", or simply
  36654. // "project".
  36655. func (c *ProjectsListCall) SearchString(searchString string) *ProjectsListCall {
  36656. c.urlParams_.Set("searchString", searchString)
  36657. return c
  36658. }
  36659. // SortField sets the optional parameter "sortField": Field by which to
  36660. // sort the list.
  36661. //
  36662. // Possible values:
  36663. // "ID" (default)
  36664. // "NAME"
  36665. func (c *ProjectsListCall) SortField(sortField string) *ProjectsListCall {
  36666. c.urlParams_.Set("sortField", sortField)
  36667. return c
  36668. }
  36669. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  36670. // results.
  36671. //
  36672. // Possible values:
  36673. // "ASCENDING" (default)
  36674. // "DESCENDING"
  36675. func (c *ProjectsListCall) SortOrder(sortOrder string) *ProjectsListCall {
  36676. c.urlParams_.Set("sortOrder", sortOrder)
  36677. return c
  36678. }
  36679. // Fields allows partial responses to be retrieved. See
  36680. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36681. // for more information.
  36682. func (c *ProjectsListCall) Fields(s ...googleapi.Field) *ProjectsListCall {
  36683. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36684. return c
  36685. }
  36686. // IfNoneMatch sets the optional parameter which makes the operation
  36687. // fail if the object's ETag matches the given value. This is useful for
  36688. // getting updates only after the object has changed since the last
  36689. // request. Use googleapi.IsNotModified to check whether the response
  36690. // error from Do is the result of In-None-Match.
  36691. func (c *ProjectsListCall) IfNoneMatch(entityTag string) *ProjectsListCall {
  36692. c.ifNoneMatch_ = entityTag
  36693. return c
  36694. }
  36695. // Context sets the context to be used in this call's Do method. Any
  36696. // pending HTTP request will be aborted if the provided context is
  36697. // canceled.
  36698. func (c *ProjectsListCall) Context(ctx context.Context) *ProjectsListCall {
  36699. c.ctx_ = ctx
  36700. return c
  36701. }
  36702. // Header returns an http.Header that can be modified by the caller to
  36703. // add HTTP headers to the request.
  36704. func (c *ProjectsListCall) Header() http.Header {
  36705. if c.header_ == nil {
  36706. c.header_ = make(http.Header)
  36707. }
  36708. return c.header_
  36709. }
  36710. func (c *ProjectsListCall) doRequest(alt string) (*http.Response, error) {
  36711. reqHeaders := make(http.Header)
  36712. for k, v := range c.header_ {
  36713. reqHeaders[k] = v
  36714. }
  36715. reqHeaders.Set("User-Agent", c.s.userAgent())
  36716. if c.ifNoneMatch_ != "" {
  36717. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36718. }
  36719. var body io.Reader = nil
  36720. c.urlParams_.Set("alt", alt)
  36721. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/projects")
  36722. urls += "?" + c.urlParams_.Encode()
  36723. req, _ := http.NewRequest("GET", urls, body)
  36724. req.Header = reqHeaders
  36725. googleapi.Expand(req.URL, map[string]string{
  36726. "profileId": strconv.FormatInt(c.profileId, 10),
  36727. })
  36728. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36729. }
  36730. // Do executes the "dfareporting.projects.list" call.
  36731. // Exactly one of *ProjectsListResponse or error will be non-nil. Any
  36732. // non-2xx status code is an error. Response headers are in either
  36733. // *ProjectsListResponse.ServerResponse.Header or (if a response was
  36734. // returned at all) in error.(*googleapi.Error).Header. Use
  36735. // googleapi.IsNotModified to check whether the returned error was
  36736. // because http.StatusNotModified was returned.
  36737. func (c *ProjectsListCall) Do(opts ...googleapi.CallOption) (*ProjectsListResponse, error) {
  36738. gensupport.SetOptions(c.urlParams_, opts...)
  36739. res, err := c.doRequest("json")
  36740. if res != nil && res.StatusCode == http.StatusNotModified {
  36741. if res.Body != nil {
  36742. res.Body.Close()
  36743. }
  36744. return nil, &googleapi.Error{
  36745. Code: res.StatusCode,
  36746. Header: res.Header,
  36747. }
  36748. }
  36749. if err != nil {
  36750. return nil, err
  36751. }
  36752. defer googleapi.CloseBody(res)
  36753. if err := googleapi.CheckResponse(res); err != nil {
  36754. return nil, err
  36755. }
  36756. ret := &ProjectsListResponse{
  36757. ServerResponse: googleapi.ServerResponse{
  36758. Header: res.Header,
  36759. HTTPStatusCode: res.StatusCode,
  36760. },
  36761. }
  36762. target := &ret
  36763. if err := gensupport.DecodeResponse(target, res); err != nil {
  36764. return nil, err
  36765. }
  36766. return ret, nil
  36767. // {
  36768. // "description": "Retrieves a list of projects, possibly filtered. This method supports paging.",
  36769. // "httpMethod": "GET",
  36770. // "id": "dfareporting.projects.list",
  36771. // "parameterOrder": [
  36772. // "profileId"
  36773. // ],
  36774. // "parameters": {
  36775. // "advertiserIds": {
  36776. // "description": "Select only projects with these advertiser IDs.",
  36777. // "format": "int64",
  36778. // "location": "query",
  36779. // "repeated": true,
  36780. // "type": "string"
  36781. // },
  36782. // "ids": {
  36783. // "description": "Select only projects with these IDs.",
  36784. // "format": "int64",
  36785. // "location": "query",
  36786. // "repeated": true,
  36787. // "type": "string"
  36788. // },
  36789. // "maxResults": {
  36790. // "default": "1000",
  36791. // "description": "Maximum number of results to return.",
  36792. // "format": "int32",
  36793. // "location": "query",
  36794. // "maximum": "1000",
  36795. // "minimum": "0",
  36796. // "type": "integer"
  36797. // },
  36798. // "pageToken": {
  36799. // "description": "Value of the nextPageToken from the previous result page.",
  36800. // "location": "query",
  36801. // "type": "string"
  36802. // },
  36803. // "profileId": {
  36804. // "description": "User profile ID associated with this request.",
  36805. // "format": "int64",
  36806. // "location": "path",
  36807. // "required": true,
  36808. // "type": "string"
  36809. // },
  36810. // "searchString": {
  36811. // "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\".",
  36812. // "location": "query",
  36813. // "type": "string"
  36814. // },
  36815. // "sortField": {
  36816. // "default": "ID",
  36817. // "description": "Field by which to sort the list.",
  36818. // "enum": [
  36819. // "ID",
  36820. // "NAME"
  36821. // ],
  36822. // "enumDescriptions": [
  36823. // "",
  36824. // ""
  36825. // ],
  36826. // "location": "query",
  36827. // "type": "string"
  36828. // },
  36829. // "sortOrder": {
  36830. // "default": "ASCENDING",
  36831. // "description": "Order of sorted results.",
  36832. // "enum": [
  36833. // "ASCENDING",
  36834. // "DESCENDING"
  36835. // ],
  36836. // "enumDescriptions": [
  36837. // "",
  36838. // ""
  36839. // ],
  36840. // "location": "query",
  36841. // "type": "string"
  36842. // }
  36843. // },
  36844. // "path": "userprofiles/{profileId}/projects",
  36845. // "response": {
  36846. // "$ref": "ProjectsListResponse"
  36847. // },
  36848. // "scopes": [
  36849. // "https://www.googleapis.com/auth/dfatrafficking"
  36850. // ]
  36851. // }
  36852. }
  36853. // Pages invokes f for each page of results.
  36854. // A non-nil error returned from f will halt the iteration.
  36855. // The provided context supersedes any context provided to the Context method.
  36856. func (c *ProjectsListCall) Pages(ctx context.Context, f func(*ProjectsListResponse) error) error {
  36857. c.ctx_ = ctx
  36858. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  36859. for {
  36860. x, err := c.Do()
  36861. if err != nil {
  36862. return err
  36863. }
  36864. if err := f(x); err != nil {
  36865. return err
  36866. }
  36867. if x.NextPageToken == "" {
  36868. return nil
  36869. }
  36870. c.PageToken(x.NextPageToken)
  36871. }
  36872. }
  36873. // method id "dfareporting.regions.list":
  36874. type RegionsListCall struct {
  36875. s *Service
  36876. profileId int64
  36877. urlParams_ gensupport.URLParams
  36878. ifNoneMatch_ string
  36879. ctx_ context.Context
  36880. header_ http.Header
  36881. }
  36882. // List: Retrieves a list of regions.
  36883. func (r *RegionsService) List(profileId int64) *RegionsListCall {
  36884. c := &RegionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  36885. c.profileId = profileId
  36886. return c
  36887. }
  36888. // Fields allows partial responses to be retrieved. See
  36889. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  36890. // for more information.
  36891. func (c *RegionsListCall) Fields(s ...googleapi.Field) *RegionsListCall {
  36892. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  36893. return c
  36894. }
  36895. // IfNoneMatch sets the optional parameter which makes the operation
  36896. // fail if the object's ETag matches the given value. This is useful for
  36897. // getting updates only after the object has changed since the last
  36898. // request. Use googleapi.IsNotModified to check whether the response
  36899. // error from Do is the result of In-None-Match.
  36900. func (c *RegionsListCall) IfNoneMatch(entityTag string) *RegionsListCall {
  36901. c.ifNoneMatch_ = entityTag
  36902. return c
  36903. }
  36904. // Context sets the context to be used in this call's Do method. Any
  36905. // pending HTTP request will be aborted if the provided context is
  36906. // canceled.
  36907. func (c *RegionsListCall) Context(ctx context.Context) *RegionsListCall {
  36908. c.ctx_ = ctx
  36909. return c
  36910. }
  36911. // Header returns an http.Header that can be modified by the caller to
  36912. // add HTTP headers to the request.
  36913. func (c *RegionsListCall) Header() http.Header {
  36914. if c.header_ == nil {
  36915. c.header_ = make(http.Header)
  36916. }
  36917. return c.header_
  36918. }
  36919. func (c *RegionsListCall) doRequest(alt string) (*http.Response, error) {
  36920. reqHeaders := make(http.Header)
  36921. for k, v := range c.header_ {
  36922. reqHeaders[k] = v
  36923. }
  36924. reqHeaders.Set("User-Agent", c.s.userAgent())
  36925. if c.ifNoneMatch_ != "" {
  36926. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  36927. }
  36928. var body io.Reader = nil
  36929. c.urlParams_.Set("alt", alt)
  36930. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/regions")
  36931. urls += "?" + c.urlParams_.Encode()
  36932. req, _ := http.NewRequest("GET", urls, body)
  36933. req.Header = reqHeaders
  36934. googleapi.Expand(req.URL, map[string]string{
  36935. "profileId": strconv.FormatInt(c.profileId, 10),
  36936. })
  36937. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  36938. }
  36939. // Do executes the "dfareporting.regions.list" call.
  36940. // Exactly one of *RegionsListResponse or error will be non-nil. Any
  36941. // non-2xx status code is an error. Response headers are in either
  36942. // *RegionsListResponse.ServerResponse.Header or (if a response was
  36943. // returned at all) in error.(*googleapi.Error).Header. Use
  36944. // googleapi.IsNotModified to check whether the returned error was
  36945. // because http.StatusNotModified was returned.
  36946. func (c *RegionsListCall) Do(opts ...googleapi.CallOption) (*RegionsListResponse, error) {
  36947. gensupport.SetOptions(c.urlParams_, opts...)
  36948. res, err := c.doRequest("json")
  36949. if res != nil && res.StatusCode == http.StatusNotModified {
  36950. if res.Body != nil {
  36951. res.Body.Close()
  36952. }
  36953. return nil, &googleapi.Error{
  36954. Code: res.StatusCode,
  36955. Header: res.Header,
  36956. }
  36957. }
  36958. if err != nil {
  36959. return nil, err
  36960. }
  36961. defer googleapi.CloseBody(res)
  36962. if err := googleapi.CheckResponse(res); err != nil {
  36963. return nil, err
  36964. }
  36965. ret := &RegionsListResponse{
  36966. ServerResponse: googleapi.ServerResponse{
  36967. Header: res.Header,
  36968. HTTPStatusCode: res.StatusCode,
  36969. },
  36970. }
  36971. target := &ret
  36972. if err := gensupport.DecodeResponse(target, res); err != nil {
  36973. return nil, err
  36974. }
  36975. return ret, nil
  36976. // {
  36977. // "description": "Retrieves a list of regions.",
  36978. // "httpMethod": "GET",
  36979. // "id": "dfareporting.regions.list",
  36980. // "parameterOrder": [
  36981. // "profileId"
  36982. // ],
  36983. // "parameters": {
  36984. // "profileId": {
  36985. // "description": "User profile ID associated with this request.",
  36986. // "format": "int64",
  36987. // "location": "path",
  36988. // "required": true,
  36989. // "type": "string"
  36990. // }
  36991. // },
  36992. // "path": "userprofiles/{profileId}/regions",
  36993. // "response": {
  36994. // "$ref": "RegionsListResponse"
  36995. // },
  36996. // "scopes": [
  36997. // "https://www.googleapis.com/auth/dfatrafficking"
  36998. // ]
  36999. // }
  37000. }
  37001. // method id "dfareporting.remarketingListShares.get":
  37002. type RemarketingListSharesGetCall struct {
  37003. s *Service
  37004. profileId int64
  37005. remarketingListId int64
  37006. urlParams_ gensupport.URLParams
  37007. ifNoneMatch_ string
  37008. ctx_ context.Context
  37009. header_ http.Header
  37010. }
  37011. // Get: Gets one remarketing list share by remarketing list ID.
  37012. func (r *RemarketingListSharesService) Get(profileId int64, remarketingListId int64) *RemarketingListSharesGetCall {
  37013. c := &RemarketingListSharesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37014. c.profileId = profileId
  37015. c.remarketingListId = remarketingListId
  37016. return c
  37017. }
  37018. // Fields allows partial responses to be retrieved. See
  37019. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37020. // for more information.
  37021. func (c *RemarketingListSharesGetCall) Fields(s ...googleapi.Field) *RemarketingListSharesGetCall {
  37022. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37023. return c
  37024. }
  37025. // IfNoneMatch sets the optional parameter which makes the operation
  37026. // fail if the object's ETag matches the given value. This is useful for
  37027. // getting updates only after the object has changed since the last
  37028. // request. Use googleapi.IsNotModified to check whether the response
  37029. // error from Do is the result of In-None-Match.
  37030. func (c *RemarketingListSharesGetCall) IfNoneMatch(entityTag string) *RemarketingListSharesGetCall {
  37031. c.ifNoneMatch_ = entityTag
  37032. return c
  37033. }
  37034. // Context sets the context to be used in this call's Do method. Any
  37035. // pending HTTP request will be aborted if the provided context is
  37036. // canceled.
  37037. func (c *RemarketingListSharesGetCall) Context(ctx context.Context) *RemarketingListSharesGetCall {
  37038. c.ctx_ = ctx
  37039. return c
  37040. }
  37041. // Header returns an http.Header that can be modified by the caller to
  37042. // add HTTP headers to the request.
  37043. func (c *RemarketingListSharesGetCall) Header() http.Header {
  37044. if c.header_ == nil {
  37045. c.header_ = make(http.Header)
  37046. }
  37047. return c.header_
  37048. }
  37049. func (c *RemarketingListSharesGetCall) doRequest(alt string) (*http.Response, error) {
  37050. reqHeaders := make(http.Header)
  37051. for k, v := range c.header_ {
  37052. reqHeaders[k] = v
  37053. }
  37054. reqHeaders.Set("User-Agent", c.s.userAgent())
  37055. if c.ifNoneMatch_ != "" {
  37056. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37057. }
  37058. var body io.Reader = nil
  37059. c.urlParams_.Set("alt", alt)
  37060. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares/{remarketingListId}")
  37061. urls += "?" + c.urlParams_.Encode()
  37062. req, _ := http.NewRequest("GET", urls, body)
  37063. req.Header = reqHeaders
  37064. googleapi.Expand(req.URL, map[string]string{
  37065. "profileId": strconv.FormatInt(c.profileId, 10),
  37066. "remarketingListId": strconv.FormatInt(c.remarketingListId, 10),
  37067. })
  37068. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37069. }
  37070. // Do executes the "dfareporting.remarketingListShares.get" call.
  37071. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  37072. // non-2xx status code is an error. Response headers are in either
  37073. // *RemarketingListShare.ServerResponse.Header or (if a response was
  37074. // returned at all) in error.(*googleapi.Error).Header. Use
  37075. // googleapi.IsNotModified to check whether the returned error was
  37076. // because http.StatusNotModified was returned.
  37077. func (c *RemarketingListSharesGetCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  37078. gensupport.SetOptions(c.urlParams_, opts...)
  37079. res, err := c.doRequest("json")
  37080. if res != nil && res.StatusCode == http.StatusNotModified {
  37081. if res.Body != nil {
  37082. res.Body.Close()
  37083. }
  37084. return nil, &googleapi.Error{
  37085. Code: res.StatusCode,
  37086. Header: res.Header,
  37087. }
  37088. }
  37089. if err != nil {
  37090. return nil, err
  37091. }
  37092. defer googleapi.CloseBody(res)
  37093. if err := googleapi.CheckResponse(res); err != nil {
  37094. return nil, err
  37095. }
  37096. ret := &RemarketingListShare{
  37097. ServerResponse: googleapi.ServerResponse{
  37098. Header: res.Header,
  37099. HTTPStatusCode: res.StatusCode,
  37100. },
  37101. }
  37102. target := &ret
  37103. if err := gensupport.DecodeResponse(target, res); err != nil {
  37104. return nil, err
  37105. }
  37106. return ret, nil
  37107. // {
  37108. // "description": "Gets one remarketing list share by remarketing list ID.",
  37109. // "httpMethod": "GET",
  37110. // "id": "dfareporting.remarketingListShares.get",
  37111. // "parameterOrder": [
  37112. // "profileId",
  37113. // "remarketingListId"
  37114. // ],
  37115. // "parameters": {
  37116. // "profileId": {
  37117. // "description": "User profile ID associated with this request.",
  37118. // "format": "int64",
  37119. // "location": "path",
  37120. // "required": true,
  37121. // "type": "string"
  37122. // },
  37123. // "remarketingListId": {
  37124. // "description": "Remarketing list ID.",
  37125. // "format": "int64",
  37126. // "location": "path",
  37127. // "required": true,
  37128. // "type": "string"
  37129. // }
  37130. // },
  37131. // "path": "userprofiles/{profileId}/remarketingListShares/{remarketingListId}",
  37132. // "response": {
  37133. // "$ref": "RemarketingListShare"
  37134. // },
  37135. // "scopes": [
  37136. // "https://www.googleapis.com/auth/dfatrafficking"
  37137. // ]
  37138. // }
  37139. }
  37140. // method id "dfareporting.remarketingListShares.patch":
  37141. type RemarketingListSharesPatchCall struct {
  37142. s *Service
  37143. profileId int64
  37144. remarketinglistshare *RemarketingListShare
  37145. urlParams_ gensupport.URLParams
  37146. ctx_ context.Context
  37147. header_ http.Header
  37148. }
  37149. // Patch: Updates an existing remarketing list share. This method
  37150. // supports patch semantics.
  37151. func (r *RemarketingListSharesService) Patch(profileId int64, remarketingListId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesPatchCall {
  37152. c := &RemarketingListSharesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37153. c.profileId = profileId
  37154. c.urlParams_.Set("remarketingListId", fmt.Sprint(remarketingListId))
  37155. c.remarketinglistshare = remarketinglistshare
  37156. return c
  37157. }
  37158. // Fields allows partial responses to be retrieved. See
  37159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37160. // for more information.
  37161. func (c *RemarketingListSharesPatchCall) Fields(s ...googleapi.Field) *RemarketingListSharesPatchCall {
  37162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37163. return c
  37164. }
  37165. // Context sets the context to be used in this call's Do method. Any
  37166. // pending HTTP request will be aborted if the provided context is
  37167. // canceled.
  37168. func (c *RemarketingListSharesPatchCall) Context(ctx context.Context) *RemarketingListSharesPatchCall {
  37169. c.ctx_ = ctx
  37170. return c
  37171. }
  37172. // Header returns an http.Header that can be modified by the caller to
  37173. // add HTTP headers to the request.
  37174. func (c *RemarketingListSharesPatchCall) Header() http.Header {
  37175. if c.header_ == nil {
  37176. c.header_ = make(http.Header)
  37177. }
  37178. return c.header_
  37179. }
  37180. func (c *RemarketingListSharesPatchCall) doRequest(alt string) (*http.Response, error) {
  37181. reqHeaders := make(http.Header)
  37182. for k, v := range c.header_ {
  37183. reqHeaders[k] = v
  37184. }
  37185. reqHeaders.Set("User-Agent", c.s.userAgent())
  37186. var body io.Reader = nil
  37187. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  37188. if err != nil {
  37189. return nil, err
  37190. }
  37191. reqHeaders.Set("Content-Type", "application/json")
  37192. c.urlParams_.Set("alt", alt)
  37193. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  37194. urls += "?" + c.urlParams_.Encode()
  37195. req, _ := http.NewRequest("PATCH", urls, body)
  37196. req.Header = reqHeaders
  37197. googleapi.Expand(req.URL, map[string]string{
  37198. "profileId": strconv.FormatInt(c.profileId, 10),
  37199. })
  37200. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37201. }
  37202. // Do executes the "dfareporting.remarketingListShares.patch" call.
  37203. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  37204. // non-2xx status code is an error. Response headers are in either
  37205. // *RemarketingListShare.ServerResponse.Header or (if a response was
  37206. // returned at all) in error.(*googleapi.Error).Header. Use
  37207. // googleapi.IsNotModified to check whether the returned error was
  37208. // because http.StatusNotModified was returned.
  37209. func (c *RemarketingListSharesPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  37210. gensupport.SetOptions(c.urlParams_, opts...)
  37211. res, err := c.doRequest("json")
  37212. if res != nil && res.StatusCode == http.StatusNotModified {
  37213. if res.Body != nil {
  37214. res.Body.Close()
  37215. }
  37216. return nil, &googleapi.Error{
  37217. Code: res.StatusCode,
  37218. Header: res.Header,
  37219. }
  37220. }
  37221. if err != nil {
  37222. return nil, err
  37223. }
  37224. defer googleapi.CloseBody(res)
  37225. if err := googleapi.CheckResponse(res); err != nil {
  37226. return nil, err
  37227. }
  37228. ret := &RemarketingListShare{
  37229. ServerResponse: googleapi.ServerResponse{
  37230. Header: res.Header,
  37231. HTTPStatusCode: res.StatusCode,
  37232. },
  37233. }
  37234. target := &ret
  37235. if err := gensupport.DecodeResponse(target, res); err != nil {
  37236. return nil, err
  37237. }
  37238. return ret, nil
  37239. // {
  37240. // "description": "Updates an existing remarketing list share. This method supports patch semantics.",
  37241. // "httpMethod": "PATCH",
  37242. // "id": "dfareporting.remarketingListShares.patch",
  37243. // "parameterOrder": [
  37244. // "profileId",
  37245. // "remarketingListId"
  37246. // ],
  37247. // "parameters": {
  37248. // "profileId": {
  37249. // "description": "User profile ID associated with this request.",
  37250. // "format": "int64",
  37251. // "location": "path",
  37252. // "required": true,
  37253. // "type": "string"
  37254. // },
  37255. // "remarketingListId": {
  37256. // "description": "Remarketing list ID.",
  37257. // "format": "int64",
  37258. // "location": "query",
  37259. // "required": true,
  37260. // "type": "string"
  37261. // }
  37262. // },
  37263. // "path": "userprofiles/{profileId}/remarketingListShares",
  37264. // "request": {
  37265. // "$ref": "RemarketingListShare"
  37266. // },
  37267. // "response": {
  37268. // "$ref": "RemarketingListShare"
  37269. // },
  37270. // "scopes": [
  37271. // "https://www.googleapis.com/auth/dfatrafficking"
  37272. // ]
  37273. // }
  37274. }
  37275. // method id "dfareporting.remarketingListShares.update":
  37276. type RemarketingListSharesUpdateCall struct {
  37277. s *Service
  37278. profileId int64
  37279. remarketinglistshare *RemarketingListShare
  37280. urlParams_ gensupport.URLParams
  37281. ctx_ context.Context
  37282. header_ http.Header
  37283. }
  37284. // Update: Updates an existing remarketing list share.
  37285. func (r *RemarketingListSharesService) Update(profileId int64, remarketinglistshare *RemarketingListShare) *RemarketingListSharesUpdateCall {
  37286. c := &RemarketingListSharesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37287. c.profileId = profileId
  37288. c.remarketinglistshare = remarketinglistshare
  37289. return c
  37290. }
  37291. // Fields allows partial responses to be retrieved. See
  37292. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37293. // for more information.
  37294. func (c *RemarketingListSharesUpdateCall) Fields(s ...googleapi.Field) *RemarketingListSharesUpdateCall {
  37295. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37296. return c
  37297. }
  37298. // Context sets the context to be used in this call's Do method. Any
  37299. // pending HTTP request will be aborted if the provided context is
  37300. // canceled.
  37301. func (c *RemarketingListSharesUpdateCall) Context(ctx context.Context) *RemarketingListSharesUpdateCall {
  37302. c.ctx_ = ctx
  37303. return c
  37304. }
  37305. // Header returns an http.Header that can be modified by the caller to
  37306. // add HTTP headers to the request.
  37307. func (c *RemarketingListSharesUpdateCall) Header() http.Header {
  37308. if c.header_ == nil {
  37309. c.header_ = make(http.Header)
  37310. }
  37311. return c.header_
  37312. }
  37313. func (c *RemarketingListSharesUpdateCall) doRequest(alt string) (*http.Response, error) {
  37314. reqHeaders := make(http.Header)
  37315. for k, v := range c.header_ {
  37316. reqHeaders[k] = v
  37317. }
  37318. reqHeaders.Set("User-Agent", c.s.userAgent())
  37319. var body io.Reader = nil
  37320. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglistshare)
  37321. if err != nil {
  37322. return nil, err
  37323. }
  37324. reqHeaders.Set("Content-Type", "application/json")
  37325. c.urlParams_.Set("alt", alt)
  37326. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingListShares")
  37327. urls += "?" + c.urlParams_.Encode()
  37328. req, _ := http.NewRequest("PUT", urls, body)
  37329. req.Header = reqHeaders
  37330. googleapi.Expand(req.URL, map[string]string{
  37331. "profileId": strconv.FormatInt(c.profileId, 10),
  37332. })
  37333. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37334. }
  37335. // Do executes the "dfareporting.remarketingListShares.update" call.
  37336. // Exactly one of *RemarketingListShare or error will be non-nil. Any
  37337. // non-2xx status code is an error. Response headers are in either
  37338. // *RemarketingListShare.ServerResponse.Header or (if a response was
  37339. // returned at all) in error.(*googleapi.Error).Header. Use
  37340. // googleapi.IsNotModified to check whether the returned error was
  37341. // because http.StatusNotModified was returned.
  37342. func (c *RemarketingListSharesUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingListShare, error) {
  37343. gensupport.SetOptions(c.urlParams_, opts...)
  37344. res, err := c.doRequest("json")
  37345. if res != nil && res.StatusCode == http.StatusNotModified {
  37346. if res.Body != nil {
  37347. res.Body.Close()
  37348. }
  37349. return nil, &googleapi.Error{
  37350. Code: res.StatusCode,
  37351. Header: res.Header,
  37352. }
  37353. }
  37354. if err != nil {
  37355. return nil, err
  37356. }
  37357. defer googleapi.CloseBody(res)
  37358. if err := googleapi.CheckResponse(res); err != nil {
  37359. return nil, err
  37360. }
  37361. ret := &RemarketingListShare{
  37362. ServerResponse: googleapi.ServerResponse{
  37363. Header: res.Header,
  37364. HTTPStatusCode: res.StatusCode,
  37365. },
  37366. }
  37367. target := &ret
  37368. if err := gensupport.DecodeResponse(target, res); err != nil {
  37369. return nil, err
  37370. }
  37371. return ret, nil
  37372. // {
  37373. // "description": "Updates an existing remarketing list share.",
  37374. // "httpMethod": "PUT",
  37375. // "id": "dfareporting.remarketingListShares.update",
  37376. // "parameterOrder": [
  37377. // "profileId"
  37378. // ],
  37379. // "parameters": {
  37380. // "profileId": {
  37381. // "description": "User profile ID associated with this request.",
  37382. // "format": "int64",
  37383. // "location": "path",
  37384. // "required": true,
  37385. // "type": "string"
  37386. // }
  37387. // },
  37388. // "path": "userprofiles/{profileId}/remarketingListShares",
  37389. // "request": {
  37390. // "$ref": "RemarketingListShare"
  37391. // },
  37392. // "response": {
  37393. // "$ref": "RemarketingListShare"
  37394. // },
  37395. // "scopes": [
  37396. // "https://www.googleapis.com/auth/dfatrafficking"
  37397. // ]
  37398. // }
  37399. }
  37400. // method id "dfareporting.remarketingLists.get":
  37401. type RemarketingListsGetCall struct {
  37402. s *Service
  37403. profileId int64
  37404. id int64
  37405. urlParams_ gensupport.URLParams
  37406. ifNoneMatch_ string
  37407. ctx_ context.Context
  37408. header_ http.Header
  37409. }
  37410. // Get: Gets one remarketing list by ID.
  37411. func (r *RemarketingListsService) Get(profileId int64, id int64) *RemarketingListsGetCall {
  37412. c := &RemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37413. c.profileId = profileId
  37414. c.id = id
  37415. return c
  37416. }
  37417. // Fields allows partial responses to be retrieved. See
  37418. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37419. // for more information.
  37420. func (c *RemarketingListsGetCall) Fields(s ...googleapi.Field) *RemarketingListsGetCall {
  37421. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37422. return c
  37423. }
  37424. // IfNoneMatch sets the optional parameter which makes the operation
  37425. // fail if the object's ETag matches the given value. This is useful for
  37426. // getting updates only after the object has changed since the last
  37427. // request. Use googleapi.IsNotModified to check whether the response
  37428. // error from Do is the result of In-None-Match.
  37429. func (c *RemarketingListsGetCall) IfNoneMatch(entityTag string) *RemarketingListsGetCall {
  37430. c.ifNoneMatch_ = entityTag
  37431. return c
  37432. }
  37433. // Context sets the context to be used in this call's Do method. Any
  37434. // pending HTTP request will be aborted if the provided context is
  37435. // canceled.
  37436. func (c *RemarketingListsGetCall) Context(ctx context.Context) *RemarketingListsGetCall {
  37437. c.ctx_ = ctx
  37438. return c
  37439. }
  37440. // Header returns an http.Header that can be modified by the caller to
  37441. // add HTTP headers to the request.
  37442. func (c *RemarketingListsGetCall) Header() http.Header {
  37443. if c.header_ == nil {
  37444. c.header_ = make(http.Header)
  37445. }
  37446. return c.header_
  37447. }
  37448. func (c *RemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  37449. reqHeaders := make(http.Header)
  37450. for k, v := range c.header_ {
  37451. reqHeaders[k] = v
  37452. }
  37453. reqHeaders.Set("User-Agent", c.s.userAgent())
  37454. if c.ifNoneMatch_ != "" {
  37455. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37456. }
  37457. var body io.Reader = nil
  37458. c.urlParams_.Set("alt", alt)
  37459. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists/{id}")
  37460. urls += "?" + c.urlParams_.Encode()
  37461. req, _ := http.NewRequest("GET", urls, body)
  37462. req.Header = reqHeaders
  37463. googleapi.Expand(req.URL, map[string]string{
  37464. "profileId": strconv.FormatInt(c.profileId, 10),
  37465. "id": strconv.FormatInt(c.id, 10),
  37466. })
  37467. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37468. }
  37469. // Do executes the "dfareporting.remarketingLists.get" call.
  37470. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  37471. // status code is an error. Response headers are in either
  37472. // *RemarketingList.ServerResponse.Header or (if a response was returned
  37473. // at all) in error.(*googleapi.Error).Header. Use
  37474. // googleapi.IsNotModified to check whether the returned error was
  37475. // because http.StatusNotModified was returned.
  37476. func (c *RemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  37477. gensupport.SetOptions(c.urlParams_, opts...)
  37478. res, err := c.doRequest("json")
  37479. if res != nil && res.StatusCode == http.StatusNotModified {
  37480. if res.Body != nil {
  37481. res.Body.Close()
  37482. }
  37483. return nil, &googleapi.Error{
  37484. Code: res.StatusCode,
  37485. Header: res.Header,
  37486. }
  37487. }
  37488. if err != nil {
  37489. return nil, err
  37490. }
  37491. defer googleapi.CloseBody(res)
  37492. if err := googleapi.CheckResponse(res); err != nil {
  37493. return nil, err
  37494. }
  37495. ret := &RemarketingList{
  37496. ServerResponse: googleapi.ServerResponse{
  37497. Header: res.Header,
  37498. HTTPStatusCode: res.StatusCode,
  37499. },
  37500. }
  37501. target := &ret
  37502. if err := gensupport.DecodeResponse(target, res); err != nil {
  37503. return nil, err
  37504. }
  37505. return ret, nil
  37506. // {
  37507. // "description": "Gets one remarketing list by ID.",
  37508. // "httpMethod": "GET",
  37509. // "id": "dfareporting.remarketingLists.get",
  37510. // "parameterOrder": [
  37511. // "profileId",
  37512. // "id"
  37513. // ],
  37514. // "parameters": {
  37515. // "id": {
  37516. // "description": "Remarketing list ID.",
  37517. // "format": "int64",
  37518. // "location": "path",
  37519. // "required": true,
  37520. // "type": "string"
  37521. // },
  37522. // "profileId": {
  37523. // "description": "User profile ID associated with this request.",
  37524. // "format": "int64",
  37525. // "location": "path",
  37526. // "required": true,
  37527. // "type": "string"
  37528. // }
  37529. // },
  37530. // "path": "userprofiles/{profileId}/remarketingLists/{id}",
  37531. // "response": {
  37532. // "$ref": "RemarketingList"
  37533. // },
  37534. // "scopes": [
  37535. // "https://www.googleapis.com/auth/dfatrafficking"
  37536. // ]
  37537. // }
  37538. }
  37539. // method id "dfareporting.remarketingLists.insert":
  37540. type RemarketingListsInsertCall struct {
  37541. s *Service
  37542. profileId int64
  37543. remarketinglist *RemarketingList
  37544. urlParams_ gensupport.URLParams
  37545. ctx_ context.Context
  37546. header_ http.Header
  37547. }
  37548. // Insert: Inserts a new remarketing list.
  37549. func (r *RemarketingListsService) Insert(profileId int64, remarketinglist *RemarketingList) *RemarketingListsInsertCall {
  37550. c := &RemarketingListsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37551. c.profileId = profileId
  37552. c.remarketinglist = remarketinglist
  37553. return c
  37554. }
  37555. // Fields allows partial responses to be retrieved. See
  37556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37557. // for more information.
  37558. func (c *RemarketingListsInsertCall) Fields(s ...googleapi.Field) *RemarketingListsInsertCall {
  37559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37560. return c
  37561. }
  37562. // Context sets the context to be used in this call's Do method. Any
  37563. // pending HTTP request will be aborted if the provided context is
  37564. // canceled.
  37565. func (c *RemarketingListsInsertCall) Context(ctx context.Context) *RemarketingListsInsertCall {
  37566. c.ctx_ = ctx
  37567. return c
  37568. }
  37569. // Header returns an http.Header that can be modified by the caller to
  37570. // add HTTP headers to the request.
  37571. func (c *RemarketingListsInsertCall) Header() http.Header {
  37572. if c.header_ == nil {
  37573. c.header_ = make(http.Header)
  37574. }
  37575. return c.header_
  37576. }
  37577. func (c *RemarketingListsInsertCall) doRequest(alt string) (*http.Response, error) {
  37578. reqHeaders := make(http.Header)
  37579. for k, v := range c.header_ {
  37580. reqHeaders[k] = v
  37581. }
  37582. reqHeaders.Set("User-Agent", c.s.userAgent())
  37583. var body io.Reader = nil
  37584. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  37585. if err != nil {
  37586. return nil, err
  37587. }
  37588. reqHeaders.Set("Content-Type", "application/json")
  37589. c.urlParams_.Set("alt", alt)
  37590. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  37591. urls += "?" + c.urlParams_.Encode()
  37592. req, _ := http.NewRequest("POST", urls, body)
  37593. req.Header = reqHeaders
  37594. googleapi.Expand(req.URL, map[string]string{
  37595. "profileId": strconv.FormatInt(c.profileId, 10),
  37596. })
  37597. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37598. }
  37599. // Do executes the "dfareporting.remarketingLists.insert" call.
  37600. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  37601. // status code is an error. Response headers are in either
  37602. // *RemarketingList.ServerResponse.Header or (if a response was returned
  37603. // at all) in error.(*googleapi.Error).Header. Use
  37604. // googleapi.IsNotModified to check whether the returned error was
  37605. // because http.StatusNotModified was returned.
  37606. func (c *RemarketingListsInsertCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  37607. gensupport.SetOptions(c.urlParams_, opts...)
  37608. res, err := c.doRequest("json")
  37609. if res != nil && res.StatusCode == http.StatusNotModified {
  37610. if res.Body != nil {
  37611. res.Body.Close()
  37612. }
  37613. return nil, &googleapi.Error{
  37614. Code: res.StatusCode,
  37615. Header: res.Header,
  37616. }
  37617. }
  37618. if err != nil {
  37619. return nil, err
  37620. }
  37621. defer googleapi.CloseBody(res)
  37622. if err := googleapi.CheckResponse(res); err != nil {
  37623. return nil, err
  37624. }
  37625. ret := &RemarketingList{
  37626. ServerResponse: googleapi.ServerResponse{
  37627. Header: res.Header,
  37628. HTTPStatusCode: res.StatusCode,
  37629. },
  37630. }
  37631. target := &ret
  37632. if err := gensupport.DecodeResponse(target, res); err != nil {
  37633. return nil, err
  37634. }
  37635. return ret, nil
  37636. // {
  37637. // "description": "Inserts a new remarketing list.",
  37638. // "httpMethod": "POST",
  37639. // "id": "dfareporting.remarketingLists.insert",
  37640. // "parameterOrder": [
  37641. // "profileId"
  37642. // ],
  37643. // "parameters": {
  37644. // "profileId": {
  37645. // "description": "User profile ID associated with this request.",
  37646. // "format": "int64",
  37647. // "location": "path",
  37648. // "required": true,
  37649. // "type": "string"
  37650. // }
  37651. // },
  37652. // "path": "userprofiles/{profileId}/remarketingLists",
  37653. // "request": {
  37654. // "$ref": "RemarketingList"
  37655. // },
  37656. // "response": {
  37657. // "$ref": "RemarketingList"
  37658. // },
  37659. // "scopes": [
  37660. // "https://www.googleapis.com/auth/dfatrafficking"
  37661. // ]
  37662. // }
  37663. }
  37664. // method id "dfareporting.remarketingLists.list":
  37665. type RemarketingListsListCall struct {
  37666. s *Service
  37667. profileId int64
  37668. urlParams_ gensupport.URLParams
  37669. ifNoneMatch_ string
  37670. ctx_ context.Context
  37671. header_ http.Header
  37672. }
  37673. // List: Retrieves a list of remarketing lists, possibly filtered. This
  37674. // method supports paging.
  37675. func (r *RemarketingListsService) List(profileId int64, advertiserId int64) *RemarketingListsListCall {
  37676. c := &RemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37677. c.profileId = profileId
  37678. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  37679. return c
  37680. }
  37681. // Active sets the optional parameter "active": Select only active or
  37682. // only inactive remarketing lists.
  37683. func (c *RemarketingListsListCall) Active(active bool) *RemarketingListsListCall {
  37684. c.urlParams_.Set("active", fmt.Sprint(active))
  37685. return c
  37686. }
  37687. // FloodlightActivityId sets the optional parameter
  37688. // "floodlightActivityId": Select only remarketing lists that have this
  37689. // floodlight activity ID.
  37690. func (c *RemarketingListsListCall) FloodlightActivityId(floodlightActivityId int64) *RemarketingListsListCall {
  37691. c.urlParams_.Set("floodlightActivityId", fmt.Sprint(floodlightActivityId))
  37692. return c
  37693. }
  37694. // MaxResults sets the optional parameter "maxResults": Maximum number
  37695. // of results to return.
  37696. func (c *RemarketingListsListCall) MaxResults(maxResults int64) *RemarketingListsListCall {
  37697. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  37698. return c
  37699. }
  37700. // Name sets the optional parameter "name": Allows searching for objects
  37701. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  37702. // list*2015" will return objects with names like "remarketing list June
  37703. // 2015", "remarketing list April 2015", or simply "remarketing list
  37704. // 2015". Most of the searches also add wildcards implicitly at the
  37705. // start and the end of the search string. For example, a search string
  37706. // of "remarketing list" will match objects with name "my remarketing
  37707. // list", "remarketing list 2015", or simply "remarketing list".
  37708. func (c *RemarketingListsListCall) Name(name string) *RemarketingListsListCall {
  37709. c.urlParams_.Set("name", name)
  37710. return c
  37711. }
  37712. // PageToken sets the optional parameter "pageToken": Value of the
  37713. // nextPageToken from the previous result page.
  37714. func (c *RemarketingListsListCall) PageToken(pageToken string) *RemarketingListsListCall {
  37715. c.urlParams_.Set("pageToken", pageToken)
  37716. return c
  37717. }
  37718. // SortField sets the optional parameter "sortField": Field by which to
  37719. // sort the list.
  37720. //
  37721. // Possible values:
  37722. // "ID" (default)
  37723. // "NAME"
  37724. func (c *RemarketingListsListCall) SortField(sortField string) *RemarketingListsListCall {
  37725. c.urlParams_.Set("sortField", sortField)
  37726. return c
  37727. }
  37728. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  37729. // results.
  37730. //
  37731. // Possible values:
  37732. // "ASCENDING" (default)
  37733. // "DESCENDING"
  37734. func (c *RemarketingListsListCall) SortOrder(sortOrder string) *RemarketingListsListCall {
  37735. c.urlParams_.Set("sortOrder", sortOrder)
  37736. return c
  37737. }
  37738. // Fields allows partial responses to be retrieved. See
  37739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37740. // for more information.
  37741. func (c *RemarketingListsListCall) Fields(s ...googleapi.Field) *RemarketingListsListCall {
  37742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37743. return c
  37744. }
  37745. // IfNoneMatch sets the optional parameter which makes the operation
  37746. // fail if the object's ETag matches the given value. This is useful for
  37747. // getting updates only after the object has changed since the last
  37748. // request. Use googleapi.IsNotModified to check whether the response
  37749. // error from Do is the result of In-None-Match.
  37750. func (c *RemarketingListsListCall) IfNoneMatch(entityTag string) *RemarketingListsListCall {
  37751. c.ifNoneMatch_ = entityTag
  37752. return c
  37753. }
  37754. // Context sets the context to be used in this call's Do method. Any
  37755. // pending HTTP request will be aborted if the provided context is
  37756. // canceled.
  37757. func (c *RemarketingListsListCall) Context(ctx context.Context) *RemarketingListsListCall {
  37758. c.ctx_ = ctx
  37759. return c
  37760. }
  37761. // Header returns an http.Header that can be modified by the caller to
  37762. // add HTTP headers to the request.
  37763. func (c *RemarketingListsListCall) Header() http.Header {
  37764. if c.header_ == nil {
  37765. c.header_ = make(http.Header)
  37766. }
  37767. return c.header_
  37768. }
  37769. func (c *RemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  37770. reqHeaders := make(http.Header)
  37771. for k, v := range c.header_ {
  37772. reqHeaders[k] = v
  37773. }
  37774. reqHeaders.Set("User-Agent", c.s.userAgent())
  37775. if c.ifNoneMatch_ != "" {
  37776. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  37777. }
  37778. var body io.Reader = nil
  37779. c.urlParams_.Set("alt", alt)
  37780. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  37781. urls += "?" + c.urlParams_.Encode()
  37782. req, _ := http.NewRequest("GET", urls, body)
  37783. req.Header = reqHeaders
  37784. googleapi.Expand(req.URL, map[string]string{
  37785. "profileId": strconv.FormatInt(c.profileId, 10),
  37786. })
  37787. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37788. }
  37789. // Do executes the "dfareporting.remarketingLists.list" call.
  37790. // Exactly one of *RemarketingListsListResponse or error will be
  37791. // non-nil. Any non-2xx status code is an error. Response headers are in
  37792. // either *RemarketingListsListResponse.ServerResponse.Header or (if a
  37793. // response was returned at all) in error.(*googleapi.Error).Header. Use
  37794. // googleapi.IsNotModified to check whether the returned error was
  37795. // because http.StatusNotModified was returned.
  37796. func (c *RemarketingListsListCall) Do(opts ...googleapi.CallOption) (*RemarketingListsListResponse, error) {
  37797. gensupport.SetOptions(c.urlParams_, opts...)
  37798. res, err := c.doRequest("json")
  37799. if res != nil && res.StatusCode == http.StatusNotModified {
  37800. if res.Body != nil {
  37801. res.Body.Close()
  37802. }
  37803. return nil, &googleapi.Error{
  37804. Code: res.StatusCode,
  37805. Header: res.Header,
  37806. }
  37807. }
  37808. if err != nil {
  37809. return nil, err
  37810. }
  37811. defer googleapi.CloseBody(res)
  37812. if err := googleapi.CheckResponse(res); err != nil {
  37813. return nil, err
  37814. }
  37815. ret := &RemarketingListsListResponse{
  37816. ServerResponse: googleapi.ServerResponse{
  37817. Header: res.Header,
  37818. HTTPStatusCode: res.StatusCode,
  37819. },
  37820. }
  37821. target := &ret
  37822. if err := gensupport.DecodeResponse(target, res); err != nil {
  37823. return nil, err
  37824. }
  37825. return ret, nil
  37826. // {
  37827. // "description": "Retrieves a list of remarketing lists, possibly filtered. This method supports paging.",
  37828. // "httpMethod": "GET",
  37829. // "id": "dfareporting.remarketingLists.list",
  37830. // "parameterOrder": [
  37831. // "profileId",
  37832. // "advertiserId"
  37833. // ],
  37834. // "parameters": {
  37835. // "active": {
  37836. // "description": "Select only active or only inactive remarketing lists.",
  37837. // "location": "query",
  37838. // "type": "boolean"
  37839. // },
  37840. // "advertiserId": {
  37841. // "description": "Select only remarketing lists owned by this advertiser.",
  37842. // "format": "int64",
  37843. // "location": "query",
  37844. // "required": true,
  37845. // "type": "string"
  37846. // },
  37847. // "floodlightActivityId": {
  37848. // "description": "Select only remarketing lists that have this floodlight activity ID.",
  37849. // "format": "int64",
  37850. // "location": "query",
  37851. // "type": "string"
  37852. // },
  37853. // "maxResults": {
  37854. // "default": "1000",
  37855. // "description": "Maximum number of results to return.",
  37856. // "format": "int32",
  37857. // "location": "query",
  37858. // "maximum": "1000",
  37859. // "minimum": "0",
  37860. // "type": "integer"
  37861. // },
  37862. // "name": {
  37863. // "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\".",
  37864. // "location": "query",
  37865. // "type": "string"
  37866. // },
  37867. // "pageToken": {
  37868. // "description": "Value of the nextPageToken from the previous result page.",
  37869. // "location": "query",
  37870. // "type": "string"
  37871. // },
  37872. // "profileId": {
  37873. // "description": "User profile ID associated with this request.",
  37874. // "format": "int64",
  37875. // "location": "path",
  37876. // "required": true,
  37877. // "type": "string"
  37878. // },
  37879. // "sortField": {
  37880. // "default": "ID",
  37881. // "description": "Field by which to sort the list.",
  37882. // "enum": [
  37883. // "ID",
  37884. // "NAME"
  37885. // ],
  37886. // "enumDescriptions": [
  37887. // "",
  37888. // ""
  37889. // ],
  37890. // "location": "query",
  37891. // "type": "string"
  37892. // },
  37893. // "sortOrder": {
  37894. // "default": "ASCENDING",
  37895. // "description": "Order of sorted results.",
  37896. // "enum": [
  37897. // "ASCENDING",
  37898. // "DESCENDING"
  37899. // ],
  37900. // "enumDescriptions": [
  37901. // "",
  37902. // ""
  37903. // ],
  37904. // "location": "query",
  37905. // "type": "string"
  37906. // }
  37907. // },
  37908. // "path": "userprofiles/{profileId}/remarketingLists",
  37909. // "response": {
  37910. // "$ref": "RemarketingListsListResponse"
  37911. // },
  37912. // "scopes": [
  37913. // "https://www.googleapis.com/auth/dfatrafficking"
  37914. // ]
  37915. // }
  37916. }
  37917. // Pages invokes f for each page of results.
  37918. // A non-nil error returned from f will halt the iteration.
  37919. // The provided context supersedes any context provided to the Context method.
  37920. func (c *RemarketingListsListCall) Pages(ctx context.Context, f func(*RemarketingListsListResponse) error) error {
  37921. c.ctx_ = ctx
  37922. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  37923. for {
  37924. x, err := c.Do()
  37925. if err != nil {
  37926. return err
  37927. }
  37928. if err := f(x); err != nil {
  37929. return err
  37930. }
  37931. if x.NextPageToken == "" {
  37932. return nil
  37933. }
  37934. c.PageToken(x.NextPageToken)
  37935. }
  37936. }
  37937. // method id "dfareporting.remarketingLists.patch":
  37938. type RemarketingListsPatchCall struct {
  37939. s *Service
  37940. profileId int64
  37941. remarketinglist *RemarketingList
  37942. urlParams_ gensupport.URLParams
  37943. ctx_ context.Context
  37944. header_ http.Header
  37945. }
  37946. // Patch: Updates an existing remarketing list. This method supports
  37947. // patch semantics.
  37948. func (r *RemarketingListsService) Patch(profileId int64, id int64, remarketinglist *RemarketingList) *RemarketingListsPatchCall {
  37949. c := &RemarketingListsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  37950. c.profileId = profileId
  37951. c.urlParams_.Set("id", fmt.Sprint(id))
  37952. c.remarketinglist = remarketinglist
  37953. return c
  37954. }
  37955. // Fields allows partial responses to be retrieved. See
  37956. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  37957. // for more information.
  37958. func (c *RemarketingListsPatchCall) Fields(s ...googleapi.Field) *RemarketingListsPatchCall {
  37959. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  37960. return c
  37961. }
  37962. // Context sets the context to be used in this call's Do method. Any
  37963. // pending HTTP request will be aborted if the provided context is
  37964. // canceled.
  37965. func (c *RemarketingListsPatchCall) Context(ctx context.Context) *RemarketingListsPatchCall {
  37966. c.ctx_ = ctx
  37967. return c
  37968. }
  37969. // Header returns an http.Header that can be modified by the caller to
  37970. // add HTTP headers to the request.
  37971. func (c *RemarketingListsPatchCall) Header() http.Header {
  37972. if c.header_ == nil {
  37973. c.header_ = make(http.Header)
  37974. }
  37975. return c.header_
  37976. }
  37977. func (c *RemarketingListsPatchCall) doRequest(alt string) (*http.Response, error) {
  37978. reqHeaders := make(http.Header)
  37979. for k, v := range c.header_ {
  37980. reqHeaders[k] = v
  37981. }
  37982. reqHeaders.Set("User-Agent", c.s.userAgent())
  37983. var body io.Reader = nil
  37984. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  37985. if err != nil {
  37986. return nil, err
  37987. }
  37988. reqHeaders.Set("Content-Type", "application/json")
  37989. c.urlParams_.Set("alt", alt)
  37990. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  37991. urls += "?" + c.urlParams_.Encode()
  37992. req, _ := http.NewRequest("PATCH", urls, body)
  37993. req.Header = reqHeaders
  37994. googleapi.Expand(req.URL, map[string]string{
  37995. "profileId": strconv.FormatInt(c.profileId, 10),
  37996. })
  37997. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  37998. }
  37999. // Do executes the "dfareporting.remarketingLists.patch" call.
  38000. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38001. // status code is an error. Response headers are in either
  38002. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38003. // at all) in error.(*googleapi.Error).Header. Use
  38004. // googleapi.IsNotModified to check whether the returned error was
  38005. // because http.StatusNotModified was returned.
  38006. func (c *RemarketingListsPatchCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38007. gensupport.SetOptions(c.urlParams_, opts...)
  38008. res, err := c.doRequest("json")
  38009. if res != nil && res.StatusCode == http.StatusNotModified {
  38010. if res.Body != nil {
  38011. res.Body.Close()
  38012. }
  38013. return nil, &googleapi.Error{
  38014. Code: res.StatusCode,
  38015. Header: res.Header,
  38016. }
  38017. }
  38018. if err != nil {
  38019. return nil, err
  38020. }
  38021. defer googleapi.CloseBody(res)
  38022. if err := googleapi.CheckResponse(res); err != nil {
  38023. return nil, err
  38024. }
  38025. ret := &RemarketingList{
  38026. ServerResponse: googleapi.ServerResponse{
  38027. Header: res.Header,
  38028. HTTPStatusCode: res.StatusCode,
  38029. },
  38030. }
  38031. target := &ret
  38032. if err := gensupport.DecodeResponse(target, res); err != nil {
  38033. return nil, err
  38034. }
  38035. return ret, nil
  38036. // {
  38037. // "description": "Updates an existing remarketing list. This method supports patch semantics.",
  38038. // "httpMethod": "PATCH",
  38039. // "id": "dfareporting.remarketingLists.patch",
  38040. // "parameterOrder": [
  38041. // "profileId",
  38042. // "id"
  38043. // ],
  38044. // "parameters": {
  38045. // "id": {
  38046. // "description": "Remarketing list ID.",
  38047. // "format": "int64",
  38048. // "location": "query",
  38049. // "required": true,
  38050. // "type": "string"
  38051. // },
  38052. // "profileId": {
  38053. // "description": "User profile ID associated with this request.",
  38054. // "format": "int64",
  38055. // "location": "path",
  38056. // "required": true,
  38057. // "type": "string"
  38058. // }
  38059. // },
  38060. // "path": "userprofiles/{profileId}/remarketingLists",
  38061. // "request": {
  38062. // "$ref": "RemarketingList"
  38063. // },
  38064. // "response": {
  38065. // "$ref": "RemarketingList"
  38066. // },
  38067. // "scopes": [
  38068. // "https://www.googleapis.com/auth/dfatrafficking"
  38069. // ]
  38070. // }
  38071. }
  38072. // method id "dfareporting.remarketingLists.update":
  38073. type RemarketingListsUpdateCall struct {
  38074. s *Service
  38075. profileId int64
  38076. remarketinglist *RemarketingList
  38077. urlParams_ gensupport.URLParams
  38078. ctx_ context.Context
  38079. header_ http.Header
  38080. }
  38081. // Update: Updates an existing remarketing list.
  38082. func (r *RemarketingListsService) Update(profileId int64, remarketinglist *RemarketingList) *RemarketingListsUpdateCall {
  38083. c := &RemarketingListsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38084. c.profileId = profileId
  38085. c.remarketinglist = remarketinglist
  38086. return c
  38087. }
  38088. // Fields allows partial responses to be retrieved. See
  38089. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38090. // for more information.
  38091. func (c *RemarketingListsUpdateCall) Fields(s ...googleapi.Field) *RemarketingListsUpdateCall {
  38092. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38093. return c
  38094. }
  38095. // Context sets the context to be used in this call's Do method. Any
  38096. // pending HTTP request will be aborted if the provided context is
  38097. // canceled.
  38098. func (c *RemarketingListsUpdateCall) Context(ctx context.Context) *RemarketingListsUpdateCall {
  38099. c.ctx_ = ctx
  38100. return c
  38101. }
  38102. // Header returns an http.Header that can be modified by the caller to
  38103. // add HTTP headers to the request.
  38104. func (c *RemarketingListsUpdateCall) Header() http.Header {
  38105. if c.header_ == nil {
  38106. c.header_ = make(http.Header)
  38107. }
  38108. return c.header_
  38109. }
  38110. func (c *RemarketingListsUpdateCall) doRequest(alt string) (*http.Response, error) {
  38111. reqHeaders := make(http.Header)
  38112. for k, v := range c.header_ {
  38113. reqHeaders[k] = v
  38114. }
  38115. reqHeaders.Set("User-Agent", c.s.userAgent())
  38116. var body io.Reader = nil
  38117. body, err := googleapi.WithoutDataWrapper.JSONReader(c.remarketinglist)
  38118. if err != nil {
  38119. return nil, err
  38120. }
  38121. reqHeaders.Set("Content-Type", "application/json")
  38122. c.urlParams_.Set("alt", alt)
  38123. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/remarketingLists")
  38124. urls += "?" + c.urlParams_.Encode()
  38125. req, _ := http.NewRequest("PUT", urls, body)
  38126. req.Header = reqHeaders
  38127. googleapi.Expand(req.URL, map[string]string{
  38128. "profileId": strconv.FormatInt(c.profileId, 10),
  38129. })
  38130. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38131. }
  38132. // Do executes the "dfareporting.remarketingLists.update" call.
  38133. // Exactly one of *RemarketingList or error will be non-nil. Any non-2xx
  38134. // status code is an error. Response headers are in either
  38135. // *RemarketingList.ServerResponse.Header or (if a response was returned
  38136. // at all) in error.(*googleapi.Error).Header. Use
  38137. // googleapi.IsNotModified to check whether the returned error was
  38138. // because http.StatusNotModified was returned.
  38139. func (c *RemarketingListsUpdateCall) Do(opts ...googleapi.CallOption) (*RemarketingList, error) {
  38140. gensupport.SetOptions(c.urlParams_, opts...)
  38141. res, err := c.doRequest("json")
  38142. if res != nil && res.StatusCode == http.StatusNotModified {
  38143. if res.Body != nil {
  38144. res.Body.Close()
  38145. }
  38146. return nil, &googleapi.Error{
  38147. Code: res.StatusCode,
  38148. Header: res.Header,
  38149. }
  38150. }
  38151. if err != nil {
  38152. return nil, err
  38153. }
  38154. defer googleapi.CloseBody(res)
  38155. if err := googleapi.CheckResponse(res); err != nil {
  38156. return nil, err
  38157. }
  38158. ret := &RemarketingList{
  38159. ServerResponse: googleapi.ServerResponse{
  38160. Header: res.Header,
  38161. HTTPStatusCode: res.StatusCode,
  38162. },
  38163. }
  38164. target := &ret
  38165. if err := gensupport.DecodeResponse(target, res); err != nil {
  38166. return nil, err
  38167. }
  38168. return ret, nil
  38169. // {
  38170. // "description": "Updates an existing remarketing list.",
  38171. // "httpMethod": "PUT",
  38172. // "id": "dfareporting.remarketingLists.update",
  38173. // "parameterOrder": [
  38174. // "profileId"
  38175. // ],
  38176. // "parameters": {
  38177. // "profileId": {
  38178. // "description": "User profile ID associated with this request.",
  38179. // "format": "int64",
  38180. // "location": "path",
  38181. // "required": true,
  38182. // "type": "string"
  38183. // }
  38184. // },
  38185. // "path": "userprofiles/{profileId}/remarketingLists",
  38186. // "request": {
  38187. // "$ref": "RemarketingList"
  38188. // },
  38189. // "response": {
  38190. // "$ref": "RemarketingList"
  38191. // },
  38192. // "scopes": [
  38193. // "https://www.googleapis.com/auth/dfatrafficking"
  38194. // ]
  38195. // }
  38196. }
  38197. // method id "dfareporting.reports.delete":
  38198. type ReportsDeleteCall struct {
  38199. s *Service
  38200. profileId int64
  38201. reportId int64
  38202. urlParams_ gensupport.URLParams
  38203. ctx_ context.Context
  38204. header_ http.Header
  38205. }
  38206. // Delete: Deletes a report by its ID.
  38207. func (r *ReportsService) Delete(profileId int64, reportId int64) *ReportsDeleteCall {
  38208. c := &ReportsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38209. c.profileId = profileId
  38210. c.reportId = reportId
  38211. return c
  38212. }
  38213. // Fields allows partial responses to be retrieved. See
  38214. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38215. // for more information.
  38216. func (c *ReportsDeleteCall) Fields(s ...googleapi.Field) *ReportsDeleteCall {
  38217. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38218. return c
  38219. }
  38220. // Context sets the context to be used in this call's Do method. Any
  38221. // pending HTTP request will be aborted if the provided context is
  38222. // canceled.
  38223. func (c *ReportsDeleteCall) Context(ctx context.Context) *ReportsDeleteCall {
  38224. c.ctx_ = ctx
  38225. return c
  38226. }
  38227. // Header returns an http.Header that can be modified by the caller to
  38228. // add HTTP headers to the request.
  38229. func (c *ReportsDeleteCall) Header() http.Header {
  38230. if c.header_ == nil {
  38231. c.header_ = make(http.Header)
  38232. }
  38233. return c.header_
  38234. }
  38235. func (c *ReportsDeleteCall) doRequest(alt string) (*http.Response, error) {
  38236. reqHeaders := make(http.Header)
  38237. for k, v := range c.header_ {
  38238. reqHeaders[k] = v
  38239. }
  38240. reqHeaders.Set("User-Agent", c.s.userAgent())
  38241. var body io.Reader = nil
  38242. c.urlParams_.Set("alt", alt)
  38243. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  38244. urls += "?" + c.urlParams_.Encode()
  38245. req, _ := http.NewRequest("DELETE", urls, body)
  38246. req.Header = reqHeaders
  38247. googleapi.Expand(req.URL, map[string]string{
  38248. "profileId": strconv.FormatInt(c.profileId, 10),
  38249. "reportId": strconv.FormatInt(c.reportId, 10),
  38250. })
  38251. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38252. }
  38253. // Do executes the "dfareporting.reports.delete" call.
  38254. func (c *ReportsDeleteCall) Do(opts ...googleapi.CallOption) error {
  38255. gensupport.SetOptions(c.urlParams_, opts...)
  38256. res, err := c.doRequest("json")
  38257. if err != nil {
  38258. return err
  38259. }
  38260. defer googleapi.CloseBody(res)
  38261. if err := googleapi.CheckResponse(res); err != nil {
  38262. return err
  38263. }
  38264. return nil
  38265. // {
  38266. // "description": "Deletes a report by its ID.",
  38267. // "httpMethod": "DELETE",
  38268. // "id": "dfareporting.reports.delete",
  38269. // "parameterOrder": [
  38270. // "profileId",
  38271. // "reportId"
  38272. // ],
  38273. // "parameters": {
  38274. // "profileId": {
  38275. // "description": "The DFA user profile ID.",
  38276. // "format": "int64",
  38277. // "location": "path",
  38278. // "required": true,
  38279. // "type": "string"
  38280. // },
  38281. // "reportId": {
  38282. // "description": "The ID of the report.",
  38283. // "format": "int64",
  38284. // "location": "path",
  38285. // "required": true,
  38286. // "type": "string"
  38287. // }
  38288. // },
  38289. // "path": "userprofiles/{profileId}/reports/{reportId}",
  38290. // "scopes": [
  38291. // "https://www.googleapis.com/auth/dfareporting"
  38292. // ]
  38293. // }
  38294. }
  38295. // method id "dfareporting.reports.get":
  38296. type ReportsGetCall struct {
  38297. s *Service
  38298. profileId int64
  38299. reportId int64
  38300. urlParams_ gensupport.URLParams
  38301. ifNoneMatch_ string
  38302. ctx_ context.Context
  38303. header_ http.Header
  38304. }
  38305. // Get: Retrieves a report by its ID.
  38306. func (r *ReportsService) Get(profileId int64, reportId int64) *ReportsGetCall {
  38307. c := &ReportsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38308. c.profileId = profileId
  38309. c.reportId = reportId
  38310. return c
  38311. }
  38312. // Fields allows partial responses to be retrieved. See
  38313. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38314. // for more information.
  38315. func (c *ReportsGetCall) Fields(s ...googleapi.Field) *ReportsGetCall {
  38316. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38317. return c
  38318. }
  38319. // IfNoneMatch sets the optional parameter which makes the operation
  38320. // fail if the object's ETag matches the given value. This is useful for
  38321. // getting updates only after the object has changed since the last
  38322. // request. Use googleapi.IsNotModified to check whether the response
  38323. // error from Do is the result of In-None-Match.
  38324. func (c *ReportsGetCall) IfNoneMatch(entityTag string) *ReportsGetCall {
  38325. c.ifNoneMatch_ = entityTag
  38326. return c
  38327. }
  38328. // Context sets the context to be used in this call's Do method. Any
  38329. // pending HTTP request will be aborted if the provided context is
  38330. // canceled.
  38331. func (c *ReportsGetCall) Context(ctx context.Context) *ReportsGetCall {
  38332. c.ctx_ = ctx
  38333. return c
  38334. }
  38335. // Header returns an http.Header that can be modified by the caller to
  38336. // add HTTP headers to the request.
  38337. func (c *ReportsGetCall) Header() http.Header {
  38338. if c.header_ == nil {
  38339. c.header_ = make(http.Header)
  38340. }
  38341. return c.header_
  38342. }
  38343. func (c *ReportsGetCall) doRequest(alt string) (*http.Response, error) {
  38344. reqHeaders := make(http.Header)
  38345. for k, v := range c.header_ {
  38346. reqHeaders[k] = v
  38347. }
  38348. reqHeaders.Set("User-Agent", c.s.userAgent())
  38349. if c.ifNoneMatch_ != "" {
  38350. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38351. }
  38352. var body io.Reader = nil
  38353. c.urlParams_.Set("alt", alt)
  38354. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  38355. urls += "?" + c.urlParams_.Encode()
  38356. req, _ := http.NewRequest("GET", urls, body)
  38357. req.Header = reqHeaders
  38358. googleapi.Expand(req.URL, map[string]string{
  38359. "profileId": strconv.FormatInt(c.profileId, 10),
  38360. "reportId": strconv.FormatInt(c.reportId, 10),
  38361. })
  38362. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38363. }
  38364. // Do executes the "dfareporting.reports.get" call.
  38365. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  38366. // code is an error. Response headers are in either
  38367. // *Report.ServerResponse.Header or (if a response was returned at all)
  38368. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38369. // check whether the returned error was because http.StatusNotModified
  38370. // was returned.
  38371. func (c *ReportsGetCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  38372. gensupport.SetOptions(c.urlParams_, opts...)
  38373. res, err := c.doRequest("json")
  38374. if res != nil && res.StatusCode == http.StatusNotModified {
  38375. if res.Body != nil {
  38376. res.Body.Close()
  38377. }
  38378. return nil, &googleapi.Error{
  38379. Code: res.StatusCode,
  38380. Header: res.Header,
  38381. }
  38382. }
  38383. if err != nil {
  38384. return nil, err
  38385. }
  38386. defer googleapi.CloseBody(res)
  38387. if err := googleapi.CheckResponse(res); err != nil {
  38388. return nil, err
  38389. }
  38390. ret := &Report{
  38391. ServerResponse: googleapi.ServerResponse{
  38392. Header: res.Header,
  38393. HTTPStatusCode: res.StatusCode,
  38394. },
  38395. }
  38396. target := &ret
  38397. if err := gensupport.DecodeResponse(target, res); err != nil {
  38398. return nil, err
  38399. }
  38400. return ret, nil
  38401. // {
  38402. // "description": "Retrieves a report by its ID.",
  38403. // "httpMethod": "GET",
  38404. // "id": "dfareporting.reports.get",
  38405. // "parameterOrder": [
  38406. // "profileId",
  38407. // "reportId"
  38408. // ],
  38409. // "parameters": {
  38410. // "profileId": {
  38411. // "description": "The DFA user profile ID.",
  38412. // "format": "int64",
  38413. // "location": "path",
  38414. // "required": true,
  38415. // "type": "string"
  38416. // },
  38417. // "reportId": {
  38418. // "description": "The ID of the report.",
  38419. // "format": "int64",
  38420. // "location": "path",
  38421. // "required": true,
  38422. // "type": "string"
  38423. // }
  38424. // },
  38425. // "path": "userprofiles/{profileId}/reports/{reportId}",
  38426. // "response": {
  38427. // "$ref": "Report"
  38428. // },
  38429. // "scopes": [
  38430. // "https://www.googleapis.com/auth/dfareporting"
  38431. // ]
  38432. // }
  38433. }
  38434. // method id "dfareporting.reports.insert":
  38435. type ReportsInsertCall struct {
  38436. s *Service
  38437. profileId int64
  38438. report *Report
  38439. urlParams_ gensupport.URLParams
  38440. ctx_ context.Context
  38441. header_ http.Header
  38442. }
  38443. // Insert: Creates a report.
  38444. func (r *ReportsService) Insert(profileId int64, report *Report) *ReportsInsertCall {
  38445. c := &ReportsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38446. c.profileId = profileId
  38447. c.report = report
  38448. return c
  38449. }
  38450. // Fields allows partial responses to be retrieved. See
  38451. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38452. // for more information.
  38453. func (c *ReportsInsertCall) Fields(s ...googleapi.Field) *ReportsInsertCall {
  38454. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38455. return c
  38456. }
  38457. // Context sets the context to be used in this call's Do method. Any
  38458. // pending HTTP request will be aborted if the provided context is
  38459. // canceled.
  38460. func (c *ReportsInsertCall) Context(ctx context.Context) *ReportsInsertCall {
  38461. c.ctx_ = ctx
  38462. return c
  38463. }
  38464. // Header returns an http.Header that can be modified by the caller to
  38465. // add HTTP headers to the request.
  38466. func (c *ReportsInsertCall) Header() http.Header {
  38467. if c.header_ == nil {
  38468. c.header_ = make(http.Header)
  38469. }
  38470. return c.header_
  38471. }
  38472. func (c *ReportsInsertCall) doRequest(alt string) (*http.Response, error) {
  38473. reqHeaders := make(http.Header)
  38474. for k, v := range c.header_ {
  38475. reqHeaders[k] = v
  38476. }
  38477. reqHeaders.Set("User-Agent", c.s.userAgent())
  38478. var body io.Reader = nil
  38479. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  38480. if err != nil {
  38481. return nil, err
  38482. }
  38483. reqHeaders.Set("Content-Type", "application/json")
  38484. c.urlParams_.Set("alt", alt)
  38485. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  38486. urls += "?" + c.urlParams_.Encode()
  38487. req, _ := http.NewRequest("POST", urls, body)
  38488. req.Header = reqHeaders
  38489. googleapi.Expand(req.URL, map[string]string{
  38490. "profileId": strconv.FormatInt(c.profileId, 10),
  38491. })
  38492. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38493. }
  38494. // Do executes the "dfareporting.reports.insert" call.
  38495. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  38496. // code is an error. Response headers are in either
  38497. // *Report.ServerResponse.Header or (if a response was returned at all)
  38498. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38499. // check whether the returned error was because http.StatusNotModified
  38500. // was returned.
  38501. func (c *ReportsInsertCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  38502. gensupport.SetOptions(c.urlParams_, opts...)
  38503. res, err := c.doRequest("json")
  38504. if res != nil && res.StatusCode == http.StatusNotModified {
  38505. if res.Body != nil {
  38506. res.Body.Close()
  38507. }
  38508. return nil, &googleapi.Error{
  38509. Code: res.StatusCode,
  38510. Header: res.Header,
  38511. }
  38512. }
  38513. if err != nil {
  38514. return nil, err
  38515. }
  38516. defer googleapi.CloseBody(res)
  38517. if err := googleapi.CheckResponse(res); err != nil {
  38518. return nil, err
  38519. }
  38520. ret := &Report{
  38521. ServerResponse: googleapi.ServerResponse{
  38522. Header: res.Header,
  38523. HTTPStatusCode: res.StatusCode,
  38524. },
  38525. }
  38526. target := &ret
  38527. if err := gensupport.DecodeResponse(target, res); err != nil {
  38528. return nil, err
  38529. }
  38530. return ret, nil
  38531. // {
  38532. // "description": "Creates a report.",
  38533. // "httpMethod": "POST",
  38534. // "id": "dfareporting.reports.insert",
  38535. // "parameterOrder": [
  38536. // "profileId"
  38537. // ],
  38538. // "parameters": {
  38539. // "profileId": {
  38540. // "description": "The DFA user profile ID.",
  38541. // "format": "int64",
  38542. // "location": "path",
  38543. // "required": true,
  38544. // "type": "string"
  38545. // }
  38546. // },
  38547. // "path": "userprofiles/{profileId}/reports",
  38548. // "request": {
  38549. // "$ref": "Report"
  38550. // },
  38551. // "response": {
  38552. // "$ref": "Report"
  38553. // },
  38554. // "scopes": [
  38555. // "https://www.googleapis.com/auth/dfareporting"
  38556. // ]
  38557. // }
  38558. }
  38559. // method id "dfareporting.reports.list":
  38560. type ReportsListCall struct {
  38561. s *Service
  38562. profileId int64
  38563. urlParams_ gensupport.URLParams
  38564. ifNoneMatch_ string
  38565. ctx_ context.Context
  38566. header_ http.Header
  38567. }
  38568. // List: Retrieves list of reports.
  38569. func (r *ReportsService) List(profileId int64) *ReportsListCall {
  38570. c := &ReportsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38571. c.profileId = profileId
  38572. return c
  38573. }
  38574. // MaxResults sets the optional parameter "maxResults": Maximum number
  38575. // of results to return.
  38576. func (c *ReportsListCall) MaxResults(maxResults int64) *ReportsListCall {
  38577. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  38578. return c
  38579. }
  38580. // PageToken sets the optional parameter "pageToken": The value of the
  38581. // nextToken from the previous result page.
  38582. func (c *ReportsListCall) PageToken(pageToken string) *ReportsListCall {
  38583. c.urlParams_.Set("pageToken", pageToken)
  38584. return c
  38585. }
  38586. // Scope sets the optional parameter "scope": The scope that defines
  38587. // which results are returned.
  38588. //
  38589. // Possible values:
  38590. // "ALL" - All reports in account.
  38591. // "MINE" (default) - My reports.
  38592. func (c *ReportsListCall) Scope(scope string) *ReportsListCall {
  38593. c.urlParams_.Set("scope", scope)
  38594. return c
  38595. }
  38596. // SortField sets the optional parameter "sortField": The field by which
  38597. // to sort the list.
  38598. //
  38599. // Possible values:
  38600. // "ID" - Sort by report ID.
  38601. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastModifiedTime' field.
  38602. // "NAME" - Sort by name of reports.
  38603. func (c *ReportsListCall) SortField(sortField string) *ReportsListCall {
  38604. c.urlParams_.Set("sortField", sortField)
  38605. return c
  38606. }
  38607. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  38608. // results.
  38609. //
  38610. // Possible values:
  38611. // "ASCENDING" - Ascending order.
  38612. // "DESCENDING" (default) - Descending order.
  38613. func (c *ReportsListCall) SortOrder(sortOrder string) *ReportsListCall {
  38614. c.urlParams_.Set("sortOrder", sortOrder)
  38615. return c
  38616. }
  38617. // Fields allows partial responses to be retrieved. See
  38618. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38619. // for more information.
  38620. func (c *ReportsListCall) Fields(s ...googleapi.Field) *ReportsListCall {
  38621. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38622. return c
  38623. }
  38624. // IfNoneMatch sets the optional parameter which makes the operation
  38625. // fail if the object's ETag matches the given value. This is useful for
  38626. // getting updates only after the object has changed since the last
  38627. // request. Use googleapi.IsNotModified to check whether the response
  38628. // error from Do is the result of In-None-Match.
  38629. func (c *ReportsListCall) IfNoneMatch(entityTag string) *ReportsListCall {
  38630. c.ifNoneMatch_ = entityTag
  38631. return c
  38632. }
  38633. // Context sets the context to be used in this call's Do method. Any
  38634. // pending HTTP request will be aborted if the provided context is
  38635. // canceled.
  38636. func (c *ReportsListCall) Context(ctx context.Context) *ReportsListCall {
  38637. c.ctx_ = ctx
  38638. return c
  38639. }
  38640. // Header returns an http.Header that can be modified by the caller to
  38641. // add HTTP headers to the request.
  38642. func (c *ReportsListCall) Header() http.Header {
  38643. if c.header_ == nil {
  38644. c.header_ = make(http.Header)
  38645. }
  38646. return c.header_
  38647. }
  38648. func (c *ReportsListCall) doRequest(alt string) (*http.Response, error) {
  38649. reqHeaders := make(http.Header)
  38650. for k, v := range c.header_ {
  38651. reqHeaders[k] = v
  38652. }
  38653. reqHeaders.Set("User-Agent", c.s.userAgent())
  38654. if c.ifNoneMatch_ != "" {
  38655. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  38656. }
  38657. var body io.Reader = nil
  38658. c.urlParams_.Set("alt", alt)
  38659. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports")
  38660. urls += "?" + c.urlParams_.Encode()
  38661. req, _ := http.NewRequest("GET", urls, body)
  38662. req.Header = reqHeaders
  38663. googleapi.Expand(req.URL, map[string]string{
  38664. "profileId": strconv.FormatInt(c.profileId, 10),
  38665. })
  38666. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38667. }
  38668. // Do executes the "dfareporting.reports.list" call.
  38669. // Exactly one of *ReportList or error will be non-nil. Any non-2xx
  38670. // status code is an error. Response headers are in either
  38671. // *ReportList.ServerResponse.Header or (if a response was returned at
  38672. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  38673. // to check whether the returned error was because
  38674. // http.StatusNotModified was returned.
  38675. func (c *ReportsListCall) Do(opts ...googleapi.CallOption) (*ReportList, error) {
  38676. gensupport.SetOptions(c.urlParams_, opts...)
  38677. res, err := c.doRequest("json")
  38678. if res != nil && res.StatusCode == http.StatusNotModified {
  38679. if res.Body != nil {
  38680. res.Body.Close()
  38681. }
  38682. return nil, &googleapi.Error{
  38683. Code: res.StatusCode,
  38684. Header: res.Header,
  38685. }
  38686. }
  38687. if err != nil {
  38688. return nil, err
  38689. }
  38690. defer googleapi.CloseBody(res)
  38691. if err := googleapi.CheckResponse(res); err != nil {
  38692. return nil, err
  38693. }
  38694. ret := &ReportList{
  38695. ServerResponse: googleapi.ServerResponse{
  38696. Header: res.Header,
  38697. HTTPStatusCode: res.StatusCode,
  38698. },
  38699. }
  38700. target := &ret
  38701. if err := gensupport.DecodeResponse(target, res); err != nil {
  38702. return nil, err
  38703. }
  38704. return ret, nil
  38705. // {
  38706. // "description": "Retrieves list of reports.",
  38707. // "httpMethod": "GET",
  38708. // "id": "dfareporting.reports.list",
  38709. // "parameterOrder": [
  38710. // "profileId"
  38711. // ],
  38712. // "parameters": {
  38713. // "maxResults": {
  38714. // "default": "10",
  38715. // "description": "Maximum number of results to return.",
  38716. // "format": "int32",
  38717. // "location": "query",
  38718. // "maximum": "10",
  38719. // "minimum": "0",
  38720. // "type": "integer"
  38721. // },
  38722. // "pageToken": {
  38723. // "description": "The value of the nextToken from the previous result page.",
  38724. // "location": "query",
  38725. // "type": "string"
  38726. // },
  38727. // "profileId": {
  38728. // "description": "The DFA user profile ID.",
  38729. // "format": "int64",
  38730. // "location": "path",
  38731. // "required": true,
  38732. // "type": "string"
  38733. // },
  38734. // "scope": {
  38735. // "default": "MINE",
  38736. // "description": "The scope that defines which results are returned.",
  38737. // "enum": [
  38738. // "ALL",
  38739. // "MINE"
  38740. // ],
  38741. // "enumDescriptions": [
  38742. // "All reports in account.",
  38743. // "My reports."
  38744. // ],
  38745. // "location": "query",
  38746. // "type": "string"
  38747. // },
  38748. // "sortField": {
  38749. // "default": "LAST_MODIFIED_TIME",
  38750. // "description": "The field by which to sort the list.",
  38751. // "enum": [
  38752. // "ID",
  38753. // "LAST_MODIFIED_TIME",
  38754. // "NAME"
  38755. // ],
  38756. // "enumDescriptions": [
  38757. // "Sort by report ID.",
  38758. // "Sort by 'lastModifiedTime' field.",
  38759. // "Sort by name of reports."
  38760. // ],
  38761. // "location": "query",
  38762. // "type": "string"
  38763. // },
  38764. // "sortOrder": {
  38765. // "default": "DESCENDING",
  38766. // "description": "Order of sorted results.",
  38767. // "enum": [
  38768. // "ASCENDING",
  38769. // "DESCENDING"
  38770. // ],
  38771. // "enumDescriptions": [
  38772. // "Ascending order.",
  38773. // "Descending order."
  38774. // ],
  38775. // "location": "query",
  38776. // "type": "string"
  38777. // }
  38778. // },
  38779. // "path": "userprofiles/{profileId}/reports",
  38780. // "response": {
  38781. // "$ref": "ReportList"
  38782. // },
  38783. // "scopes": [
  38784. // "https://www.googleapis.com/auth/dfareporting"
  38785. // ]
  38786. // }
  38787. }
  38788. // Pages invokes f for each page of results.
  38789. // A non-nil error returned from f will halt the iteration.
  38790. // The provided context supersedes any context provided to the Context method.
  38791. func (c *ReportsListCall) Pages(ctx context.Context, f func(*ReportList) error) error {
  38792. c.ctx_ = ctx
  38793. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  38794. for {
  38795. x, err := c.Do()
  38796. if err != nil {
  38797. return err
  38798. }
  38799. if err := f(x); err != nil {
  38800. return err
  38801. }
  38802. if x.NextPageToken == "" {
  38803. return nil
  38804. }
  38805. c.PageToken(x.NextPageToken)
  38806. }
  38807. }
  38808. // method id "dfareporting.reports.patch":
  38809. type ReportsPatchCall struct {
  38810. s *Service
  38811. profileId int64
  38812. reportId int64
  38813. report *Report
  38814. urlParams_ gensupport.URLParams
  38815. ctx_ context.Context
  38816. header_ http.Header
  38817. }
  38818. // Patch: Updates a report. This method supports patch semantics.
  38819. func (r *ReportsService) Patch(profileId int64, reportId int64, report *Report) *ReportsPatchCall {
  38820. c := &ReportsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38821. c.profileId = profileId
  38822. c.reportId = reportId
  38823. c.report = report
  38824. return c
  38825. }
  38826. // Fields allows partial responses to be retrieved. See
  38827. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38828. // for more information.
  38829. func (c *ReportsPatchCall) Fields(s ...googleapi.Field) *ReportsPatchCall {
  38830. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38831. return c
  38832. }
  38833. // Context sets the context to be used in this call's Do method. Any
  38834. // pending HTTP request will be aborted if the provided context is
  38835. // canceled.
  38836. func (c *ReportsPatchCall) Context(ctx context.Context) *ReportsPatchCall {
  38837. c.ctx_ = ctx
  38838. return c
  38839. }
  38840. // Header returns an http.Header that can be modified by the caller to
  38841. // add HTTP headers to the request.
  38842. func (c *ReportsPatchCall) Header() http.Header {
  38843. if c.header_ == nil {
  38844. c.header_ = make(http.Header)
  38845. }
  38846. return c.header_
  38847. }
  38848. func (c *ReportsPatchCall) doRequest(alt string) (*http.Response, error) {
  38849. reqHeaders := make(http.Header)
  38850. for k, v := range c.header_ {
  38851. reqHeaders[k] = v
  38852. }
  38853. reqHeaders.Set("User-Agent", c.s.userAgent())
  38854. var body io.Reader = nil
  38855. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  38856. if err != nil {
  38857. return nil, err
  38858. }
  38859. reqHeaders.Set("Content-Type", "application/json")
  38860. c.urlParams_.Set("alt", alt)
  38861. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  38862. urls += "?" + c.urlParams_.Encode()
  38863. req, _ := http.NewRequest("PATCH", urls, body)
  38864. req.Header = reqHeaders
  38865. googleapi.Expand(req.URL, map[string]string{
  38866. "profileId": strconv.FormatInt(c.profileId, 10),
  38867. "reportId": strconv.FormatInt(c.reportId, 10),
  38868. })
  38869. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  38870. }
  38871. // Do executes the "dfareporting.reports.patch" call.
  38872. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  38873. // code is an error. Response headers are in either
  38874. // *Report.ServerResponse.Header or (if a response was returned at all)
  38875. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  38876. // check whether the returned error was because http.StatusNotModified
  38877. // was returned.
  38878. func (c *ReportsPatchCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  38879. gensupport.SetOptions(c.urlParams_, opts...)
  38880. res, err := c.doRequest("json")
  38881. if res != nil && res.StatusCode == http.StatusNotModified {
  38882. if res.Body != nil {
  38883. res.Body.Close()
  38884. }
  38885. return nil, &googleapi.Error{
  38886. Code: res.StatusCode,
  38887. Header: res.Header,
  38888. }
  38889. }
  38890. if err != nil {
  38891. return nil, err
  38892. }
  38893. defer googleapi.CloseBody(res)
  38894. if err := googleapi.CheckResponse(res); err != nil {
  38895. return nil, err
  38896. }
  38897. ret := &Report{
  38898. ServerResponse: googleapi.ServerResponse{
  38899. Header: res.Header,
  38900. HTTPStatusCode: res.StatusCode,
  38901. },
  38902. }
  38903. target := &ret
  38904. if err := gensupport.DecodeResponse(target, res); err != nil {
  38905. return nil, err
  38906. }
  38907. return ret, nil
  38908. // {
  38909. // "description": "Updates a report. This method supports patch semantics.",
  38910. // "httpMethod": "PATCH",
  38911. // "id": "dfareporting.reports.patch",
  38912. // "parameterOrder": [
  38913. // "profileId",
  38914. // "reportId"
  38915. // ],
  38916. // "parameters": {
  38917. // "profileId": {
  38918. // "description": "The DFA user profile ID.",
  38919. // "format": "int64",
  38920. // "location": "path",
  38921. // "required": true,
  38922. // "type": "string"
  38923. // },
  38924. // "reportId": {
  38925. // "description": "The ID of the report.",
  38926. // "format": "int64",
  38927. // "location": "path",
  38928. // "required": true,
  38929. // "type": "string"
  38930. // }
  38931. // },
  38932. // "path": "userprofiles/{profileId}/reports/{reportId}",
  38933. // "request": {
  38934. // "$ref": "Report"
  38935. // },
  38936. // "response": {
  38937. // "$ref": "Report"
  38938. // },
  38939. // "scopes": [
  38940. // "https://www.googleapis.com/auth/dfareporting"
  38941. // ]
  38942. // }
  38943. }
  38944. // method id "dfareporting.reports.run":
  38945. type ReportsRunCall struct {
  38946. s *Service
  38947. profileId int64
  38948. reportId int64
  38949. urlParams_ gensupport.URLParams
  38950. ctx_ context.Context
  38951. header_ http.Header
  38952. }
  38953. // Run: Runs a report.
  38954. func (r *ReportsService) Run(profileId int64, reportId int64) *ReportsRunCall {
  38955. c := &ReportsRunCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  38956. c.profileId = profileId
  38957. c.reportId = reportId
  38958. return c
  38959. }
  38960. // Synchronous sets the optional parameter "synchronous": If set and
  38961. // true, tries to run the report synchronously.
  38962. func (c *ReportsRunCall) Synchronous(synchronous bool) *ReportsRunCall {
  38963. c.urlParams_.Set("synchronous", fmt.Sprint(synchronous))
  38964. return c
  38965. }
  38966. // Fields allows partial responses to be retrieved. See
  38967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  38968. // for more information.
  38969. func (c *ReportsRunCall) Fields(s ...googleapi.Field) *ReportsRunCall {
  38970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  38971. return c
  38972. }
  38973. // Context sets the context to be used in this call's Do method. Any
  38974. // pending HTTP request will be aborted if the provided context is
  38975. // canceled.
  38976. func (c *ReportsRunCall) Context(ctx context.Context) *ReportsRunCall {
  38977. c.ctx_ = ctx
  38978. return c
  38979. }
  38980. // Header returns an http.Header that can be modified by the caller to
  38981. // add HTTP headers to the request.
  38982. func (c *ReportsRunCall) Header() http.Header {
  38983. if c.header_ == nil {
  38984. c.header_ = make(http.Header)
  38985. }
  38986. return c.header_
  38987. }
  38988. func (c *ReportsRunCall) doRequest(alt string) (*http.Response, error) {
  38989. reqHeaders := make(http.Header)
  38990. for k, v := range c.header_ {
  38991. reqHeaders[k] = v
  38992. }
  38993. reqHeaders.Set("User-Agent", c.s.userAgent())
  38994. var body io.Reader = nil
  38995. c.urlParams_.Set("alt", alt)
  38996. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/run")
  38997. urls += "?" + c.urlParams_.Encode()
  38998. req, _ := http.NewRequest("POST", urls, body)
  38999. req.Header = reqHeaders
  39000. googleapi.Expand(req.URL, map[string]string{
  39001. "profileId": strconv.FormatInt(c.profileId, 10),
  39002. "reportId": strconv.FormatInt(c.reportId, 10),
  39003. })
  39004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39005. }
  39006. // Do executes the "dfareporting.reports.run" call.
  39007. // Exactly one of *File or error will be non-nil. Any non-2xx status
  39008. // code is an error. Response headers are in either
  39009. // *File.ServerResponse.Header or (if a response was returned at all) in
  39010. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39011. // whether the returned error was because http.StatusNotModified was
  39012. // returned.
  39013. func (c *ReportsRunCall) Do(opts ...googleapi.CallOption) (*File, error) {
  39014. gensupport.SetOptions(c.urlParams_, opts...)
  39015. res, err := c.doRequest("json")
  39016. if res != nil && res.StatusCode == http.StatusNotModified {
  39017. if res.Body != nil {
  39018. res.Body.Close()
  39019. }
  39020. return nil, &googleapi.Error{
  39021. Code: res.StatusCode,
  39022. Header: res.Header,
  39023. }
  39024. }
  39025. if err != nil {
  39026. return nil, err
  39027. }
  39028. defer googleapi.CloseBody(res)
  39029. if err := googleapi.CheckResponse(res); err != nil {
  39030. return nil, err
  39031. }
  39032. ret := &File{
  39033. ServerResponse: googleapi.ServerResponse{
  39034. Header: res.Header,
  39035. HTTPStatusCode: res.StatusCode,
  39036. },
  39037. }
  39038. target := &ret
  39039. if err := gensupport.DecodeResponse(target, res); err != nil {
  39040. return nil, err
  39041. }
  39042. return ret, nil
  39043. // {
  39044. // "description": "Runs a report.",
  39045. // "httpMethod": "POST",
  39046. // "id": "dfareporting.reports.run",
  39047. // "parameterOrder": [
  39048. // "profileId",
  39049. // "reportId"
  39050. // ],
  39051. // "parameters": {
  39052. // "profileId": {
  39053. // "description": "The DFA profile ID.",
  39054. // "format": "int64",
  39055. // "location": "path",
  39056. // "required": true,
  39057. // "type": "string"
  39058. // },
  39059. // "reportId": {
  39060. // "description": "The ID of the report.",
  39061. // "format": "int64",
  39062. // "location": "path",
  39063. // "required": true,
  39064. // "type": "string"
  39065. // },
  39066. // "synchronous": {
  39067. // "default": "false",
  39068. // "description": "If set and true, tries to run the report synchronously.",
  39069. // "location": "query",
  39070. // "type": "boolean"
  39071. // }
  39072. // },
  39073. // "path": "userprofiles/{profileId}/reports/{reportId}/run",
  39074. // "response": {
  39075. // "$ref": "File"
  39076. // },
  39077. // "scopes": [
  39078. // "https://www.googleapis.com/auth/dfareporting"
  39079. // ]
  39080. // }
  39081. }
  39082. // method id "dfareporting.reports.update":
  39083. type ReportsUpdateCall struct {
  39084. s *Service
  39085. profileId int64
  39086. reportId int64
  39087. report *Report
  39088. urlParams_ gensupport.URLParams
  39089. ctx_ context.Context
  39090. header_ http.Header
  39091. }
  39092. // Update: Updates a report.
  39093. func (r *ReportsService) Update(profileId int64, reportId int64, report *Report) *ReportsUpdateCall {
  39094. c := &ReportsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39095. c.profileId = profileId
  39096. c.reportId = reportId
  39097. c.report = report
  39098. return c
  39099. }
  39100. // Fields allows partial responses to be retrieved. See
  39101. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39102. // for more information.
  39103. func (c *ReportsUpdateCall) Fields(s ...googleapi.Field) *ReportsUpdateCall {
  39104. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39105. return c
  39106. }
  39107. // Context sets the context to be used in this call's Do method. Any
  39108. // pending HTTP request will be aborted if the provided context is
  39109. // canceled.
  39110. func (c *ReportsUpdateCall) Context(ctx context.Context) *ReportsUpdateCall {
  39111. c.ctx_ = ctx
  39112. return c
  39113. }
  39114. // Header returns an http.Header that can be modified by the caller to
  39115. // add HTTP headers to the request.
  39116. func (c *ReportsUpdateCall) Header() http.Header {
  39117. if c.header_ == nil {
  39118. c.header_ = make(http.Header)
  39119. }
  39120. return c.header_
  39121. }
  39122. func (c *ReportsUpdateCall) doRequest(alt string) (*http.Response, error) {
  39123. reqHeaders := make(http.Header)
  39124. for k, v := range c.header_ {
  39125. reqHeaders[k] = v
  39126. }
  39127. reqHeaders.Set("User-Agent", c.s.userAgent())
  39128. var body io.Reader = nil
  39129. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39130. if err != nil {
  39131. return nil, err
  39132. }
  39133. reqHeaders.Set("Content-Type", "application/json")
  39134. c.urlParams_.Set("alt", alt)
  39135. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}")
  39136. urls += "?" + c.urlParams_.Encode()
  39137. req, _ := http.NewRequest("PUT", urls, body)
  39138. req.Header = reqHeaders
  39139. googleapi.Expand(req.URL, map[string]string{
  39140. "profileId": strconv.FormatInt(c.profileId, 10),
  39141. "reportId": strconv.FormatInt(c.reportId, 10),
  39142. })
  39143. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39144. }
  39145. // Do executes the "dfareporting.reports.update" call.
  39146. // Exactly one of *Report or error will be non-nil. Any non-2xx status
  39147. // code is an error. Response headers are in either
  39148. // *Report.ServerResponse.Header or (if a response was returned at all)
  39149. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  39150. // check whether the returned error was because http.StatusNotModified
  39151. // was returned.
  39152. func (c *ReportsUpdateCall) Do(opts ...googleapi.CallOption) (*Report, error) {
  39153. gensupport.SetOptions(c.urlParams_, opts...)
  39154. res, err := c.doRequest("json")
  39155. if res != nil && res.StatusCode == http.StatusNotModified {
  39156. if res.Body != nil {
  39157. res.Body.Close()
  39158. }
  39159. return nil, &googleapi.Error{
  39160. Code: res.StatusCode,
  39161. Header: res.Header,
  39162. }
  39163. }
  39164. if err != nil {
  39165. return nil, err
  39166. }
  39167. defer googleapi.CloseBody(res)
  39168. if err := googleapi.CheckResponse(res); err != nil {
  39169. return nil, err
  39170. }
  39171. ret := &Report{
  39172. ServerResponse: googleapi.ServerResponse{
  39173. Header: res.Header,
  39174. HTTPStatusCode: res.StatusCode,
  39175. },
  39176. }
  39177. target := &ret
  39178. if err := gensupport.DecodeResponse(target, res); err != nil {
  39179. return nil, err
  39180. }
  39181. return ret, nil
  39182. // {
  39183. // "description": "Updates a report.",
  39184. // "httpMethod": "PUT",
  39185. // "id": "dfareporting.reports.update",
  39186. // "parameterOrder": [
  39187. // "profileId",
  39188. // "reportId"
  39189. // ],
  39190. // "parameters": {
  39191. // "profileId": {
  39192. // "description": "The DFA user profile ID.",
  39193. // "format": "int64",
  39194. // "location": "path",
  39195. // "required": true,
  39196. // "type": "string"
  39197. // },
  39198. // "reportId": {
  39199. // "description": "The ID of the report.",
  39200. // "format": "int64",
  39201. // "location": "path",
  39202. // "required": true,
  39203. // "type": "string"
  39204. // }
  39205. // },
  39206. // "path": "userprofiles/{profileId}/reports/{reportId}",
  39207. // "request": {
  39208. // "$ref": "Report"
  39209. // },
  39210. // "response": {
  39211. // "$ref": "Report"
  39212. // },
  39213. // "scopes": [
  39214. // "https://www.googleapis.com/auth/dfareporting"
  39215. // ]
  39216. // }
  39217. }
  39218. // method id "dfareporting.reports.compatibleFields.query":
  39219. type ReportsCompatibleFieldsQueryCall struct {
  39220. s *Service
  39221. profileId int64
  39222. report *Report
  39223. urlParams_ gensupport.URLParams
  39224. ctx_ context.Context
  39225. header_ http.Header
  39226. }
  39227. // Query: Returns the fields that are compatible to be selected in the
  39228. // respective sections of a report criteria, given the fields already
  39229. // selected in the input report and user permissions.
  39230. func (r *ReportsCompatibleFieldsService) Query(profileId int64, report *Report) *ReportsCompatibleFieldsQueryCall {
  39231. c := &ReportsCompatibleFieldsQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39232. c.profileId = profileId
  39233. c.report = report
  39234. return c
  39235. }
  39236. // Fields allows partial responses to be retrieved. See
  39237. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39238. // for more information.
  39239. func (c *ReportsCompatibleFieldsQueryCall) Fields(s ...googleapi.Field) *ReportsCompatibleFieldsQueryCall {
  39240. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39241. return c
  39242. }
  39243. // Context sets the context to be used in this call's Do method. Any
  39244. // pending HTTP request will be aborted if the provided context is
  39245. // canceled.
  39246. func (c *ReportsCompatibleFieldsQueryCall) Context(ctx context.Context) *ReportsCompatibleFieldsQueryCall {
  39247. c.ctx_ = ctx
  39248. return c
  39249. }
  39250. // Header returns an http.Header that can be modified by the caller to
  39251. // add HTTP headers to the request.
  39252. func (c *ReportsCompatibleFieldsQueryCall) Header() http.Header {
  39253. if c.header_ == nil {
  39254. c.header_ = make(http.Header)
  39255. }
  39256. return c.header_
  39257. }
  39258. func (c *ReportsCompatibleFieldsQueryCall) doRequest(alt string) (*http.Response, error) {
  39259. reqHeaders := make(http.Header)
  39260. for k, v := range c.header_ {
  39261. reqHeaders[k] = v
  39262. }
  39263. reqHeaders.Set("User-Agent", c.s.userAgent())
  39264. var body io.Reader = nil
  39265. body, err := googleapi.WithoutDataWrapper.JSONReader(c.report)
  39266. if err != nil {
  39267. return nil, err
  39268. }
  39269. reqHeaders.Set("Content-Type", "application/json")
  39270. c.urlParams_.Set("alt", alt)
  39271. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/compatiblefields/query")
  39272. urls += "?" + c.urlParams_.Encode()
  39273. req, _ := http.NewRequest("POST", urls, body)
  39274. req.Header = reqHeaders
  39275. googleapi.Expand(req.URL, map[string]string{
  39276. "profileId": strconv.FormatInt(c.profileId, 10),
  39277. })
  39278. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39279. }
  39280. // Do executes the "dfareporting.reports.compatibleFields.query" call.
  39281. // Exactly one of *CompatibleFields or error will be non-nil. Any
  39282. // non-2xx status code is an error. Response headers are in either
  39283. // *CompatibleFields.ServerResponse.Header or (if a response was
  39284. // returned at all) in error.(*googleapi.Error).Header. Use
  39285. // googleapi.IsNotModified to check whether the returned error was
  39286. // because http.StatusNotModified was returned.
  39287. func (c *ReportsCompatibleFieldsQueryCall) Do(opts ...googleapi.CallOption) (*CompatibleFields, error) {
  39288. gensupport.SetOptions(c.urlParams_, opts...)
  39289. res, err := c.doRequest("json")
  39290. if res != nil && res.StatusCode == http.StatusNotModified {
  39291. if res.Body != nil {
  39292. res.Body.Close()
  39293. }
  39294. return nil, &googleapi.Error{
  39295. Code: res.StatusCode,
  39296. Header: res.Header,
  39297. }
  39298. }
  39299. if err != nil {
  39300. return nil, err
  39301. }
  39302. defer googleapi.CloseBody(res)
  39303. if err := googleapi.CheckResponse(res); err != nil {
  39304. return nil, err
  39305. }
  39306. ret := &CompatibleFields{
  39307. ServerResponse: googleapi.ServerResponse{
  39308. Header: res.Header,
  39309. HTTPStatusCode: res.StatusCode,
  39310. },
  39311. }
  39312. target := &ret
  39313. if err := gensupport.DecodeResponse(target, res); err != nil {
  39314. return nil, err
  39315. }
  39316. return ret, nil
  39317. // {
  39318. // "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.",
  39319. // "httpMethod": "POST",
  39320. // "id": "dfareporting.reports.compatibleFields.query",
  39321. // "parameterOrder": [
  39322. // "profileId"
  39323. // ],
  39324. // "parameters": {
  39325. // "profileId": {
  39326. // "description": "The DFA user profile ID.",
  39327. // "format": "int64",
  39328. // "location": "path",
  39329. // "required": true,
  39330. // "type": "string"
  39331. // }
  39332. // },
  39333. // "path": "userprofiles/{profileId}/reports/compatiblefields/query",
  39334. // "request": {
  39335. // "$ref": "Report"
  39336. // },
  39337. // "response": {
  39338. // "$ref": "CompatibleFields"
  39339. // },
  39340. // "scopes": [
  39341. // "https://www.googleapis.com/auth/dfareporting"
  39342. // ]
  39343. // }
  39344. }
  39345. // method id "dfareporting.reports.files.get":
  39346. type ReportsFilesGetCall struct {
  39347. s *Service
  39348. profileId int64
  39349. reportId int64
  39350. fileId int64
  39351. urlParams_ gensupport.URLParams
  39352. ifNoneMatch_ string
  39353. ctx_ context.Context
  39354. header_ http.Header
  39355. }
  39356. // Get: Retrieves a report file. This method supports media download.
  39357. func (r *ReportsFilesService) Get(profileId int64, reportId int64, fileId int64) *ReportsFilesGetCall {
  39358. c := &ReportsFilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39359. c.profileId = profileId
  39360. c.reportId = reportId
  39361. c.fileId = fileId
  39362. return c
  39363. }
  39364. // Fields allows partial responses to be retrieved. See
  39365. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39366. // for more information.
  39367. func (c *ReportsFilesGetCall) Fields(s ...googleapi.Field) *ReportsFilesGetCall {
  39368. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39369. return c
  39370. }
  39371. // IfNoneMatch sets the optional parameter which makes the operation
  39372. // fail if the object's ETag matches the given value. This is useful for
  39373. // getting updates only after the object has changed since the last
  39374. // request. Use googleapi.IsNotModified to check whether the response
  39375. // error from Do is the result of In-None-Match.
  39376. func (c *ReportsFilesGetCall) IfNoneMatch(entityTag string) *ReportsFilesGetCall {
  39377. c.ifNoneMatch_ = entityTag
  39378. return c
  39379. }
  39380. // Context sets the context to be used in this call's Do and Download
  39381. // methods. Any pending HTTP request will be aborted if the provided
  39382. // context is canceled.
  39383. func (c *ReportsFilesGetCall) Context(ctx context.Context) *ReportsFilesGetCall {
  39384. c.ctx_ = ctx
  39385. return c
  39386. }
  39387. // Header returns an http.Header that can be modified by the caller to
  39388. // add HTTP headers to the request.
  39389. func (c *ReportsFilesGetCall) Header() http.Header {
  39390. if c.header_ == nil {
  39391. c.header_ = make(http.Header)
  39392. }
  39393. return c.header_
  39394. }
  39395. func (c *ReportsFilesGetCall) doRequest(alt string) (*http.Response, error) {
  39396. reqHeaders := make(http.Header)
  39397. for k, v := range c.header_ {
  39398. reqHeaders[k] = v
  39399. }
  39400. reqHeaders.Set("User-Agent", c.s.userAgent())
  39401. if c.ifNoneMatch_ != "" {
  39402. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39403. }
  39404. var body io.Reader = nil
  39405. c.urlParams_.Set("alt", alt)
  39406. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files/{fileId}")
  39407. urls += "?" + c.urlParams_.Encode()
  39408. req, _ := http.NewRequest("GET", urls, body)
  39409. req.Header = reqHeaders
  39410. googleapi.Expand(req.URL, map[string]string{
  39411. "profileId": strconv.FormatInt(c.profileId, 10),
  39412. "reportId": strconv.FormatInt(c.reportId, 10),
  39413. "fileId": strconv.FormatInt(c.fileId, 10),
  39414. })
  39415. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39416. }
  39417. // Download fetches the API endpoint's "media" value, instead of the normal
  39418. // API response value. If the returned error is nil, the Response is guaranteed to
  39419. // have a 2xx status code. Callers must close the Response.Body as usual.
  39420. func (c *ReportsFilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  39421. gensupport.SetOptions(c.urlParams_, opts...)
  39422. res, err := c.doRequest("media")
  39423. if err != nil {
  39424. return nil, err
  39425. }
  39426. if err := googleapi.CheckMediaResponse(res); err != nil {
  39427. res.Body.Close()
  39428. return nil, err
  39429. }
  39430. return res, nil
  39431. }
  39432. // Do executes the "dfareporting.reports.files.get" call.
  39433. // Exactly one of *File or error will be non-nil. Any non-2xx status
  39434. // code is an error. Response headers are in either
  39435. // *File.ServerResponse.Header or (if a response was returned at all) in
  39436. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39437. // whether the returned error was because http.StatusNotModified was
  39438. // returned.
  39439. func (c *ReportsFilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  39440. gensupport.SetOptions(c.urlParams_, opts...)
  39441. res, err := c.doRequest("json")
  39442. if res != nil && res.StatusCode == http.StatusNotModified {
  39443. if res.Body != nil {
  39444. res.Body.Close()
  39445. }
  39446. return nil, &googleapi.Error{
  39447. Code: res.StatusCode,
  39448. Header: res.Header,
  39449. }
  39450. }
  39451. if err != nil {
  39452. return nil, err
  39453. }
  39454. defer googleapi.CloseBody(res)
  39455. if err := googleapi.CheckResponse(res); err != nil {
  39456. return nil, err
  39457. }
  39458. ret := &File{
  39459. ServerResponse: googleapi.ServerResponse{
  39460. Header: res.Header,
  39461. HTTPStatusCode: res.StatusCode,
  39462. },
  39463. }
  39464. target := &ret
  39465. if err := gensupport.DecodeResponse(target, res); err != nil {
  39466. return nil, err
  39467. }
  39468. return ret, nil
  39469. // {
  39470. // "description": "Retrieves a report file. This method supports media download.",
  39471. // "httpMethod": "GET",
  39472. // "id": "dfareporting.reports.files.get",
  39473. // "parameterOrder": [
  39474. // "profileId",
  39475. // "reportId",
  39476. // "fileId"
  39477. // ],
  39478. // "parameters": {
  39479. // "fileId": {
  39480. // "description": "The ID of the report file.",
  39481. // "format": "int64",
  39482. // "location": "path",
  39483. // "required": true,
  39484. // "type": "string"
  39485. // },
  39486. // "profileId": {
  39487. // "description": "The DFA profile ID.",
  39488. // "format": "int64",
  39489. // "location": "path",
  39490. // "required": true,
  39491. // "type": "string"
  39492. // },
  39493. // "reportId": {
  39494. // "description": "The ID of the report.",
  39495. // "format": "int64",
  39496. // "location": "path",
  39497. // "required": true,
  39498. // "type": "string"
  39499. // }
  39500. // },
  39501. // "path": "userprofiles/{profileId}/reports/{reportId}/files/{fileId}",
  39502. // "response": {
  39503. // "$ref": "File"
  39504. // },
  39505. // "scopes": [
  39506. // "https://www.googleapis.com/auth/dfareporting"
  39507. // ],
  39508. // "supportsMediaDownload": true
  39509. // }
  39510. }
  39511. // method id "dfareporting.reports.files.list":
  39512. type ReportsFilesListCall struct {
  39513. s *Service
  39514. profileId int64
  39515. reportId int64
  39516. urlParams_ gensupport.URLParams
  39517. ifNoneMatch_ string
  39518. ctx_ context.Context
  39519. header_ http.Header
  39520. }
  39521. // List: Lists files for a report.
  39522. func (r *ReportsFilesService) List(profileId int64, reportId int64) *ReportsFilesListCall {
  39523. c := &ReportsFilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39524. c.profileId = profileId
  39525. c.reportId = reportId
  39526. return c
  39527. }
  39528. // MaxResults sets the optional parameter "maxResults": Maximum number
  39529. // of results to return.
  39530. func (c *ReportsFilesListCall) MaxResults(maxResults int64) *ReportsFilesListCall {
  39531. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  39532. return c
  39533. }
  39534. // PageToken sets the optional parameter "pageToken": The value of the
  39535. // nextToken from the previous result page.
  39536. func (c *ReportsFilesListCall) PageToken(pageToken string) *ReportsFilesListCall {
  39537. c.urlParams_.Set("pageToken", pageToken)
  39538. return c
  39539. }
  39540. // SortField sets the optional parameter "sortField": The field by which
  39541. // to sort the list.
  39542. //
  39543. // Possible values:
  39544. // "ID" - Sort by file ID.
  39545. // "LAST_MODIFIED_TIME" (default) - Sort by 'lastmodifiedAt' field.
  39546. func (c *ReportsFilesListCall) SortField(sortField string) *ReportsFilesListCall {
  39547. c.urlParams_.Set("sortField", sortField)
  39548. return c
  39549. }
  39550. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  39551. // results.
  39552. //
  39553. // Possible values:
  39554. // "ASCENDING" - Ascending order.
  39555. // "DESCENDING" (default) - Descending order.
  39556. func (c *ReportsFilesListCall) SortOrder(sortOrder string) *ReportsFilesListCall {
  39557. c.urlParams_.Set("sortOrder", sortOrder)
  39558. return c
  39559. }
  39560. // Fields allows partial responses to be retrieved. See
  39561. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39562. // for more information.
  39563. func (c *ReportsFilesListCall) Fields(s ...googleapi.Field) *ReportsFilesListCall {
  39564. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39565. return c
  39566. }
  39567. // IfNoneMatch sets the optional parameter which makes the operation
  39568. // fail if the object's ETag matches the given value. This is useful for
  39569. // getting updates only after the object has changed since the last
  39570. // request. Use googleapi.IsNotModified to check whether the response
  39571. // error from Do is the result of In-None-Match.
  39572. func (c *ReportsFilesListCall) IfNoneMatch(entityTag string) *ReportsFilesListCall {
  39573. c.ifNoneMatch_ = entityTag
  39574. return c
  39575. }
  39576. // Context sets the context to be used in this call's Do method. Any
  39577. // pending HTTP request will be aborted if the provided context is
  39578. // canceled.
  39579. func (c *ReportsFilesListCall) Context(ctx context.Context) *ReportsFilesListCall {
  39580. c.ctx_ = ctx
  39581. return c
  39582. }
  39583. // Header returns an http.Header that can be modified by the caller to
  39584. // add HTTP headers to the request.
  39585. func (c *ReportsFilesListCall) Header() http.Header {
  39586. if c.header_ == nil {
  39587. c.header_ = make(http.Header)
  39588. }
  39589. return c.header_
  39590. }
  39591. func (c *ReportsFilesListCall) doRequest(alt string) (*http.Response, error) {
  39592. reqHeaders := make(http.Header)
  39593. for k, v := range c.header_ {
  39594. reqHeaders[k] = v
  39595. }
  39596. reqHeaders.Set("User-Agent", c.s.userAgent())
  39597. if c.ifNoneMatch_ != "" {
  39598. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39599. }
  39600. var body io.Reader = nil
  39601. c.urlParams_.Set("alt", alt)
  39602. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/reports/{reportId}/files")
  39603. urls += "?" + c.urlParams_.Encode()
  39604. req, _ := http.NewRequest("GET", urls, body)
  39605. req.Header = reqHeaders
  39606. googleapi.Expand(req.URL, map[string]string{
  39607. "profileId": strconv.FormatInt(c.profileId, 10),
  39608. "reportId": strconv.FormatInt(c.reportId, 10),
  39609. })
  39610. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39611. }
  39612. // Do executes the "dfareporting.reports.files.list" call.
  39613. // Exactly one of *FileList or error will be non-nil. Any non-2xx status
  39614. // code is an error. Response headers are in either
  39615. // *FileList.ServerResponse.Header or (if a response was returned at
  39616. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  39617. // to check whether the returned error was because
  39618. // http.StatusNotModified was returned.
  39619. func (c *ReportsFilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  39620. gensupport.SetOptions(c.urlParams_, opts...)
  39621. res, err := c.doRequest("json")
  39622. if res != nil && res.StatusCode == http.StatusNotModified {
  39623. if res.Body != nil {
  39624. res.Body.Close()
  39625. }
  39626. return nil, &googleapi.Error{
  39627. Code: res.StatusCode,
  39628. Header: res.Header,
  39629. }
  39630. }
  39631. if err != nil {
  39632. return nil, err
  39633. }
  39634. defer googleapi.CloseBody(res)
  39635. if err := googleapi.CheckResponse(res); err != nil {
  39636. return nil, err
  39637. }
  39638. ret := &FileList{
  39639. ServerResponse: googleapi.ServerResponse{
  39640. Header: res.Header,
  39641. HTTPStatusCode: res.StatusCode,
  39642. },
  39643. }
  39644. target := &ret
  39645. if err := gensupport.DecodeResponse(target, res); err != nil {
  39646. return nil, err
  39647. }
  39648. return ret, nil
  39649. // {
  39650. // "description": "Lists files for a report.",
  39651. // "httpMethod": "GET",
  39652. // "id": "dfareporting.reports.files.list",
  39653. // "parameterOrder": [
  39654. // "profileId",
  39655. // "reportId"
  39656. // ],
  39657. // "parameters": {
  39658. // "maxResults": {
  39659. // "default": "10",
  39660. // "description": "Maximum number of results to return.",
  39661. // "format": "int32",
  39662. // "location": "query",
  39663. // "maximum": "10",
  39664. // "minimum": "0",
  39665. // "type": "integer"
  39666. // },
  39667. // "pageToken": {
  39668. // "description": "The value of the nextToken from the previous result page.",
  39669. // "location": "query",
  39670. // "type": "string"
  39671. // },
  39672. // "profileId": {
  39673. // "description": "The DFA profile ID.",
  39674. // "format": "int64",
  39675. // "location": "path",
  39676. // "required": true,
  39677. // "type": "string"
  39678. // },
  39679. // "reportId": {
  39680. // "description": "The ID of the parent report.",
  39681. // "format": "int64",
  39682. // "location": "path",
  39683. // "required": true,
  39684. // "type": "string"
  39685. // },
  39686. // "sortField": {
  39687. // "default": "LAST_MODIFIED_TIME",
  39688. // "description": "The field by which to sort the list.",
  39689. // "enum": [
  39690. // "ID",
  39691. // "LAST_MODIFIED_TIME"
  39692. // ],
  39693. // "enumDescriptions": [
  39694. // "Sort by file ID.",
  39695. // "Sort by 'lastmodifiedAt' field."
  39696. // ],
  39697. // "location": "query",
  39698. // "type": "string"
  39699. // },
  39700. // "sortOrder": {
  39701. // "default": "DESCENDING",
  39702. // "description": "Order of sorted results.",
  39703. // "enum": [
  39704. // "ASCENDING",
  39705. // "DESCENDING"
  39706. // ],
  39707. // "enumDescriptions": [
  39708. // "Ascending order.",
  39709. // "Descending order."
  39710. // ],
  39711. // "location": "query",
  39712. // "type": "string"
  39713. // }
  39714. // },
  39715. // "path": "userprofiles/{profileId}/reports/{reportId}/files",
  39716. // "response": {
  39717. // "$ref": "FileList"
  39718. // },
  39719. // "scopes": [
  39720. // "https://www.googleapis.com/auth/dfareporting"
  39721. // ]
  39722. // }
  39723. }
  39724. // Pages invokes f for each page of results.
  39725. // A non-nil error returned from f will halt the iteration.
  39726. // The provided context supersedes any context provided to the Context method.
  39727. func (c *ReportsFilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  39728. c.ctx_ = ctx
  39729. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  39730. for {
  39731. x, err := c.Do()
  39732. if err != nil {
  39733. return err
  39734. }
  39735. if err := f(x); err != nil {
  39736. return err
  39737. }
  39738. if x.NextPageToken == "" {
  39739. return nil
  39740. }
  39741. c.PageToken(x.NextPageToken)
  39742. }
  39743. }
  39744. // method id "dfareporting.sites.get":
  39745. type SitesGetCall struct {
  39746. s *Service
  39747. profileId int64
  39748. id int64
  39749. urlParams_ gensupport.URLParams
  39750. ifNoneMatch_ string
  39751. ctx_ context.Context
  39752. header_ http.Header
  39753. }
  39754. // Get: Gets one site by ID.
  39755. func (r *SitesService) Get(profileId int64, id int64) *SitesGetCall {
  39756. c := &SitesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39757. c.profileId = profileId
  39758. c.id = id
  39759. return c
  39760. }
  39761. // Fields allows partial responses to be retrieved. See
  39762. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39763. // for more information.
  39764. func (c *SitesGetCall) Fields(s ...googleapi.Field) *SitesGetCall {
  39765. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39766. return c
  39767. }
  39768. // IfNoneMatch sets the optional parameter which makes the operation
  39769. // fail if the object's ETag matches the given value. This is useful for
  39770. // getting updates only after the object has changed since the last
  39771. // request. Use googleapi.IsNotModified to check whether the response
  39772. // error from Do is the result of In-None-Match.
  39773. func (c *SitesGetCall) IfNoneMatch(entityTag string) *SitesGetCall {
  39774. c.ifNoneMatch_ = entityTag
  39775. return c
  39776. }
  39777. // Context sets the context to be used in this call's Do method. Any
  39778. // pending HTTP request will be aborted if the provided context is
  39779. // canceled.
  39780. func (c *SitesGetCall) Context(ctx context.Context) *SitesGetCall {
  39781. c.ctx_ = ctx
  39782. return c
  39783. }
  39784. // Header returns an http.Header that can be modified by the caller to
  39785. // add HTTP headers to the request.
  39786. func (c *SitesGetCall) Header() http.Header {
  39787. if c.header_ == nil {
  39788. c.header_ = make(http.Header)
  39789. }
  39790. return c.header_
  39791. }
  39792. func (c *SitesGetCall) doRequest(alt string) (*http.Response, error) {
  39793. reqHeaders := make(http.Header)
  39794. for k, v := range c.header_ {
  39795. reqHeaders[k] = v
  39796. }
  39797. reqHeaders.Set("User-Agent", c.s.userAgent())
  39798. if c.ifNoneMatch_ != "" {
  39799. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  39800. }
  39801. var body io.Reader = nil
  39802. c.urlParams_.Set("alt", alt)
  39803. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites/{id}")
  39804. urls += "?" + c.urlParams_.Encode()
  39805. req, _ := http.NewRequest("GET", urls, body)
  39806. req.Header = reqHeaders
  39807. googleapi.Expand(req.URL, map[string]string{
  39808. "profileId": strconv.FormatInt(c.profileId, 10),
  39809. "id": strconv.FormatInt(c.id, 10),
  39810. })
  39811. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39812. }
  39813. // Do executes the "dfareporting.sites.get" call.
  39814. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  39815. // code is an error. Response headers are in either
  39816. // *Site.ServerResponse.Header or (if a response was returned at all) in
  39817. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39818. // whether the returned error was because http.StatusNotModified was
  39819. // returned.
  39820. func (c *SitesGetCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  39821. gensupport.SetOptions(c.urlParams_, opts...)
  39822. res, err := c.doRequest("json")
  39823. if res != nil && res.StatusCode == http.StatusNotModified {
  39824. if res.Body != nil {
  39825. res.Body.Close()
  39826. }
  39827. return nil, &googleapi.Error{
  39828. Code: res.StatusCode,
  39829. Header: res.Header,
  39830. }
  39831. }
  39832. if err != nil {
  39833. return nil, err
  39834. }
  39835. defer googleapi.CloseBody(res)
  39836. if err := googleapi.CheckResponse(res); err != nil {
  39837. return nil, err
  39838. }
  39839. ret := &Site{
  39840. ServerResponse: googleapi.ServerResponse{
  39841. Header: res.Header,
  39842. HTTPStatusCode: res.StatusCode,
  39843. },
  39844. }
  39845. target := &ret
  39846. if err := gensupport.DecodeResponse(target, res); err != nil {
  39847. return nil, err
  39848. }
  39849. return ret, nil
  39850. // {
  39851. // "description": "Gets one site by ID.",
  39852. // "httpMethod": "GET",
  39853. // "id": "dfareporting.sites.get",
  39854. // "parameterOrder": [
  39855. // "profileId",
  39856. // "id"
  39857. // ],
  39858. // "parameters": {
  39859. // "id": {
  39860. // "description": "Site ID.",
  39861. // "format": "int64",
  39862. // "location": "path",
  39863. // "required": true,
  39864. // "type": "string"
  39865. // },
  39866. // "profileId": {
  39867. // "description": "User profile ID associated with this request.",
  39868. // "format": "int64",
  39869. // "location": "path",
  39870. // "required": true,
  39871. // "type": "string"
  39872. // }
  39873. // },
  39874. // "path": "userprofiles/{profileId}/sites/{id}",
  39875. // "response": {
  39876. // "$ref": "Site"
  39877. // },
  39878. // "scopes": [
  39879. // "https://www.googleapis.com/auth/dfatrafficking"
  39880. // ]
  39881. // }
  39882. }
  39883. // method id "dfareporting.sites.insert":
  39884. type SitesInsertCall struct {
  39885. s *Service
  39886. profileId int64
  39887. site *Site
  39888. urlParams_ gensupport.URLParams
  39889. ctx_ context.Context
  39890. header_ http.Header
  39891. }
  39892. // Insert: Inserts a new site.
  39893. func (r *SitesService) Insert(profileId int64, site *Site) *SitesInsertCall {
  39894. c := &SitesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  39895. c.profileId = profileId
  39896. c.site = site
  39897. return c
  39898. }
  39899. // Fields allows partial responses to be retrieved. See
  39900. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  39901. // for more information.
  39902. func (c *SitesInsertCall) Fields(s ...googleapi.Field) *SitesInsertCall {
  39903. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  39904. return c
  39905. }
  39906. // Context sets the context to be used in this call's Do method. Any
  39907. // pending HTTP request will be aborted if the provided context is
  39908. // canceled.
  39909. func (c *SitesInsertCall) Context(ctx context.Context) *SitesInsertCall {
  39910. c.ctx_ = ctx
  39911. return c
  39912. }
  39913. // Header returns an http.Header that can be modified by the caller to
  39914. // add HTTP headers to the request.
  39915. func (c *SitesInsertCall) Header() http.Header {
  39916. if c.header_ == nil {
  39917. c.header_ = make(http.Header)
  39918. }
  39919. return c.header_
  39920. }
  39921. func (c *SitesInsertCall) doRequest(alt string) (*http.Response, error) {
  39922. reqHeaders := make(http.Header)
  39923. for k, v := range c.header_ {
  39924. reqHeaders[k] = v
  39925. }
  39926. reqHeaders.Set("User-Agent", c.s.userAgent())
  39927. var body io.Reader = nil
  39928. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  39929. if err != nil {
  39930. return nil, err
  39931. }
  39932. reqHeaders.Set("Content-Type", "application/json")
  39933. c.urlParams_.Set("alt", alt)
  39934. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  39935. urls += "?" + c.urlParams_.Encode()
  39936. req, _ := http.NewRequest("POST", urls, body)
  39937. req.Header = reqHeaders
  39938. googleapi.Expand(req.URL, map[string]string{
  39939. "profileId": strconv.FormatInt(c.profileId, 10),
  39940. })
  39941. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  39942. }
  39943. // Do executes the "dfareporting.sites.insert" call.
  39944. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  39945. // code is an error. Response headers are in either
  39946. // *Site.ServerResponse.Header or (if a response was returned at all) in
  39947. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  39948. // whether the returned error was because http.StatusNotModified was
  39949. // returned.
  39950. func (c *SitesInsertCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  39951. gensupport.SetOptions(c.urlParams_, opts...)
  39952. res, err := c.doRequest("json")
  39953. if res != nil && res.StatusCode == http.StatusNotModified {
  39954. if res.Body != nil {
  39955. res.Body.Close()
  39956. }
  39957. return nil, &googleapi.Error{
  39958. Code: res.StatusCode,
  39959. Header: res.Header,
  39960. }
  39961. }
  39962. if err != nil {
  39963. return nil, err
  39964. }
  39965. defer googleapi.CloseBody(res)
  39966. if err := googleapi.CheckResponse(res); err != nil {
  39967. return nil, err
  39968. }
  39969. ret := &Site{
  39970. ServerResponse: googleapi.ServerResponse{
  39971. Header: res.Header,
  39972. HTTPStatusCode: res.StatusCode,
  39973. },
  39974. }
  39975. target := &ret
  39976. if err := gensupport.DecodeResponse(target, res); err != nil {
  39977. return nil, err
  39978. }
  39979. return ret, nil
  39980. // {
  39981. // "description": "Inserts a new site.",
  39982. // "httpMethod": "POST",
  39983. // "id": "dfareporting.sites.insert",
  39984. // "parameterOrder": [
  39985. // "profileId"
  39986. // ],
  39987. // "parameters": {
  39988. // "profileId": {
  39989. // "description": "User profile ID associated with this request.",
  39990. // "format": "int64",
  39991. // "location": "path",
  39992. // "required": true,
  39993. // "type": "string"
  39994. // }
  39995. // },
  39996. // "path": "userprofiles/{profileId}/sites",
  39997. // "request": {
  39998. // "$ref": "Site"
  39999. // },
  40000. // "response": {
  40001. // "$ref": "Site"
  40002. // },
  40003. // "scopes": [
  40004. // "https://www.googleapis.com/auth/dfatrafficking"
  40005. // ]
  40006. // }
  40007. }
  40008. // method id "dfareporting.sites.list":
  40009. type SitesListCall struct {
  40010. s *Service
  40011. profileId int64
  40012. urlParams_ gensupport.URLParams
  40013. ifNoneMatch_ string
  40014. ctx_ context.Context
  40015. header_ http.Header
  40016. }
  40017. // List: Retrieves a list of sites, possibly filtered. This method
  40018. // supports paging.
  40019. func (r *SitesService) List(profileId int64) *SitesListCall {
  40020. c := &SitesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40021. c.profileId = profileId
  40022. return c
  40023. }
  40024. // AcceptsInStreamVideoPlacements sets the optional parameter
  40025. // "acceptsInStreamVideoPlacements": This search filter is no longer
  40026. // supported and will have no effect on the results returned.
  40027. func (c *SitesListCall) AcceptsInStreamVideoPlacements(acceptsInStreamVideoPlacements bool) *SitesListCall {
  40028. c.urlParams_.Set("acceptsInStreamVideoPlacements", fmt.Sprint(acceptsInStreamVideoPlacements))
  40029. return c
  40030. }
  40031. // AcceptsInterstitialPlacements sets the optional parameter
  40032. // "acceptsInterstitialPlacements": This search filter is no longer
  40033. // supported and will have no effect on the results returned.
  40034. func (c *SitesListCall) AcceptsInterstitialPlacements(acceptsInterstitialPlacements bool) *SitesListCall {
  40035. c.urlParams_.Set("acceptsInterstitialPlacements", fmt.Sprint(acceptsInterstitialPlacements))
  40036. return c
  40037. }
  40038. // AcceptsPublisherPaidPlacements sets the optional parameter
  40039. // "acceptsPublisherPaidPlacements": Select only sites that accept
  40040. // publisher paid placements.
  40041. func (c *SitesListCall) AcceptsPublisherPaidPlacements(acceptsPublisherPaidPlacements bool) *SitesListCall {
  40042. c.urlParams_.Set("acceptsPublisherPaidPlacements", fmt.Sprint(acceptsPublisherPaidPlacements))
  40043. return c
  40044. }
  40045. // AdWordsSite sets the optional parameter "adWordsSite": Select only
  40046. // AdWords sites.
  40047. func (c *SitesListCall) AdWordsSite(adWordsSite bool) *SitesListCall {
  40048. c.urlParams_.Set("adWordsSite", fmt.Sprint(adWordsSite))
  40049. return c
  40050. }
  40051. // Approved sets the optional parameter "approved": Select only approved
  40052. // sites.
  40053. func (c *SitesListCall) Approved(approved bool) *SitesListCall {
  40054. c.urlParams_.Set("approved", fmt.Sprint(approved))
  40055. return c
  40056. }
  40057. // CampaignIds sets the optional parameter "campaignIds": Select only
  40058. // sites with these campaign IDs.
  40059. func (c *SitesListCall) CampaignIds(campaignIds ...int64) *SitesListCall {
  40060. var campaignIds_ []string
  40061. for _, v := range campaignIds {
  40062. campaignIds_ = append(campaignIds_, fmt.Sprint(v))
  40063. }
  40064. c.urlParams_.SetMulti("campaignIds", campaignIds_)
  40065. return c
  40066. }
  40067. // DirectorySiteIds sets the optional parameter "directorySiteIds":
  40068. // Select only sites with these directory site IDs.
  40069. func (c *SitesListCall) DirectorySiteIds(directorySiteIds ...int64) *SitesListCall {
  40070. var directorySiteIds_ []string
  40071. for _, v := range directorySiteIds {
  40072. directorySiteIds_ = append(directorySiteIds_, fmt.Sprint(v))
  40073. }
  40074. c.urlParams_.SetMulti("directorySiteIds", directorySiteIds_)
  40075. return c
  40076. }
  40077. // Ids sets the optional parameter "ids": Select only sites with these
  40078. // IDs.
  40079. func (c *SitesListCall) Ids(ids ...int64) *SitesListCall {
  40080. var ids_ []string
  40081. for _, v := range ids {
  40082. ids_ = append(ids_, fmt.Sprint(v))
  40083. }
  40084. c.urlParams_.SetMulti("ids", ids_)
  40085. return c
  40086. }
  40087. // MaxResults sets the optional parameter "maxResults": Maximum number
  40088. // of results to return.
  40089. func (c *SitesListCall) MaxResults(maxResults int64) *SitesListCall {
  40090. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  40091. return c
  40092. }
  40093. // PageToken sets the optional parameter "pageToken": Value of the
  40094. // nextPageToken from the previous result page.
  40095. func (c *SitesListCall) PageToken(pageToken string) *SitesListCall {
  40096. c.urlParams_.Set("pageToken", pageToken)
  40097. return c
  40098. }
  40099. // SearchString sets the optional parameter "searchString": Allows
  40100. // searching for objects by name, ID or keyName. Wildcards (*) are
  40101. // allowed. For example, "site*2015" will return objects with names like
  40102. // "site June 2015", "site April 2015", or simply "site 2015". Most of
  40103. // the searches also add wildcards implicitly at the start and the end
  40104. // of the search string. For example, a search string of "site" will
  40105. // match objects with name "my site", "site 2015", or simply "site".
  40106. func (c *SitesListCall) SearchString(searchString string) *SitesListCall {
  40107. c.urlParams_.Set("searchString", searchString)
  40108. return c
  40109. }
  40110. // SortField sets the optional parameter "sortField": Field by which to
  40111. // sort the list.
  40112. //
  40113. // Possible values:
  40114. // "ID" (default)
  40115. // "NAME"
  40116. func (c *SitesListCall) SortField(sortField string) *SitesListCall {
  40117. c.urlParams_.Set("sortField", sortField)
  40118. return c
  40119. }
  40120. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  40121. // results.
  40122. //
  40123. // Possible values:
  40124. // "ASCENDING" (default)
  40125. // "DESCENDING"
  40126. func (c *SitesListCall) SortOrder(sortOrder string) *SitesListCall {
  40127. c.urlParams_.Set("sortOrder", sortOrder)
  40128. return c
  40129. }
  40130. // SubaccountId sets the optional parameter "subaccountId": Select only
  40131. // sites with this subaccount ID.
  40132. func (c *SitesListCall) SubaccountId(subaccountId int64) *SitesListCall {
  40133. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  40134. return c
  40135. }
  40136. // UnmappedSite sets the optional parameter "unmappedSite": Select only
  40137. // sites that have not been mapped to a directory site.
  40138. func (c *SitesListCall) UnmappedSite(unmappedSite bool) *SitesListCall {
  40139. c.urlParams_.Set("unmappedSite", fmt.Sprint(unmappedSite))
  40140. return c
  40141. }
  40142. // Fields allows partial responses to be retrieved. See
  40143. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40144. // for more information.
  40145. func (c *SitesListCall) Fields(s ...googleapi.Field) *SitesListCall {
  40146. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40147. return c
  40148. }
  40149. // IfNoneMatch sets the optional parameter which makes the operation
  40150. // fail if the object's ETag matches the given value. This is useful for
  40151. // getting updates only after the object has changed since the last
  40152. // request. Use googleapi.IsNotModified to check whether the response
  40153. // error from Do is the result of In-None-Match.
  40154. func (c *SitesListCall) IfNoneMatch(entityTag string) *SitesListCall {
  40155. c.ifNoneMatch_ = entityTag
  40156. return c
  40157. }
  40158. // Context sets the context to be used in this call's Do method. Any
  40159. // pending HTTP request will be aborted if the provided context is
  40160. // canceled.
  40161. func (c *SitesListCall) Context(ctx context.Context) *SitesListCall {
  40162. c.ctx_ = ctx
  40163. return c
  40164. }
  40165. // Header returns an http.Header that can be modified by the caller to
  40166. // add HTTP headers to the request.
  40167. func (c *SitesListCall) Header() http.Header {
  40168. if c.header_ == nil {
  40169. c.header_ = make(http.Header)
  40170. }
  40171. return c.header_
  40172. }
  40173. func (c *SitesListCall) doRequest(alt string) (*http.Response, error) {
  40174. reqHeaders := make(http.Header)
  40175. for k, v := range c.header_ {
  40176. reqHeaders[k] = v
  40177. }
  40178. reqHeaders.Set("User-Agent", c.s.userAgent())
  40179. if c.ifNoneMatch_ != "" {
  40180. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40181. }
  40182. var body io.Reader = nil
  40183. c.urlParams_.Set("alt", alt)
  40184. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40185. urls += "?" + c.urlParams_.Encode()
  40186. req, _ := http.NewRequest("GET", urls, body)
  40187. req.Header = reqHeaders
  40188. googleapi.Expand(req.URL, map[string]string{
  40189. "profileId": strconv.FormatInt(c.profileId, 10),
  40190. })
  40191. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40192. }
  40193. // Do executes the "dfareporting.sites.list" call.
  40194. // Exactly one of *SitesListResponse or error will be non-nil. Any
  40195. // non-2xx status code is an error. Response headers are in either
  40196. // *SitesListResponse.ServerResponse.Header or (if a response was
  40197. // returned at all) in error.(*googleapi.Error).Header. Use
  40198. // googleapi.IsNotModified to check whether the returned error was
  40199. // because http.StatusNotModified was returned.
  40200. func (c *SitesListCall) Do(opts ...googleapi.CallOption) (*SitesListResponse, error) {
  40201. gensupport.SetOptions(c.urlParams_, opts...)
  40202. res, err := c.doRequest("json")
  40203. if res != nil && res.StatusCode == http.StatusNotModified {
  40204. if res.Body != nil {
  40205. res.Body.Close()
  40206. }
  40207. return nil, &googleapi.Error{
  40208. Code: res.StatusCode,
  40209. Header: res.Header,
  40210. }
  40211. }
  40212. if err != nil {
  40213. return nil, err
  40214. }
  40215. defer googleapi.CloseBody(res)
  40216. if err := googleapi.CheckResponse(res); err != nil {
  40217. return nil, err
  40218. }
  40219. ret := &SitesListResponse{
  40220. ServerResponse: googleapi.ServerResponse{
  40221. Header: res.Header,
  40222. HTTPStatusCode: res.StatusCode,
  40223. },
  40224. }
  40225. target := &ret
  40226. if err := gensupport.DecodeResponse(target, res); err != nil {
  40227. return nil, err
  40228. }
  40229. return ret, nil
  40230. // {
  40231. // "description": "Retrieves a list of sites, possibly filtered. This method supports paging.",
  40232. // "httpMethod": "GET",
  40233. // "id": "dfareporting.sites.list",
  40234. // "parameterOrder": [
  40235. // "profileId"
  40236. // ],
  40237. // "parameters": {
  40238. // "acceptsInStreamVideoPlacements": {
  40239. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  40240. // "location": "query",
  40241. // "type": "boolean"
  40242. // },
  40243. // "acceptsInterstitialPlacements": {
  40244. // "description": "This search filter is no longer supported and will have no effect on the results returned.",
  40245. // "location": "query",
  40246. // "type": "boolean"
  40247. // },
  40248. // "acceptsPublisherPaidPlacements": {
  40249. // "description": "Select only sites that accept publisher paid placements.",
  40250. // "location": "query",
  40251. // "type": "boolean"
  40252. // },
  40253. // "adWordsSite": {
  40254. // "description": "Select only AdWords sites.",
  40255. // "location": "query",
  40256. // "type": "boolean"
  40257. // },
  40258. // "approved": {
  40259. // "description": "Select only approved sites.",
  40260. // "location": "query",
  40261. // "type": "boolean"
  40262. // },
  40263. // "campaignIds": {
  40264. // "description": "Select only sites with these campaign IDs.",
  40265. // "format": "int64",
  40266. // "location": "query",
  40267. // "repeated": true,
  40268. // "type": "string"
  40269. // },
  40270. // "directorySiteIds": {
  40271. // "description": "Select only sites with these directory site IDs.",
  40272. // "format": "int64",
  40273. // "location": "query",
  40274. // "repeated": true,
  40275. // "type": "string"
  40276. // },
  40277. // "ids": {
  40278. // "description": "Select only sites with these IDs.",
  40279. // "format": "int64",
  40280. // "location": "query",
  40281. // "repeated": true,
  40282. // "type": "string"
  40283. // },
  40284. // "maxResults": {
  40285. // "default": "1000",
  40286. // "description": "Maximum number of results to return.",
  40287. // "format": "int32",
  40288. // "location": "query",
  40289. // "maximum": "1000",
  40290. // "minimum": "0",
  40291. // "type": "integer"
  40292. // },
  40293. // "pageToken": {
  40294. // "description": "Value of the nextPageToken from the previous result page.",
  40295. // "location": "query",
  40296. // "type": "string"
  40297. // },
  40298. // "profileId": {
  40299. // "description": "User profile ID associated with this request.",
  40300. // "format": "int64",
  40301. // "location": "path",
  40302. // "required": true,
  40303. // "type": "string"
  40304. // },
  40305. // "searchString": {
  40306. // "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\".",
  40307. // "location": "query",
  40308. // "type": "string"
  40309. // },
  40310. // "sortField": {
  40311. // "default": "ID",
  40312. // "description": "Field by which to sort the list.",
  40313. // "enum": [
  40314. // "ID",
  40315. // "NAME"
  40316. // ],
  40317. // "enumDescriptions": [
  40318. // "",
  40319. // ""
  40320. // ],
  40321. // "location": "query",
  40322. // "type": "string"
  40323. // },
  40324. // "sortOrder": {
  40325. // "default": "ASCENDING",
  40326. // "description": "Order of sorted results.",
  40327. // "enum": [
  40328. // "ASCENDING",
  40329. // "DESCENDING"
  40330. // ],
  40331. // "enumDescriptions": [
  40332. // "",
  40333. // ""
  40334. // ],
  40335. // "location": "query",
  40336. // "type": "string"
  40337. // },
  40338. // "subaccountId": {
  40339. // "description": "Select only sites with this subaccount ID.",
  40340. // "format": "int64",
  40341. // "location": "query",
  40342. // "type": "string"
  40343. // },
  40344. // "unmappedSite": {
  40345. // "description": "Select only sites that have not been mapped to a directory site.",
  40346. // "location": "query",
  40347. // "type": "boolean"
  40348. // }
  40349. // },
  40350. // "path": "userprofiles/{profileId}/sites",
  40351. // "response": {
  40352. // "$ref": "SitesListResponse"
  40353. // },
  40354. // "scopes": [
  40355. // "https://www.googleapis.com/auth/dfatrafficking"
  40356. // ]
  40357. // }
  40358. }
  40359. // Pages invokes f for each page of results.
  40360. // A non-nil error returned from f will halt the iteration.
  40361. // The provided context supersedes any context provided to the Context method.
  40362. func (c *SitesListCall) Pages(ctx context.Context, f func(*SitesListResponse) error) error {
  40363. c.ctx_ = ctx
  40364. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  40365. for {
  40366. x, err := c.Do()
  40367. if err != nil {
  40368. return err
  40369. }
  40370. if err := f(x); err != nil {
  40371. return err
  40372. }
  40373. if x.NextPageToken == "" {
  40374. return nil
  40375. }
  40376. c.PageToken(x.NextPageToken)
  40377. }
  40378. }
  40379. // method id "dfareporting.sites.patch":
  40380. type SitesPatchCall struct {
  40381. s *Service
  40382. profileId int64
  40383. site *Site
  40384. urlParams_ gensupport.URLParams
  40385. ctx_ context.Context
  40386. header_ http.Header
  40387. }
  40388. // Patch: Updates an existing site. This method supports patch
  40389. // semantics.
  40390. func (r *SitesService) Patch(profileId int64, id int64, site *Site) *SitesPatchCall {
  40391. c := &SitesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40392. c.profileId = profileId
  40393. c.urlParams_.Set("id", fmt.Sprint(id))
  40394. c.site = site
  40395. return c
  40396. }
  40397. // Fields allows partial responses to be retrieved. See
  40398. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40399. // for more information.
  40400. func (c *SitesPatchCall) Fields(s ...googleapi.Field) *SitesPatchCall {
  40401. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40402. return c
  40403. }
  40404. // Context sets the context to be used in this call's Do method. Any
  40405. // pending HTTP request will be aborted if the provided context is
  40406. // canceled.
  40407. func (c *SitesPatchCall) Context(ctx context.Context) *SitesPatchCall {
  40408. c.ctx_ = ctx
  40409. return c
  40410. }
  40411. // Header returns an http.Header that can be modified by the caller to
  40412. // add HTTP headers to the request.
  40413. func (c *SitesPatchCall) Header() http.Header {
  40414. if c.header_ == nil {
  40415. c.header_ = make(http.Header)
  40416. }
  40417. return c.header_
  40418. }
  40419. func (c *SitesPatchCall) doRequest(alt string) (*http.Response, error) {
  40420. reqHeaders := make(http.Header)
  40421. for k, v := range c.header_ {
  40422. reqHeaders[k] = v
  40423. }
  40424. reqHeaders.Set("User-Agent", c.s.userAgent())
  40425. var body io.Reader = nil
  40426. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  40427. if err != nil {
  40428. return nil, err
  40429. }
  40430. reqHeaders.Set("Content-Type", "application/json")
  40431. c.urlParams_.Set("alt", alt)
  40432. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40433. urls += "?" + c.urlParams_.Encode()
  40434. req, _ := http.NewRequest("PATCH", urls, body)
  40435. req.Header = reqHeaders
  40436. googleapi.Expand(req.URL, map[string]string{
  40437. "profileId": strconv.FormatInt(c.profileId, 10),
  40438. })
  40439. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40440. }
  40441. // Do executes the "dfareporting.sites.patch" call.
  40442. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40443. // code is an error. Response headers are in either
  40444. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40445. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40446. // whether the returned error was because http.StatusNotModified was
  40447. // returned.
  40448. func (c *SitesPatchCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40449. gensupport.SetOptions(c.urlParams_, opts...)
  40450. res, err := c.doRequest("json")
  40451. if res != nil && res.StatusCode == http.StatusNotModified {
  40452. if res.Body != nil {
  40453. res.Body.Close()
  40454. }
  40455. return nil, &googleapi.Error{
  40456. Code: res.StatusCode,
  40457. Header: res.Header,
  40458. }
  40459. }
  40460. if err != nil {
  40461. return nil, err
  40462. }
  40463. defer googleapi.CloseBody(res)
  40464. if err := googleapi.CheckResponse(res); err != nil {
  40465. return nil, err
  40466. }
  40467. ret := &Site{
  40468. ServerResponse: googleapi.ServerResponse{
  40469. Header: res.Header,
  40470. HTTPStatusCode: res.StatusCode,
  40471. },
  40472. }
  40473. target := &ret
  40474. if err := gensupport.DecodeResponse(target, res); err != nil {
  40475. return nil, err
  40476. }
  40477. return ret, nil
  40478. // {
  40479. // "description": "Updates an existing site. This method supports patch semantics.",
  40480. // "httpMethod": "PATCH",
  40481. // "id": "dfareporting.sites.patch",
  40482. // "parameterOrder": [
  40483. // "profileId",
  40484. // "id"
  40485. // ],
  40486. // "parameters": {
  40487. // "id": {
  40488. // "description": "Site ID.",
  40489. // "format": "int64",
  40490. // "location": "query",
  40491. // "required": true,
  40492. // "type": "string"
  40493. // },
  40494. // "profileId": {
  40495. // "description": "User profile ID associated with this request.",
  40496. // "format": "int64",
  40497. // "location": "path",
  40498. // "required": true,
  40499. // "type": "string"
  40500. // }
  40501. // },
  40502. // "path": "userprofiles/{profileId}/sites",
  40503. // "request": {
  40504. // "$ref": "Site"
  40505. // },
  40506. // "response": {
  40507. // "$ref": "Site"
  40508. // },
  40509. // "scopes": [
  40510. // "https://www.googleapis.com/auth/dfatrafficking"
  40511. // ]
  40512. // }
  40513. }
  40514. // method id "dfareporting.sites.update":
  40515. type SitesUpdateCall struct {
  40516. s *Service
  40517. profileId int64
  40518. site *Site
  40519. urlParams_ gensupport.URLParams
  40520. ctx_ context.Context
  40521. header_ http.Header
  40522. }
  40523. // Update: Updates an existing site.
  40524. func (r *SitesService) Update(profileId int64, site *Site) *SitesUpdateCall {
  40525. c := &SitesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40526. c.profileId = profileId
  40527. c.site = site
  40528. return c
  40529. }
  40530. // Fields allows partial responses to be retrieved. See
  40531. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40532. // for more information.
  40533. func (c *SitesUpdateCall) Fields(s ...googleapi.Field) *SitesUpdateCall {
  40534. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40535. return c
  40536. }
  40537. // Context sets the context to be used in this call's Do method. Any
  40538. // pending HTTP request will be aborted if the provided context is
  40539. // canceled.
  40540. func (c *SitesUpdateCall) Context(ctx context.Context) *SitesUpdateCall {
  40541. c.ctx_ = ctx
  40542. return c
  40543. }
  40544. // Header returns an http.Header that can be modified by the caller to
  40545. // add HTTP headers to the request.
  40546. func (c *SitesUpdateCall) Header() http.Header {
  40547. if c.header_ == nil {
  40548. c.header_ = make(http.Header)
  40549. }
  40550. return c.header_
  40551. }
  40552. func (c *SitesUpdateCall) doRequest(alt string) (*http.Response, error) {
  40553. reqHeaders := make(http.Header)
  40554. for k, v := range c.header_ {
  40555. reqHeaders[k] = v
  40556. }
  40557. reqHeaders.Set("User-Agent", c.s.userAgent())
  40558. var body io.Reader = nil
  40559. body, err := googleapi.WithoutDataWrapper.JSONReader(c.site)
  40560. if err != nil {
  40561. return nil, err
  40562. }
  40563. reqHeaders.Set("Content-Type", "application/json")
  40564. c.urlParams_.Set("alt", alt)
  40565. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sites")
  40566. urls += "?" + c.urlParams_.Encode()
  40567. req, _ := http.NewRequest("PUT", urls, body)
  40568. req.Header = reqHeaders
  40569. googleapi.Expand(req.URL, map[string]string{
  40570. "profileId": strconv.FormatInt(c.profileId, 10),
  40571. })
  40572. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40573. }
  40574. // Do executes the "dfareporting.sites.update" call.
  40575. // Exactly one of *Site or error will be non-nil. Any non-2xx status
  40576. // code is an error. Response headers are in either
  40577. // *Site.ServerResponse.Header or (if a response was returned at all) in
  40578. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40579. // whether the returned error was because http.StatusNotModified was
  40580. // returned.
  40581. func (c *SitesUpdateCall) Do(opts ...googleapi.CallOption) (*Site, error) {
  40582. gensupport.SetOptions(c.urlParams_, opts...)
  40583. res, err := c.doRequest("json")
  40584. if res != nil && res.StatusCode == http.StatusNotModified {
  40585. if res.Body != nil {
  40586. res.Body.Close()
  40587. }
  40588. return nil, &googleapi.Error{
  40589. Code: res.StatusCode,
  40590. Header: res.Header,
  40591. }
  40592. }
  40593. if err != nil {
  40594. return nil, err
  40595. }
  40596. defer googleapi.CloseBody(res)
  40597. if err := googleapi.CheckResponse(res); err != nil {
  40598. return nil, err
  40599. }
  40600. ret := &Site{
  40601. ServerResponse: googleapi.ServerResponse{
  40602. Header: res.Header,
  40603. HTTPStatusCode: res.StatusCode,
  40604. },
  40605. }
  40606. target := &ret
  40607. if err := gensupport.DecodeResponse(target, res); err != nil {
  40608. return nil, err
  40609. }
  40610. return ret, nil
  40611. // {
  40612. // "description": "Updates an existing site.",
  40613. // "httpMethod": "PUT",
  40614. // "id": "dfareporting.sites.update",
  40615. // "parameterOrder": [
  40616. // "profileId"
  40617. // ],
  40618. // "parameters": {
  40619. // "profileId": {
  40620. // "description": "User profile ID associated with this request.",
  40621. // "format": "int64",
  40622. // "location": "path",
  40623. // "required": true,
  40624. // "type": "string"
  40625. // }
  40626. // },
  40627. // "path": "userprofiles/{profileId}/sites",
  40628. // "request": {
  40629. // "$ref": "Site"
  40630. // },
  40631. // "response": {
  40632. // "$ref": "Site"
  40633. // },
  40634. // "scopes": [
  40635. // "https://www.googleapis.com/auth/dfatrafficking"
  40636. // ]
  40637. // }
  40638. }
  40639. // method id "dfareporting.sizes.get":
  40640. type SizesGetCall struct {
  40641. s *Service
  40642. profileId int64
  40643. id int64
  40644. urlParams_ gensupport.URLParams
  40645. ifNoneMatch_ string
  40646. ctx_ context.Context
  40647. header_ http.Header
  40648. }
  40649. // Get: Gets one size by ID.
  40650. func (r *SizesService) Get(profileId int64, id int64) *SizesGetCall {
  40651. c := &SizesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40652. c.profileId = profileId
  40653. c.id = id
  40654. return c
  40655. }
  40656. // Fields allows partial responses to be retrieved. See
  40657. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40658. // for more information.
  40659. func (c *SizesGetCall) Fields(s ...googleapi.Field) *SizesGetCall {
  40660. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40661. return c
  40662. }
  40663. // IfNoneMatch sets the optional parameter which makes the operation
  40664. // fail if the object's ETag matches the given value. This is useful for
  40665. // getting updates only after the object has changed since the last
  40666. // request. Use googleapi.IsNotModified to check whether the response
  40667. // error from Do is the result of In-None-Match.
  40668. func (c *SizesGetCall) IfNoneMatch(entityTag string) *SizesGetCall {
  40669. c.ifNoneMatch_ = entityTag
  40670. return c
  40671. }
  40672. // Context sets the context to be used in this call's Do method. Any
  40673. // pending HTTP request will be aborted if the provided context is
  40674. // canceled.
  40675. func (c *SizesGetCall) Context(ctx context.Context) *SizesGetCall {
  40676. c.ctx_ = ctx
  40677. return c
  40678. }
  40679. // Header returns an http.Header that can be modified by the caller to
  40680. // add HTTP headers to the request.
  40681. func (c *SizesGetCall) Header() http.Header {
  40682. if c.header_ == nil {
  40683. c.header_ = make(http.Header)
  40684. }
  40685. return c.header_
  40686. }
  40687. func (c *SizesGetCall) doRequest(alt string) (*http.Response, error) {
  40688. reqHeaders := make(http.Header)
  40689. for k, v := range c.header_ {
  40690. reqHeaders[k] = v
  40691. }
  40692. reqHeaders.Set("User-Agent", c.s.userAgent())
  40693. if c.ifNoneMatch_ != "" {
  40694. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40695. }
  40696. var body io.Reader = nil
  40697. c.urlParams_.Set("alt", alt)
  40698. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes/{id}")
  40699. urls += "?" + c.urlParams_.Encode()
  40700. req, _ := http.NewRequest("GET", urls, body)
  40701. req.Header = reqHeaders
  40702. googleapi.Expand(req.URL, map[string]string{
  40703. "profileId": strconv.FormatInt(c.profileId, 10),
  40704. "id": strconv.FormatInt(c.id, 10),
  40705. })
  40706. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40707. }
  40708. // Do executes the "dfareporting.sizes.get" call.
  40709. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  40710. // code is an error. Response headers are in either
  40711. // *Size.ServerResponse.Header or (if a response was returned at all) in
  40712. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40713. // whether the returned error was because http.StatusNotModified was
  40714. // returned.
  40715. func (c *SizesGetCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  40716. gensupport.SetOptions(c.urlParams_, opts...)
  40717. res, err := c.doRequest("json")
  40718. if res != nil && res.StatusCode == http.StatusNotModified {
  40719. if res.Body != nil {
  40720. res.Body.Close()
  40721. }
  40722. return nil, &googleapi.Error{
  40723. Code: res.StatusCode,
  40724. Header: res.Header,
  40725. }
  40726. }
  40727. if err != nil {
  40728. return nil, err
  40729. }
  40730. defer googleapi.CloseBody(res)
  40731. if err := googleapi.CheckResponse(res); err != nil {
  40732. return nil, err
  40733. }
  40734. ret := &Size{
  40735. ServerResponse: googleapi.ServerResponse{
  40736. Header: res.Header,
  40737. HTTPStatusCode: res.StatusCode,
  40738. },
  40739. }
  40740. target := &ret
  40741. if err := gensupport.DecodeResponse(target, res); err != nil {
  40742. return nil, err
  40743. }
  40744. return ret, nil
  40745. // {
  40746. // "description": "Gets one size by ID.",
  40747. // "httpMethod": "GET",
  40748. // "id": "dfareporting.sizes.get",
  40749. // "parameterOrder": [
  40750. // "profileId",
  40751. // "id"
  40752. // ],
  40753. // "parameters": {
  40754. // "id": {
  40755. // "description": "Size ID.",
  40756. // "format": "int64",
  40757. // "location": "path",
  40758. // "required": true,
  40759. // "type": "string"
  40760. // },
  40761. // "profileId": {
  40762. // "description": "User profile ID associated with this request.",
  40763. // "format": "int64",
  40764. // "location": "path",
  40765. // "required": true,
  40766. // "type": "string"
  40767. // }
  40768. // },
  40769. // "path": "userprofiles/{profileId}/sizes/{id}",
  40770. // "response": {
  40771. // "$ref": "Size"
  40772. // },
  40773. // "scopes": [
  40774. // "https://www.googleapis.com/auth/dfatrafficking"
  40775. // ]
  40776. // }
  40777. }
  40778. // method id "dfareporting.sizes.insert":
  40779. type SizesInsertCall struct {
  40780. s *Service
  40781. profileId int64
  40782. size *Size
  40783. urlParams_ gensupport.URLParams
  40784. ctx_ context.Context
  40785. header_ http.Header
  40786. }
  40787. // Insert: Inserts a new size.
  40788. func (r *SizesService) Insert(profileId int64, size *Size) *SizesInsertCall {
  40789. c := &SizesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40790. c.profileId = profileId
  40791. c.size = size
  40792. return c
  40793. }
  40794. // Fields allows partial responses to be retrieved. See
  40795. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40796. // for more information.
  40797. func (c *SizesInsertCall) Fields(s ...googleapi.Field) *SizesInsertCall {
  40798. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40799. return c
  40800. }
  40801. // Context sets the context to be used in this call's Do method. Any
  40802. // pending HTTP request will be aborted if the provided context is
  40803. // canceled.
  40804. func (c *SizesInsertCall) Context(ctx context.Context) *SizesInsertCall {
  40805. c.ctx_ = ctx
  40806. return c
  40807. }
  40808. // Header returns an http.Header that can be modified by the caller to
  40809. // add HTTP headers to the request.
  40810. func (c *SizesInsertCall) Header() http.Header {
  40811. if c.header_ == nil {
  40812. c.header_ = make(http.Header)
  40813. }
  40814. return c.header_
  40815. }
  40816. func (c *SizesInsertCall) doRequest(alt string) (*http.Response, error) {
  40817. reqHeaders := make(http.Header)
  40818. for k, v := range c.header_ {
  40819. reqHeaders[k] = v
  40820. }
  40821. reqHeaders.Set("User-Agent", c.s.userAgent())
  40822. var body io.Reader = nil
  40823. body, err := googleapi.WithoutDataWrapper.JSONReader(c.size)
  40824. if err != nil {
  40825. return nil, err
  40826. }
  40827. reqHeaders.Set("Content-Type", "application/json")
  40828. c.urlParams_.Set("alt", alt)
  40829. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  40830. urls += "?" + c.urlParams_.Encode()
  40831. req, _ := http.NewRequest("POST", urls, body)
  40832. req.Header = reqHeaders
  40833. googleapi.Expand(req.URL, map[string]string{
  40834. "profileId": strconv.FormatInt(c.profileId, 10),
  40835. })
  40836. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40837. }
  40838. // Do executes the "dfareporting.sizes.insert" call.
  40839. // Exactly one of *Size or error will be non-nil. Any non-2xx status
  40840. // code is an error. Response headers are in either
  40841. // *Size.ServerResponse.Header or (if a response was returned at all) in
  40842. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  40843. // whether the returned error was because http.StatusNotModified was
  40844. // returned.
  40845. func (c *SizesInsertCall) Do(opts ...googleapi.CallOption) (*Size, error) {
  40846. gensupport.SetOptions(c.urlParams_, opts...)
  40847. res, err := c.doRequest("json")
  40848. if res != nil && res.StatusCode == http.StatusNotModified {
  40849. if res.Body != nil {
  40850. res.Body.Close()
  40851. }
  40852. return nil, &googleapi.Error{
  40853. Code: res.StatusCode,
  40854. Header: res.Header,
  40855. }
  40856. }
  40857. if err != nil {
  40858. return nil, err
  40859. }
  40860. defer googleapi.CloseBody(res)
  40861. if err := googleapi.CheckResponse(res); err != nil {
  40862. return nil, err
  40863. }
  40864. ret := &Size{
  40865. ServerResponse: googleapi.ServerResponse{
  40866. Header: res.Header,
  40867. HTTPStatusCode: res.StatusCode,
  40868. },
  40869. }
  40870. target := &ret
  40871. if err := gensupport.DecodeResponse(target, res); err != nil {
  40872. return nil, err
  40873. }
  40874. return ret, nil
  40875. // {
  40876. // "description": "Inserts a new size.",
  40877. // "httpMethod": "POST",
  40878. // "id": "dfareporting.sizes.insert",
  40879. // "parameterOrder": [
  40880. // "profileId"
  40881. // ],
  40882. // "parameters": {
  40883. // "profileId": {
  40884. // "description": "User profile ID associated with this request.",
  40885. // "format": "int64",
  40886. // "location": "path",
  40887. // "required": true,
  40888. // "type": "string"
  40889. // }
  40890. // },
  40891. // "path": "userprofiles/{profileId}/sizes",
  40892. // "request": {
  40893. // "$ref": "Size"
  40894. // },
  40895. // "response": {
  40896. // "$ref": "Size"
  40897. // },
  40898. // "scopes": [
  40899. // "https://www.googleapis.com/auth/dfatrafficking"
  40900. // ]
  40901. // }
  40902. }
  40903. // method id "dfareporting.sizes.list":
  40904. type SizesListCall struct {
  40905. s *Service
  40906. profileId int64
  40907. urlParams_ gensupport.URLParams
  40908. ifNoneMatch_ string
  40909. ctx_ context.Context
  40910. header_ http.Header
  40911. }
  40912. // List: Retrieves a list of sizes, possibly filtered.
  40913. func (r *SizesService) List(profileId int64) *SizesListCall {
  40914. c := &SizesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  40915. c.profileId = profileId
  40916. return c
  40917. }
  40918. // Height sets the optional parameter "height": Select only sizes with
  40919. // this height.
  40920. func (c *SizesListCall) Height(height int64) *SizesListCall {
  40921. c.urlParams_.Set("height", fmt.Sprint(height))
  40922. return c
  40923. }
  40924. // IabStandard sets the optional parameter "iabStandard": Select only
  40925. // IAB standard sizes.
  40926. func (c *SizesListCall) IabStandard(iabStandard bool) *SizesListCall {
  40927. c.urlParams_.Set("iabStandard", fmt.Sprint(iabStandard))
  40928. return c
  40929. }
  40930. // Ids sets the optional parameter "ids": Select only sizes with these
  40931. // IDs.
  40932. func (c *SizesListCall) Ids(ids ...int64) *SizesListCall {
  40933. var ids_ []string
  40934. for _, v := range ids {
  40935. ids_ = append(ids_, fmt.Sprint(v))
  40936. }
  40937. c.urlParams_.SetMulti("ids", ids_)
  40938. return c
  40939. }
  40940. // Width sets the optional parameter "width": Select only sizes with
  40941. // this width.
  40942. func (c *SizesListCall) Width(width int64) *SizesListCall {
  40943. c.urlParams_.Set("width", fmt.Sprint(width))
  40944. return c
  40945. }
  40946. // Fields allows partial responses to be retrieved. See
  40947. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  40948. // for more information.
  40949. func (c *SizesListCall) Fields(s ...googleapi.Field) *SizesListCall {
  40950. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  40951. return c
  40952. }
  40953. // IfNoneMatch sets the optional parameter which makes the operation
  40954. // fail if the object's ETag matches the given value. This is useful for
  40955. // getting updates only after the object has changed since the last
  40956. // request. Use googleapi.IsNotModified to check whether the response
  40957. // error from Do is the result of In-None-Match.
  40958. func (c *SizesListCall) IfNoneMatch(entityTag string) *SizesListCall {
  40959. c.ifNoneMatch_ = entityTag
  40960. return c
  40961. }
  40962. // Context sets the context to be used in this call's Do method. Any
  40963. // pending HTTP request will be aborted if the provided context is
  40964. // canceled.
  40965. func (c *SizesListCall) Context(ctx context.Context) *SizesListCall {
  40966. c.ctx_ = ctx
  40967. return c
  40968. }
  40969. // Header returns an http.Header that can be modified by the caller to
  40970. // add HTTP headers to the request.
  40971. func (c *SizesListCall) Header() http.Header {
  40972. if c.header_ == nil {
  40973. c.header_ = make(http.Header)
  40974. }
  40975. return c.header_
  40976. }
  40977. func (c *SizesListCall) doRequest(alt string) (*http.Response, error) {
  40978. reqHeaders := make(http.Header)
  40979. for k, v := range c.header_ {
  40980. reqHeaders[k] = v
  40981. }
  40982. reqHeaders.Set("User-Agent", c.s.userAgent())
  40983. if c.ifNoneMatch_ != "" {
  40984. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  40985. }
  40986. var body io.Reader = nil
  40987. c.urlParams_.Set("alt", alt)
  40988. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/sizes")
  40989. urls += "?" + c.urlParams_.Encode()
  40990. req, _ := http.NewRequest("GET", urls, body)
  40991. req.Header = reqHeaders
  40992. googleapi.Expand(req.URL, map[string]string{
  40993. "profileId": strconv.FormatInt(c.profileId, 10),
  40994. })
  40995. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  40996. }
  40997. // Do executes the "dfareporting.sizes.list" call.
  40998. // Exactly one of *SizesListResponse or error will be non-nil. Any
  40999. // non-2xx status code is an error. Response headers are in either
  41000. // *SizesListResponse.ServerResponse.Header or (if a response was
  41001. // returned at all) in error.(*googleapi.Error).Header. Use
  41002. // googleapi.IsNotModified to check whether the returned error was
  41003. // because http.StatusNotModified was returned.
  41004. func (c *SizesListCall) Do(opts ...googleapi.CallOption) (*SizesListResponse, error) {
  41005. gensupport.SetOptions(c.urlParams_, opts...)
  41006. res, err := c.doRequest("json")
  41007. if res != nil && res.StatusCode == http.StatusNotModified {
  41008. if res.Body != nil {
  41009. res.Body.Close()
  41010. }
  41011. return nil, &googleapi.Error{
  41012. Code: res.StatusCode,
  41013. Header: res.Header,
  41014. }
  41015. }
  41016. if err != nil {
  41017. return nil, err
  41018. }
  41019. defer googleapi.CloseBody(res)
  41020. if err := googleapi.CheckResponse(res); err != nil {
  41021. return nil, err
  41022. }
  41023. ret := &SizesListResponse{
  41024. ServerResponse: googleapi.ServerResponse{
  41025. Header: res.Header,
  41026. HTTPStatusCode: res.StatusCode,
  41027. },
  41028. }
  41029. target := &ret
  41030. if err := gensupport.DecodeResponse(target, res); err != nil {
  41031. return nil, err
  41032. }
  41033. return ret, nil
  41034. // {
  41035. // "description": "Retrieves a list of sizes, possibly filtered.",
  41036. // "httpMethod": "GET",
  41037. // "id": "dfareporting.sizes.list",
  41038. // "parameterOrder": [
  41039. // "profileId"
  41040. // ],
  41041. // "parameters": {
  41042. // "height": {
  41043. // "description": "Select only sizes with this height.",
  41044. // "format": "int32",
  41045. // "location": "query",
  41046. // "maximum": "32767",
  41047. // "minimum": "0",
  41048. // "type": "integer"
  41049. // },
  41050. // "iabStandard": {
  41051. // "description": "Select only IAB standard sizes.",
  41052. // "location": "query",
  41053. // "type": "boolean"
  41054. // },
  41055. // "ids": {
  41056. // "description": "Select only sizes with these IDs.",
  41057. // "format": "int64",
  41058. // "location": "query",
  41059. // "repeated": true,
  41060. // "type": "string"
  41061. // },
  41062. // "profileId": {
  41063. // "description": "User profile ID associated with this request.",
  41064. // "format": "int64",
  41065. // "location": "path",
  41066. // "required": true,
  41067. // "type": "string"
  41068. // },
  41069. // "width": {
  41070. // "description": "Select only sizes with this width.",
  41071. // "format": "int32",
  41072. // "location": "query",
  41073. // "maximum": "32767",
  41074. // "minimum": "0",
  41075. // "type": "integer"
  41076. // }
  41077. // },
  41078. // "path": "userprofiles/{profileId}/sizes",
  41079. // "response": {
  41080. // "$ref": "SizesListResponse"
  41081. // },
  41082. // "scopes": [
  41083. // "https://www.googleapis.com/auth/dfatrafficking"
  41084. // ]
  41085. // }
  41086. }
  41087. // method id "dfareporting.subaccounts.get":
  41088. type SubaccountsGetCall struct {
  41089. s *Service
  41090. profileId int64
  41091. id int64
  41092. urlParams_ gensupport.URLParams
  41093. ifNoneMatch_ string
  41094. ctx_ context.Context
  41095. header_ http.Header
  41096. }
  41097. // Get: Gets one subaccount by ID.
  41098. func (r *SubaccountsService) Get(profileId int64, id int64) *SubaccountsGetCall {
  41099. c := &SubaccountsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41100. c.profileId = profileId
  41101. c.id = id
  41102. return c
  41103. }
  41104. // Fields allows partial responses to be retrieved. See
  41105. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41106. // for more information.
  41107. func (c *SubaccountsGetCall) Fields(s ...googleapi.Field) *SubaccountsGetCall {
  41108. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41109. return c
  41110. }
  41111. // IfNoneMatch sets the optional parameter which makes the operation
  41112. // fail if the object's ETag matches the given value. This is useful for
  41113. // getting updates only after the object has changed since the last
  41114. // request. Use googleapi.IsNotModified to check whether the response
  41115. // error from Do is the result of In-None-Match.
  41116. func (c *SubaccountsGetCall) IfNoneMatch(entityTag string) *SubaccountsGetCall {
  41117. c.ifNoneMatch_ = entityTag
  41118. return c
  41119. }
  41120. // Context sets the context to be used in this call's Do method. Any
  41121. // pending HTTP request will be aborted if the provided context is
  41122. // canceled.
  41123. func (c *SubaccountsGetCall) Context(ctx context.Context) *SubaccountsGetCall {
  41124. c.ctx_ = ctx
  41125. return c
  41126. }
  41127. // Header returns an http.Header that can be modified by the caller to
  41128. // add HTTP headers to the request.
  41129. func (c *SubaccountsGetCall) Header() http.Header {
  41130. if c.header_ == nil {
  41131. c.header_ = make(http.Header)
  41132. }
  41133. return c.header_
  41134. }
  41135. func (c *SubaccountsGetCall) doRequest(alt string) (*http.Response, error) {
  41136. reqHeaders := make(http.Header)
  41137. for k, v := range c.header_ {
  41138. reqHeaders[k] = v
  41139. }
  41140. reqHeaders.Set("User-Agent", c.s.userAgent())
  41141. if c.ifNoneMatch_ != "" {
  41142. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41143. }
  41144. var body io.Reader = nil
  41145. c.urlParams_.Set("alt", alt)
  41146. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts/{id}")
  41147. urls += "?" + c.urlParams_.Encode()
  41148. req, _ := http.NewRequest("GET", urls, body)
  41149. req.Header = reqHeaders
  41150. googleapi.Expand(req.URL, map[string]string{
  41151. "profileId": strconv.FormatInt(c.profileId, 10),
  41152. "id": strconv.FormatInt(c.id, 10),
  41153. })
  41154. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41155. }
  41156. // Do executes the "dfareporting.subaccounts.get" call.
  41157. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  41158. // status code is an error. Response headers are in either
  41159. // *Subaccount.ServerResponse.Header or (if a response was returned at
  41160. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41161. // to check whether the returned error was because
  41162. // http.StatusNotModified was returned.
  41163. func (c *SubaccountsGetCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  41164. gensupport.SetOptions(c.urlParams_, opts...)
  41165. res, err := c.doRequest("json")
  41166. if res != nil && res.StatusCode == http.StatusNotModified {
  41167. if res.Body != nil {
  41168. res.Body.Close()
  41169. }
  41170. return nil, &googleapi.Error{
  41171. Code: res.StatusCode,
  41172. Header: res.Header,
  41173. }
  41174. }
  41175. if err != nil {
  41176. return nil, err
  41177. }
  41178. defer googleapi.CloseBody(res)
  41179. if err := googleapi.CheckResponse(res); err != nil {
  41180. return nil, err
  41181. }
  41182. ret := &Subaccount{
  41183. ServerResponse: googleapi.ServerResponse{
  41184. Header: res.Header,
  41185. HTTPStatusCode: res.StatusCode,
  41186. },
  41187. }
  41188. target := &ret
  41189. if err := gensupport.DecodeResponse(target, res); err != nil {
  41190. return nil, err
  41191. }
  41192. return ret, nil
  41193. // {
  41194. // "description": "Gets one subaccount by ID.",
  41195. // "httpMethod": "GET",
  41196. // "id": "dfareporting.subaccounts.get",
  41197. // "parameterOrder": [
  41198. // "profileId",
  41199. // "id"
  41200. // ],
  41201. // "parameters": {
  41202. // "id": {
  41203. // "description": "Subaccount ID.",
  41204. // "format": "int64",
  41205. // "location": "path",
  41206. // "required": true,
  41207. // "type": "string"
  41208. // },
  41209. // "profileId": {
  41210. // "description": "User profile ID associated with this request.",
  41211. // "format": "int64",
  41212. // "location": "path",
  41213. // "required": true,
  41214. // "type": "string"
  41215. // }
  41216. // },
  41217. // "path": "userprofiles/{profileId}/subaccounts/{id}",
  41218. // "response": {
  41219. // "$ref": "Subaccount"
  41220. // },
  41221. // "scopes": [
  41222. // "https://www.googleapis.com/auth/dfatrafficking"
  41223. // ]
  41224. // }
  41225. }
  41226. // method id "dfareporting.subaccounts.insert":
  41227. type SubaccountsInsertCall struct {
  41228. s *Service
  41229. profileId int64
  41230. subaccount *Subaccount
  41231. urlParams_ gensupport.URLParams
  41232. ctx_ context.Context
  41233. header_ http.Header
  41234. }
  41235. // Insert: Inserts a new subaccount.
  41236. func (r *SubaccountsService) Insert(profileId int64, subaccount *Subaccount) *SubaccountsInsertCall {
  41237. c := &SubaccountsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41238. c.profileId = profileId
  41239. c.subaccount = subaccount
  41240. return c
  41241. }
  41242. // Fields allows partial responses to be retrieved. See
  41243. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41244. // for more information.
  41245. func (c *SubaccountsInsertCall) Fields(s ...googleapi.Field) *SubaccountsInsertCall {
  41246. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41247. return c
  41248. }
  41249. // Context sets the context to be used in this call's Do method. Any
  41250. // pending HTTP request will be aborted if the provided context is
  41251. // canceled.
  41252. func (c *SubaccountsInsertCall) Context(ctx context.Context) *SubaccountsInsertCall {
  41253. c.ctx_ = ctx
  41254. return c
  41255. }
  41256. // Header returns an http.Header that can be modified by the caller to
  41257. // add HTTP headers to the request.
  41258. func (c *SubaccountsInsertCall) Header() http.Header {
  41259. if c.header_ == nil {
  41260. c.header_ = make(http.Header)
  41261. }
  41262. return c.header_
  41263. }
  41264. func (c *SubaccountsInsertCall) doRequest(alt string) (*http.Response, error) {
  41265. reqHeaders := make(http.Header)
  41266. for k, v := range c.header_ {
  41267. reqHeaders[k] = v
  41268. }
  41269. reqHeaders.Set("User-Agent", c.s.userAgent())
  41270. var body io.Reader = nil
  41271. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  41272. if err != nil {
  41273. return nil, err
  41274. }
  41275. reqHeaders.Set("Content-Type", "application/json")
  41276. c.urlParams_.Set("alt", alt)
  41277. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  41278. urls += "?" + c.urlParams_.Encode()
  41279. req, _ := http.NewRequest("POST", urls, body)
  41280. req.Header = reqHeaders
  41281. googleapi.Expand(req.URL, map[string]string{
  41282. "profileId": strconv.FormatInt(c.profileId, 10),
  41283. })
  41284. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41285. }
  41286. // Do executes the "dfareporting.subaccounts.insert" call.
  41287. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  41288. // status code is an error. Response headers are in either
  41289. // *Subaccount.ServerResponse.Header or (if a response was returned at
  41290. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41291. // to check whether the returned error was because
  41292. // http.StatusNotModified was returned.
  41293. func (c *SubaccountsInsertCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  41294. gensupport.SetOptions(c.urlParams_, opts...)
  41295. res, err := c.doRequest("json")
  41296. if res != nil && res.StatusCode == http.StatusNotModified {
  41297. if res.Body != nil {
  41298. res.Body.Close()
  41299. }
  41300. return nil, &googleapi.Error{
  41301. Code: res.StatusCode,
  41302. Header: res.Header,
  41303. }
  41304. }
  41305. if err != nil {
  41306. return nil, err
  41307. }
  41308. defer googleapi.CloseBody(res)
  41309. if err := googleapi.CheckResponse(res); err != nil {
  41310. return nil, err
  41311. }
  41312. ret := &Subaccount{
  41313. ServerResponse: googleapi.ServerResponse{
  41314. Header: res.Header,
  41315. HTTPStatusCode: res.StatusCode,
  41316. },
  41317. }
  41318. target := &ret
  41319. if err := gensupport.DecodeResponse(target, res); err != nil {
  41320. return nil, err
  41321. }
  41322. return ret, nil
  41323. // {
  41324. // "description": "Inserts a new subaccount.",
  41325. // "httpMethod": "POST",
  41326. // "id": "dfareporting.subaccounts.insert",
  41327. // "parameterOrder": [
  41328. // "profileId"
  41329. // ],
  41330. // "parameters": {
  41331. // "profileId": {
  41332. // "description": "User profile ID associated with this request.",
  41333. // "format": "int64",
  41334. // "location": "path",
  41335. // "required": true,
  41336. // "type": "string"
  41337. // }
  41338. // },
  41339. // "path": "userprofiles/{profileId}/subaccounts",
  41340. // "request": {
  41341. // "$ref": "Subaccount"
  41342. // },
  41343. // "response": {
  41344. // "$ref": "Subaccount"
  41345. // },
  41346. // "scopes": [
  41347. // "https://www.googleapis.com/auth/dfatrafficking"
  41348. // ]
  41349. // }
  41350. }
  41351. // method id "dfareporting.subaccounts.list":
  41352. type SubaccountsListCall struct {
  41353. s *Service
  41354. profileId int64
  41355. urlParams_ gensupport.URLParams
  41356. ifNoneMatch_ string
  41357. ctx_ context.Context
  41358. header_ http.Header
  41359. }
  41360. // List: Gets a list of subaccounts, possibly filtered. This method
  41361. // supports paging.
  41362. func (r *SubaccountsService) List(profileId int64) *SubaccountsListCall {
  41363. c := &SubaccountsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41364. c.profileId = profileId
  41365. return c
  41366. }
  41367. // Ids sets the optional parameter "ids": Select only subaccounts with
  41368. // these IDs.
  41369. func (c *SubaccountsListCall) Ids(ids ...int64) *SubaccountsListCall {
  41370. var ids_ []string
  41371. for _, v := range ids {
  41372. ids_ = append(ids_, fmt.Sprint(v))
  41373. }
  41374. c.urlParams_.SetMulti("ids", ids_)
  41375. return c
  41376. }
  41377. // MaxResults sets the optional parameter "maxResults": Maximum number
  41378. // of results to return.
  41379. func (c *SubaccountsListCall) MaxResults(maxResults int64) *SubaccountsListCall {
  41380. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  41381. return c
  41382. }
  41383. // PageToken sets the optional parameter "pageToken": Value of the
  41384. // nextPageToken from the previous result page.
  41385. func (c *SubaccountsListCall) PageToken(pageToken string) *SubaccountsListCall {
  41386. c.urlParams_.Set("pageToken", pageToken)
  41387. return c
  41388. }
  41389. // SearchString sets the optional parameter "searchString": Allows
  41390. // searching for objects by name or ID. Wildcards (*) are allowed. For
  41391. // example, "subaccount*2015" will return objects with names like
  41392. // "subaccount June 2015", "subaccount April 2015", or simply
  41393. // "subaccount 2015". Most of the searches also add wildcards implicitly
  41394. // at the start and the end of the search string. For example, a search
  41395. // string of "subaccount" will match objects with name "my subaccount",
  41396. // "subaccount 2015", or simply "subaccount".
  41397. func (c *SubaccountsListCall) SearchString(searchString string) *SubaccountsListCall {
  41398. c.urlParams_.Set("searchString", searchString)
  41399. return c
  41400. }
  41401. // SortField sets the optional parameter "sortField": Field by which to
  41402. // sort the list.
  41403. //
  41404. // Possible values:
  41405. // "ID" (default)
  41406. // "NAME"
  41407. func (c *SubaccountsListCall) SortField(sortField string) *SubaccountsListCall {
  41408. c.urlParams_.Set("sortField", sortField)
  41409. return c
  41410. }
  41411. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  41412. // results.
  41413. //
  41414. // Possible values:
  41415. // "ASCENDING" (default)
  41416. // "DESCENDING"
  41417. func (c *SubaccountsListCall) SortOrder(sortOrder string) *SubaccountsListCall {
  41418. c.urlParams_.Set("sortOrder", sortOrder)
  41419. return c
  41420. }
  41421. // Fields allows partial responses to be retrieved. See
  41422. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41423. // for more information.
  41424. func (c *SubaccountsListCall) Fields(s ...googleapi.Field) *SubaccountsListCall {
  41425. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41426. return c
  41427. }
  41428. // IfNoneMatch sets the optional parameter which makes the operation
  41429. // fail if the object's ETag matches the given value. This is useful for
  41430. // getting updates only after the object has changed since the last
  41431. // request. Use googleapi.IsNotModified to check whether the response
  41432. // error from Do is the result of In-None-Match.
  41433. func (c *SubaccountsListCall) IfNoneMatch(entityTag string) *SubaccountsListCall {
  41434. c.ifNoneMatch_ = entityTag
  41435. return c
  41436. }
  41437. // Context sets the context to be used in this call's Do method. Any
  41438. // pending HTTP request will be aborted if the provided context is
  41439. // canceled.
  41440. func (c *SubaccountsListCall) Context(ctx context.Context) *SubaccountsListCall {
  41441. c.ctx_ = ctx
  41442. return c
  41443. }
  41444. // Header returns an http.Header that can be modified by the caller to
  41445. // add HTTP headers to the request.
  41446. func (c *SubaccountsListCall) Header() http.Header {
  41447. if c.header_ == nil {
  41448. c.header_ = make(http.Header)
  41449. }
  41450. return c.header_
  41451. }
  41452. func (c *SubaccountsListCall) doRequest(alt string) (*http.Response, error) {
  41453. reqHeaders := make(http.Header)
  41454. for k, v := range c.header_ {
  41455. reqHeaders[k] = v
  41456. }
  41457. reqHeaders.Set("User-Agent", c.s.userAgent())
  41458. if c.ifNoneMatch_ != "" {
  41459. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41460. }
  41461. var body io.Reader = nil
  41462. c.urlParams_.Set("alt", alt)
  41463. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  41464. urls += "?" + c.urlParams_.Encode()
  41465. req, _ := http.NewRequest("GET", urls, body)
  41466. req.Header = reqHeaders
  41467. googleapi.Expand(req.URL, map[string]string{
  41468. "profileId": strconv.FormatInt(c.profileId, 10),
  41469. })
  41470. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41471. }
  41472. // Do executes the "dfareporting.subaccounts.list" call.
  41473. // Exactly one of *SubaccountsListResponse or error will be non-nil. Any
  41474. // non-2xx status code is an error. Response headers are in either
  41475. // *SubaccountsListResponse.ServerResponse.Header or (if a response was
  41476. // returned at all) in error.(*googleapi.Error).Header. Use
  41477. // googleapi.IsNotModified to check whether the returned error was
  41478. // because http.StatusNotModified was returned.
  41479. func (c *SubaccountsListCall) Do(opts ...googleapi.CallOption) (*SubaccountsListResponse, error) {
  41480. gensupport.SetOptions(c.urlParams_, opts...)
  41481. res, err := c.doRequest("json")
  41482. if res != nil && res.StatusCode == http.StatusNotModified {
  41483. if res.Body != nil {
  41484. res.Body.Close()
  41485. }
  41486. return nil, &googleapi.Error{
  41487. Code: res.StatusCode,
  41488. Header: res.Header,
  41489. }
  41490. }
  41491. if err != nil {
  41492. return nil, err
  41493. }
  41494. defer googleapi.CloseBody(res)
  41495. if err := googleapi.CheckResponse(res); err != nil {
  41496. return nil, err
  41497. }
  41498. ret := &SubaccountsListResponse{
  41499. ServerResponse: googleapi.ServerResponse{
  41500. Header: res.Header,
  41501. HTTPStatusCode: res.StatusCode,
  41502. },
  41503. }
  41504. target := &ret
  41505. if err := gensupport.DecodeResponse(target, res); err != nil {
  41506. return nil, err
  41507. }
  41508. return ret, nil
  41509. // {
  41510. // "description": "Gets a list of subaccounts, possibly filtered. This method supports paging.",
  41511. // "httpMethod": "GET",
  41512. // "id": "dfareporting.subaccounts.list",
  41513. // "parameterOrder": [
  41514. // "profileId"
  41515. // ],
  41516. // "parameters": {
  41517. // "ids": {
  41518. // "description": "Select only subaccounts with these IDs.",
  41519. // "format": "int64",
  41520. // "location": "query",
  41521. // "repeated": true,
  41522. // "type": "string"
  41523. // },
  41524. // "maxResults": {
  41525. // "default": "1000",
  41526. // "description": "Maximum number of results to return.",
  41527. // "format": "int32",
  41528. // "location": "query",
  41529. // "maximum": "1000",
  41530. // "minimum": "0",
  41531. // "type": "integer"
  41532. // },
  41533. // "pageToken": {
  41534. // "description": "Value of the nextPageToken from the previous result page.",
  41535. // "location": "query",
  41536. // "type": "string"
  41537. // },
  41538. // "profileId": {
  41539. // "description": "User profile ID associated with this request.",
  41540. // "format": "int64",
  41541. // "location": "path",
  41542. // "required": true,
  41543. // "type": "string"
  41544. // },
  41545. // "searchString": {
  41546. // "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\".",
  41547. // "location": "query",
  41548. // "type": "string"
  41549. // },
  41550. // "sortField": {
  41551. // "default": "ID",
  41552. // "description": "Field by which to sort the list.",
  41553. // "enum": [
  41554. // "ID",
  41555. // "NAME"
  41556. // ],
  41557. // "enumDescriptions": [
  41558. // "",
  41559. // ""
  41560. // ],
  41561. // "location": "query",
  41562. // "type": "string"
  41563. // },
  41564. // "sortOrder": {
  41565. // "default": "ASCENDING",
  41566. // "description": "Order of sorted results.",
  41567. // "enum": [
  41568. // "ASCENDING",
  41569. // "DESCENDING"
  41570. // ],
  41571. // "enumDescriptions": [
  41572. // "",
  41573. // ""
  41574. // ],
  41575. // "location": "query",
  41576. // "type": "string"
  41577. // }
  41578. // },
  41579. // "path": "userprofiles/{profileId}/subaccounts",
  41580. // "response": {
  41581. // "$ref": "SubaccountsListResponse"
  41582. // },
  41583. // "scopes": [
  41584. // "https://www.googleapis.com/auth/dfatrafficking"
  41585. // ]
  41586. // }
  41587. }
  41588. // Pages invokes f for each page of results.
  41589. // A non-nil error returned from f will halt the iteration.
  41590. // The provided context supersedes any context provided to the Context method.
  41591. func (c *SubaccountsListCall) Pages(ctx context.Context, f func(*SubaccountsListResponse) error) error {
  41592. c.ctx_ = ctx
  41593. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  41594. for {
  41595. x, err := c.Do()
  41596. if err != nil {
  41597. return err
  41598. }
  41599. if err := f(x); err != nil {
  41600. return err
  41601. }
  41602. if x.NextPageToken == "" {
  41603. return nil
  41604. }
  41605. c.PageToken(x.NextPageToken)
  41606. }
  41607. }
  41608. // method id "dfareporting.subaccounts.patch":
  41609. type SubaccountsPatchCall struct {
  41610. s *Service
  41611. profileId int64
  41612. subaccount *Subaccount
  41613. urlParams_ gensupport.URLParams
  41614. ctx_ context.Context
  41615. header_ http.Header
  41616. }
  41617. // Patch: Updates an existing subaccount. This method supports patch
  41618. // semantics.
  41619. func (r *SubaccountsService) Patch(profileId int64, id int64, subaccount *Subaccount) *SubaccountsPatchCall {
  41620. c := &SubaccountsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41621. c.profileId = profileId
  41622. c.urlParams_.Set("id", fmt.Sprint(id))
  41623. c.subaccount = subaccount
  41624. return c
  41625. }
  41626. // Fields allows partial responses to be retrieved. See
  41627. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41628. // for more information.
  41629. func (c *SubaccountsPatchCall) Fields(s ...googleapi.Field) *SubaccountsPatchCall {
  41630. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41631. return c
  41632. }
  41633. // Context sets the context to be used in this call's Do method. Any
  41634. // pending HTTP request will be aborted if the provided context is
  41635. // canceled.
  41636. func (c *SubaccountsPatchCall) Context(ctx context.Context) *SubaccountsPatchCall {
  41637. c.ctx_ = ctx
  41638. return c
  41639. }
  41640. // Header returns an http.Header that can be modified by the caller to
  41641. // add HTTP headers to the request.
  41642. func (c *SubaccountsPatchCall) Header() http.Header {
  41643. if c.header_ == nil {
  41644. c.header_ = make(http.Header)
  41645. }
  41646. return c.header_
  41647. }
  41648. func (c *SubaccountsPatchCall) doRequest(alt string) (*http.Response, error) {
  41649. reqHeaders := make(http.Header)
  41650. for k, v := range c.header_ {
  41651. reqHeaders[k] = v
  41652. }
  41653. reqHeaders.Set("User-Agent", c.s.userAgent())
  41654. var body io.Reader = nil
  41655. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  41656. if err != nil {
  41657. return nil, err
  41658. }
  41659. reqHeaders.Set("Content-Type", "application/json")
  41660. c.urlParams_.Set("alt", alt)
  41661. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  41662. urls += "?" + c.urlParams_.Encode()
  41663. req, _ := http.NewRequest("PATCH", urls, body)
  41664. req.Header = reqHeaders
  41665. googleapi.Expand(req.URL, map[string]string{
  41666. "profileId": strconv.FormatInt(c.profileId, 10),
  41667. })
  41668. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41669. }
  41670. // Do executes the "dfareporting.subaccounts.patch" call.
  41671. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  41672. // status code is an error. Response headers are in either
  41673. // *Subaccount.ServerResponse.Header or (if a response was returned at
  41674. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41675. // to check whether the returned error was because
  41676. // http.StatusNotModified was returned.
  41677. func (c *SubaccountsPatchCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  41678. gensupport.SetOptions(c.urlParams_, opts...)
  41679. res, err := c.doRequest("json")
  41680. if res != nil && res.StatusCode == http.StatusNotModified {
  41681. if res.Body != nil {
  41682. res.Body.Close()
  41683. }
  41684. return nil, &googleapi.Error{
  41685. Code: res.StatusCode,
  41686. Header: res.Header,
  41687. }
  41688. }
  41689. if err != nil {
  41690. return nil, err
  41691. }
  41692. defer googleapi.CloseBody(res)
  41693. if err := googleapi.CheckResponse(res); err != nil {
  41694. return nil, err
  41695. }
  41696. ret := &Subaccount{
  41697. ServerResponse: googleapi.ServerResponse{
  41698. Header: res.Header,
  41699. HTTPStatusCode: res.StatusCode,
  41700. },
  41701. }
  41702. target := &ret
  41703. if err := gensupport.DecodeResponse(target, res); err != nil {
  41704. return nil, err
  41705. }
  41706. return ret, nil
  41707. // {
  41708. // "description": "Updates an existing subaccount. This method supports patch semantics.",
  41709. // "httpMethod": "PATCH",
  41710. // "id": "dfareporting.subaccounts.patch",
  41711. // "parameterOrder": [
  41712. // "profileId",
  41713. // "id"
  41714. // ],
  41715. // "parameters": {
  41716. // "id": {
  41717. // "description": "Subaccount ID.",
  41718. // "format": "int64",
  41719. // "location": "query",
  41720. // "required": true,
  41721. // "type": "string"
  41722. // },
  41723. // "profileId": {
  41724. // "description": "User profile ID associated with this request.",
  41725. // "format": "int64",
  41726. // "location": "path",
  41727. // "required": true,
  41728. // "type": "string"
  41729. // }
  41730. // },
  41731. // "path": "userprofiles/{profileId}/subaccounts",
  41732. // "request": {
  41733. // "$ref": "Subaccount"
  41734. // },
  41735. // "response": {
  41736. // "$ref": "Subaccount"
  41737. // },
  41738. // "scopes": [
  41739. // "https://www.googleapis.com/auth/dfatrafficking"
  41740. // ]
  41741. // }
  41742. }
  41743. // method id "dfareporting.subaccounts.update":
  41744. type SubaccountsUpdateCall struct {
  41745. s *Service
  41746. profileId int64
  41747. subaccount *Subaccount
  41748. urlParams_ gensupport.URLParams
  41749. ctx_ context.Context
  41750. header_ http.Header
  41751. }
  41752. // Update: Updates an existing subaccount.
  41753. func (r *SubaccountsService) Update(profileId int64, subaccount *Subaccount) *SubaccountsUpdateCall {
  41754. c := &SubaccountsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41755. c.profileId = profileId
  41756. c.subaccount = subaccount
  41757. return c
  41758. }
  41759. // Fields allows partial responses to be retrieved. See
  41760. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41761. // for more information.
  41762. func (c *SubaccountsUpdateCall) Fields(s ...googleapi.Field) *SubaccountsUpdateCall {
  41763. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41764. return c
  41765. }
  41766. // Context sets the context to be used in this call's Do method. Any
  41767. // pending HTTP request will be aborted if the provided context is
  41768. // canceled.
  41769. func (c *SubaccountsUpdateCall) Context(ctx context.Context) *SubaccountsUpdateCall {
  41770. c.ctx_ = ctx
  41771. return c
  41772. }
  41773. // Header returns an http.Header that can be modified by the caller to
  41774. // add HTTP headers to the request.
  41775. func (c *SubaccountsUpdateCall) Header() http.Header {
  41776. if c.header_ == nil {
  41777. c.header_ = make(http.Header)
  41778. }
  41779. return c.header_
  41780. }
  41781. func (c *SubaccountsUpdateCall) doRequest(alt string) (*http.Response, error) {
  41782. reqHeaders := make(http.Header)
  41783. for k, v := range c.header_ {
  41784. reqHeaders[k] = v
  41785. }
  41786. reqHeaders.Set("User-Agent", c.s.userAgent())
  41787. var body io.Reader = nil
  41788. body, err := googleapi.WithoutDataWrapper.JSONReader(c.subaccount)
  41789. if err != nil {
  41790. return nil, err
  41791. }
  41792. reqHeaders.Set("Content-Type", "application/json")
  41793. c.urlParams_.Set("alt", alt)
  41794. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/subaccounts")
  41795. urls += "?" + c.urlParams_.Encode()
  41796. req, _ := http.NewRequest("PUT", urls, body)
  41797. req.Header = reqHeaders
  41798. googleapi.Expand(req.URL, map[string]string{
  41799. "profileId": strconv.FormatInt(c.profileId, 10),
  41800. })
  41801. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41802. }
  41803. // Do executes the "dfareporting.subaccounts.update" call.
  41804. // Exactly one of *Subaccount or error will be non-nil. Any non-2xx
  41805. // status code is an error. Response headers are in either
  41806. // *Subaccount.ServerResponse.Header or (if a response was returned at
  41807. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  41808. // to check whether the returned error was because
  41809. // http.StatusNotModified was returned.
  41810. func (c *SubaccountsUpdateCall) Do(opts ...googleapi.CallOption) (*Subaccount, error) {
  41811. gensupport.SetOptions(c.urlParams_, opts...)
  41812. res, err := c.doRequest("json")
  41813. if res != nil && res.StatusCode == http.StatusNotModified {
  41814. if res.Body != nil {
  41815. res.Body.Close()
  41816. }
  41817. return nil, &googleapi.Error{
  41818. Code: res.StatusCode,
  41819. Header: res.Header,
  41820. }
  41821. }
  41822. if err != nil {
  41823. return nil, err
  41824. }
  41825. defer googleapi.CloseBody(res)
  41826. if err := googleapi.CheckResponse(res); err != nil {
  41827. return nil, err
  41828. }
  41829. ret := &Subaccount{
  41830. ServerResponse: googleapi.ServerResponse{
  41831. Header: res.Header,
  41832. HTTPStatusCode: res.StatusCode,
  41833. },
  41834. }
  41835. target := &ret
  41836. if err := gensupport.DecodeResponse(target, res); err != nil {
  41837. return nil, err
  41838. }
  41839. return ret, nil
  41840. // {
  41841. // "description": "Updates an existing subaccount.",
  41842. // "httpMethod": "PUT",
  41843. // "id": "dfareporting.subaccounts.update",
  41844. // "parameterOrder": [
  41845. // "profileId"
  41846. // ],
  41847. // "parameters": {
  41848. // "profileId": {
  41849. // "description": "User profile ID associated with this request.",
  41850. // "format": "int64",
  41851. // "location": "path",
  41852. // "required": true,
  41853. // "type": "string"
  41854. // }
  41855. // },
  41856. // "path": "userprofiles/{profileId}/subaccounts",
  41857. // "request": {
  41858. // "$ref": "Subaccount"
  41859. // },
  41860. // "response": {
  41861. // "$ref": "Subaccount"
  41862. // },
  41863. // "scopes": [
  41864. // "https://www.googleapis.com/auth/dfatrafficking"
  41865. // ]
  41866. // }
  41867. }
  41868. // method id "dfareporting.targetableRemarketingLists.get":
  41869. type TargetableRemarketingListsGetCall struct {
  41870. s *Service
  41871. profileId int64
  41872. id int64
  41873. urlParams_ gensupport.URLParams
  41874. ifNoneMatch_ string
  41875. ctx_ context.Context
  41876. header_ http.Header
  41877. }
  41878. // Get: Gets one remarketing list by ID.
  41879. func (r *TargetableRemarketingListsService) Get(profileId int64, id int64) *TargetableRemarketingListsGetCall {
  41880. c := &TargetableRemarketingListsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  41881. c.profileId = profileId
  41882. c.id = id
  41883. return c
  41884. }
  41885. // Fields allows partial responses to be retrieved. See
  41886. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  41887. // for more information.
  41888. func (c *TargetableRemarketingListsGetCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsGetCall {
  41889. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  41890. return c
  41891. }
  41892. // IfNoneMatch sets the optional parameter which makes the operation
  41893. // fail if the object's ETag matches the given value. This is useful for
  41894. // getting updates only after the object has changed since the last
  41895. // request. Use googleapi.IsNotModified to check whether the response
  41896. // error from Do is the result of In-None-Match.
  41897. func (c *TargetableRemarketingListsGetCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsGetCall {
  41898. c.ifNoneMatch_ = entityTag
  41899. return c
  41900. }
  41901. // Context sets the context to be used in this call's Do method. Any
  41902. // pending HTTP request will be aborted if the provided context is
  41903. // canceled.
  41904. func (c *TargetableRemarketingListsGetCall) Context(ctx context.Context) *TargetableRemarketingListsGetCall {
  41905. c.ctx_ = ctx
  41906. return c
  41907. }
  41908. // Header returns an http.Header that can be modified by the caller to
  41909. // add HTTP headers to the request.
  41910. func (c *TargetableRemarketingListsGetCall) Header() http.Header {
  41911. if c.header_ == nil {
  41912. c.header_ = make(http.Header)
  41913. }
  41914. return c.header_
  41915. }
  41916. func (c *TargetableRemarketingListsGetCall) doRequest(alt string) (*http.Response, error) {
  41917. reqHeaders := make(http.Header)
  41918. for k, v := range c.header_ {
  41919. reqHeaders[k] = v
  41920. }
  41921. reqHeaders.Set("User-Agent", c.s.userAgent())
  41922. if c.ifNoneMatch_ != "" {
  41923. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  41924. }
  41925. var body io.Reader = nil
  41926. c.urlParams_.Set("alt", alt)
  41927. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists/{id}")
  41928. urls += "?" + c.urlParams_.Encode()
  41929. req, _ := http.NewRequest("GET", urls, body)
  41930. req.Header = reqHeaders
  41931. googleapi.Expand(req.URL, map[string]string{
  41932. "profileId": strconv.FormatInt(c.profileId, 10),
  41933. "id": strconv.FormatInt(c.id, 10),
  41934. })
  41935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  41936. }
  41937. // Do executes the "dfareporting.targetableRemarketingLists.get" call.
  41938. // Exactly one of *TargetableRemarketingList or error will be non-nil.
  41939. // Any non-2xx status code is an error. Response headers are in either
  41940. // *TargetableRemarketingList.ServerResponse.Header or (if a response
  41941. // was returned at all) in error.(*googleapi.Error).Header. Use
  41942. // googleapi.IsNotModified to check whether the returned error was
  41943. // because http.StatusNotModified was returned.
  41944. func (c *TargetableRemarketingListsGetCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingList, error) {
  41945. gensupport.SetOptions(c.urlParams_, opts...)
  41946. res, err := c.doRequest("json")
  41947. if res != nil && res.StatusCode == http.StatusNotModified {
  41948. if res.Body != nil {
  41949. res.Body.Close()
  41950. }
  41951. return nil, &googleapi.Error{
  41952. Code: res.StatusCode,
  41953. Header: res.Header,
  41954. }
  41955. }
  41956. if err != nil {
  41957. return nil, err
  41958. }
  41959. defer googleapi.CloseBody(res)
  41960. if err := googleapi.CheckResponse(res); err != nil {
  41961. return nil, err
  41962. }
  41963. ret := &TargetableRemarketingList{
  41964. ServerResponse: googleapi.ServerResponse{
  41965. Header: res.Header,
  41966. HTTPStatusCode: res.StatusCode,
  41967. },
  41968. }
  41969. target := &ret
  41970. if err := gensupport.DecodeResponse(target, res); err != nil {
  41971. return nil, err
  41972. }
  41973. return ret, nil
  41974. // {
  41975. // "description": "Gets one remarketing list by ID.",
  41976. // "httpMethod": "GET",
  41977. // "id": "dfareporting.targetableRemarketingLists.get",
  41978. // "parameterOrder": [
  41979. // "profileId",
  41980. // "id"
  41981. // ],
  41982. // "parameters": {
  41983. // "id": {
  41984. // "description": "Remarketing list ID.",
  41985. // "format": "int64",
  41986. // "location": "path",
  41987. // "required": true,
  41988. // "type": "string"
  41989. // },
  41990. // "profileId": {
  41991. // "description": "User profile ID associated with this request.",
  41992. // "format": "int64",
  41993. // "location": "path",
  41994. // "required": true,
  41995. // "type": "string"
  41996. // }
  41997. // },
  41998. // "path": "userprofiles/{profileId}/targetableRemarketingLists/{id}",
  41999. // "response": {
  42000. // "$ref": "TargetableRemarketingList"
  42001. // },
  42002. // "scopes": [
  42003. // "https://www.googleapis.com/auth/dfatrafficking"
  42004. // ]
  42005. // }
  42006. }
  42007. // method id "dfareporting.targetableRemarketingLists.list":
  42008. type TargetableRemarketingListsListCall struct {
  42009. s *Service
  42010. profileId int64
  42011. urlParams_ gensupport.URLParams
  42012. ifNoneMatch_ string
  42013. ctx_ context.Context
  42014. header_ http.Header
  42015. }
  42016. // List: Retrieves a list of targetable remarketing lists, possibly
  42017. // filtered. This method supports paging.
  42018. func (r *TargetableRemarketingListsService) List(profileId int64, advertiserId int64) *TargetableRemarketingListsListCall {
  42019. c := &TargetableRemarketingListsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42020. c.profileId = profileId
  42021. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  42022. return c
  42023. }
  42024. // Active sets the optional parameter "active": Select only active or
  42025. // only inactive targetable remarketing lists.
  42026. func (c *TargetableRemarketingListsListCall) Active(active bool) *TargetableRemarketingListsListCall {
  42027. c.urlParams_.Set("active", fmt.Sprint(active))
  42028. return c
  42029. }
  42030. // MaxResults sets the optional parameter "maxResults": Maximum number
  42031. // of results to return.
  42032. func (c *TargetableRemarketingListsListCall) MaxResults(maxResults int64) *TargetableRemarketingListsListCall {
  42033. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42034. return c
  42035. }
  42036. // Name sets the optional parameter "name": Allows searching for objects
  42037. // by name or ID. Wildcards (*) are allowed. For example, "remarketing
  42038. // list*2015" will return objects with names like "remarketing list June
  42039. // 2015", "remarketing list April 2015", or simply "remarketing list
  42040. // 2015". Most of the searches also add wildcards implicitly at the
  42041. // start and the end of the search string. For example, a search string
  42042. // of "remarketing list" will match objects with name "my remarketing
  42043. // list", "remarketing list 2015", or simply "remarketing list".
  42044. func (c *TargetableRemarketingListsListCall) Name(name string) *TargetableRemarketingListsListCall {
  42045. c.urlParams_.Set("name", name)
  42046. return c
  42047. }
  42048. // PageToken sets the optional parameter "pageToken": Value of the
  42049. // nextPageToken from the previous result page.
  42050. func (c *TargetableRemarketingListsListCall) PageToken(pageToken string) *TargetableRemarketingListsListCall {
  42051. c.urlParams_.Set("pageToken", pageToken)
  42052. return c
  42053. }
  42054. // SortField sets the optional parameter "sortField": Field by which to
  42055. // sort the list.
  42056. //
  42057. // Possible values:
  42058. // "ID" (default)
  42059. // "NAME"
  42060. func (c *TargetableRemarketingListsListCall) SortField(sortField string) *TargetableRemarketingListsListCall {
  42061. c.urlParams_.Set("sortField", sortField)
  42062. return c
  42063. }
  42064. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  42065. // results.
  42066. //
  42067. // Possible values:
  42068. // "ASCENDING" (default)
  42069. // "DESCENDING"
  42070. func (c *TargetableRemarketingListsListCall) SortOrder(sortOrder string) *TargetableRemarketingListsListCall {
  42071. c.urlParams_.Set("sortOrder", sortOrder)
  42072. return c
  42073. }
  42074. // Fields allows partial responses to be retrieved. See
  42075. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42076. // for more information.
  42077. func (c *TargetableRemarketingListsListCall) Fields(s ...googleapi.Field) *TargetableRemarketingListsListCall {
  42078. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42079. return c
  42080. }
  42081. // IfNoneMatch sets the optional parameter which makes the operation
  42082. // fail if the object's ETag matches the given value. This is useful for
  42083. // getting updates only after the object has changed since the last
  42084. // request. Use googleapi.IsNotModified to check whether the response
  42085. // error from Do is the result of In-None-Match.
  42086. func (c *TargetableRemarketingListsListCall) IfNoneMatch(entityTag string) *TargetableRemarketingListsListCall {
  42087. c.ifNoneMatch_ = entityTag
  42088. return c
  42089. }
  42090. // Context sets the context to be used in this call's Do method. Any
  42091. // pending HTTP request will be aborted if the provided context is
  42092. // canceled.
  42093. func (c *TargetableRemarketingListsListCall) Context(ctx context.Context) *TargetableRemarketingListsListCall {
  42094. c.ctx_ = ctx
  42095. return c
  42096. }
  42097. // Header returns an http.Header that can be modified by the caller to
  42098. // add HTTP headers to the request.
  42099. func (c *TargetableRemarketingListsListCall) Header() http.Header {
  42100. if c.header_ == nil {
  42101. c.header_ = make(http.Header)
  42102. }
  42103. return c.header_
  42104. }
  42105. func (c *TargetableRemarketingListsListCall) doRequest(alt string) (*http.Response, error) {
  42106. reqHeaders := make(http.Header)
  42107. for k, v := range c.header_ {
  42108. reqHeaders[k] = v
  42109. }
  42110. reqHeaders.Set("User-Agent", c.s.userAgent())
  42111. if c.ifNoneMatch_ != "" {
  42112. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42113. }
  42114. var body io.Reader = nil
  42115. c.urlParams_.Set("alt", alt)
  42116. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetableRemarketingLists")
  42117. urls += "?" + c.urlParams_.Encode()
  42118. req, _ := http.NewRequest("GET", urls, body)
  42119. req.Header = reqHeaders
  42120. googleapi.Expand(req.URL, map[string]string{
  42121. "profileId": strconv.FormatInt(c.profileId, 10),
  42122. })
  42123. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42124. }
  42125. // Do executes the "dfareporting.targetableRemarketingLists.list" call.
  42126. // Exactly one of *TargetableRemarketingListsListResponse or error will
  42127. // be non-nil. Any non-2xx status code is an error. Response headers are
  42128. // in either
  42129. // *TargetableRemarketingListsListResponse.ServerResponse.Header or (if
  42130. // a response was returned at all) in error.(*googleapi.Error).Header.
  42131. // Use googleapi.IsNotModified to check whether the returned error was
  42132. // because http.StatusNotModified was returned.
  42133. func (c *TargetableRemarketingListsListCall) Do(opts ...googleapi.CallOption) (*TargetableRemarketingListsListResponse, error) {
  42134. gensupport.SetOptions(c.urlParams_, opts...)
  42135. res, err := c.doRequest("json")
  42136. if res != nil && res.StatusCode == http.StatusNotModified {
  42137. if res.Body != nil {
  42138. res.Body.Close()
  42139. }
  42140. return nil, &googleapi.Error{
  42141. Code: res.StatusCode,
  42142. Header: res.Header,
  42143. }
  42144. }
  42145. if err != nil {
  42146. return nil, err
  42147. }
  42148. defer googleapi.CloseBody(res)
  42149. if err := googleapi.CheckResponse(res); err != nil {
  42150. return nil, err
  42151. }
  42152. ret := &TargetableRemarketingListsListResponse{
  42153. ServerResponse: googleapi.ServerResponse{
  42154. Header: res.Header,
  42155. HTTPStatusCode: res.StatusCode,
  42156. },
  42157. }
  42158. target := &ret
  42159. if err := gensupport.DecodeResponse(target, res); err != nil {
  42160. return nil, err
  42161. }
  42162. return ret, nil
  42163. // {
  42164. // "description": "Retrieves a list of targetable remarketing lists, possibly filtered. This method supports paging.",
  42165. // "httpMethod": "GET",
  42166. // "id": "dfareporting.targetableRemarketingLists.list",
  42167. // "parameterOrder": [
  42168. // "profileId",
  42169. // "advertiserId"
  42170. // ],
  42171. // "parameters": {
  42172. // "active": {
  42173. // "description": "Select only active or only inactive targetable remarketing lists.",
  42174. // "location": "query",
  42175. // "type": "boolean"
  42176. // },
  42177. // "advertiserId": {
  42178. // "description": "Select only targetable remarketing lists targetable by these advertisers.",
  42179. // "format": "int64",
  42180. // "location": "query",
  42181. // "required": true,
  42182. // "type": "string"
  42183. // },
  42184. // "maxResults": {
  42185. // "default": "1000",
  42186. // "description": "Maximum number of results to return.",
  42187. // "format": "int32",
  42188. // "location": "query",
  42189. // "maximum": "1000",
  42190. // "minimum": "0",
  42191. // "type": "integer"
  42192. // },
  42193. // "name": {
  42194. // "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\".",
  42195. // "location": "query",
  42196. // "type": "string"
  42197. // },
  42198. // "pageToken": {
  42199. // "description": "Value of the nextPageToken from the previous result page.",
  42200. // "location": "query",
  42201. // "type": "string"
  42202. // },
  42203. // "profileId": {
  42204. // "description": "User profile ID associated with this request.",
  42205. // "format": "int64",
  42206. // "location": "path",
  42207. // "required": true,
  42208. // "type": "string"
  42209. // },
  42210. // "sortField": {
  42211. // "default": "ID",
  42212. // "description": "Field by which to sort the list.",
  42213. // "enum": [
  42214. // "ID",
  42215. // "NAME"
  42216. // ],
  42217. // "enumDescriptions": [
  42218. // "",
  42219. // ""
  42220. // ],
  42221. // "location": "query",
  42222. // "type": "string"
  42223. // },
  42224. // "sortOrder": {
  42225. // "default": "ASCENDING",
  42226. // "description": "Order of sorted results.",
  42227. // "enum": [
  42228. // "ASCENDING",
  42229. // "DESCENDING"
  42230. // ],
  42231. // "enumDescriptions": [
  42232. // "",
  42233. // ""
  42234. // ],
  42235. // "location": "query",
  42236. // "type": "string"
  42237. // }
  42238. // },
  42239. // "path": "userprofiles/{profileId}/targetableRemarketingLists",
  42240. // "response": {
  42241. // "$ref": "TargetableRemarketingListsListResponse"
  42242. // },
  42243. // "scopes": [
  42244. // "https://www.googleapis.com/auth/dfatrafficking"
  42245. // ]
  42246. // }
  42247. }
  42248. // Pages invokes f for each page of results.
  42249. // A non-nil error returned from f will halt the iteration.
  42250. // The provided context supersedes any context provided to the Context method.
  42251. func (c *TargetableRemarketingListsListCall) Pages(ctx context.Context, f func(*TargetableRemarketingListsListResponse) error) error {
  42252. c.ctx_ = ctx
  42253. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42254. for {
  42255. x, err := c.Do()
  42256. if err != nil {
  42257. return err
  42258. }
  42259. if err := f(x); err != nil {
  42260. return err
  42261. }
  42262. if x.NextPageToken == "" {
  42263. return nil
  42264. }
  42265. c.PageToken(x.NextPageToken)
  42266. }
  42267. }
  42268. // method id "dfareporting.targetingTemplates.get":
  42269. type TargetingTemplatesGetCall struct {
  42270. s *Service
  42271. profileId int64
  42272. id int64
  42273. urlParams_ gensupport.URLParams
  42274. ifNoneMatch_ string
  42275. ctx_ context.Context
  42276. header_ http.Header
  42277. }
  42278. // Get: Gets one targeting template by ID.
  42279. func (r *TargetingTemplatesService) Get(profileId int64, id int64) *TargetingTemplatesGetCall {
  42280. c := &TargetingTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42281. c.profileId = profileId
  42282. c.id = id
  42283. return c
  42284. }
  42285. // Fields allows partial responses to be retrieved. See
  42286. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42287. // for more information.
  42288. func (c *TargetingTemplatesGetCall) Fields(s ...googleapi.Field) *TargetingTemplatesGetCall {
  42289. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42290. return c
  42291. }
  42292. // IfNoneMatch sets the optional parameter which makes the operation
  42293. // fail if the object's ETag matches the given value. This is useful for
  42294. // getting updates only after the object has changed since the last
  42295. // request. Use googleapi.IsNotModified to check whether the response
  42296. // error from Do is the result of In-None-Match.
  42297. func (c *TargetingTemplatesGetCall) IfNoneMatch(entityTag string) *TargetingTemplatesGetCall {
  42298. c.ifNoneMatch_ = entityTag
  42299. return c
  42300. }
  42301. // Context sets the context to be used in this call's Do method. Any
  42302. // pending HTTP request will be aborted if the provided context is
  42303. // canceled.
  42304. func (c *TargetingTemplatesGetCall) Context(ctx context.Context) *TargetingTemplatesGetCall {
  42305. c.ctx_ = ctx
  42306. return c
  42307. }
  42308. // Header returns an http.Header that can be modified by the caller to
  42309. // add HTTP headers to the request.
  42310. func (c *TargetingTemplatesGetCall) Header() http.Header {
  42311. if c.header_ == nil {
  42312. c.header_ = make(http.Header)
  42313. }
  42314. return c.header_
  42315. }
  42316. func (c *TargetingTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  42317. reqHeaders := make(http.Header)
  42318. for k, v := range c.header_ {
  42319. reqHeaders[k] = v
  42320. }
  42321. reqHeaders.Set("User-Agent", c.s.userAgent())
  42322. if c.ifNoneMatch_ != "" {
  42323. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42324. }
  42325. var body io.Reader = nil
  42326. c.urlParams_.Set("alt", alt)
  42327. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates/{id}")
  42328. urls += "?" + c.urlParams_.Encode()
  42329. req, _ := http.NewRequest("GET", urls, body)
  42330. req.Header = reqHeaders
  42331. googleapi.Expand(req.URL, map[string]string{
  42332. "profileId": strconv.FormatInt(c.profileId, 10),
  42333. "id": strconv.FormatInt(c.id, 10),
  42334. })
  42335. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42336. }
  42337. // Do executes the "dfareporting.targetingTemplates.get" call.
  42338. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  42339. // non-2xx status code is an error. Response headers are in either
  42340. // *TargetingTemplate.ServerResponse.Header or (if a response was
  42341. // returned at all) in error.(*googleapi.Error).Header. Use
  42342. // googleapi.IsNotModified to check whether the returned error was
  42343. // because http.StatusNotModified was returned.
  42344. func (c *TargetingTemplatesGetCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  42345. gensupport.SetOptions(c.urlParams_, opts...)
  42346. res, err := c.doRequest("json")
  42347. if res != nil && res.StatusCode == http.StatusNotModified {
  42348. if res.Body != nil {
  42349. res.Body.Close()
  42350. }
  42351. return nil, &googleapi.Error{
  42352. Code: res.StatusCode,
  42353. Header: res.Header,
  42354. }
  42355. }
  42356. if err != nil {
  42357. return nil, err
  42358. }
  42359. defer googleapi.CloseBody(res)
  42360. if err := googleapi.CheckResponse(res); err != nil {
  42361. return nil, err
  42362. }
  42363. ret := &TargetingTemplate{
  42364. ServerResponse: googleapi.ServerResponse{
  42365. Header: res.Header,
  42366. HTTPStatusCode: res.StatusCode,
  42367. },
  42368. }
  42369. target := &ret
  42370. if err := gensupport.DecodeResponse(target, res); err != nil {
  42371. return nil, err
  42372. }
  42373. return ret, nil
  42374. // {
  42375. // "description": "Gets one targeting template by ID.",
  42376. // "httpMethod": "GET",
  42377. // "id": "dfareporting.targetingTemplates.get",
  42378. // "parameterOrder": [
  42379. // "profileId",
  42380. // "id"
  42381. // ],
  42382. // "parameters": {
  42383. // "id": {
  42384. // "description": "Targeting template ID.",
  42385. // "format": "int64",
  42386. // "location": "path",
  42387. // "required": true,
  42388. // "type": "string"
  42389. // },
  42390. // "profileId": {
  42391. // "description": "User profile ID associated with this request.",
  42392. // "format": "int64",
  42393. // "location": "path",
  42394. // "required": true,
  42395. // "type": "string"
  42396. // }
  42397. // },
  42398. // "path": "userprofiles/{profileId}/targetingTemplates/{id}",
  42399. // "response": {
  42400. // "$ref": "TargetingTemplate"
  42401. // },
  42402. // "scopes": [
  42403. // "https://www.googleapis.com/auth/dfatrafficking"
  42404. // ]
  42405. // }
  42406. }
  42407. // method id "dfareporting.targetingTemplates.insert":
  42408. type TargetingTemplatesInsertCall struct {
  42409. s *Service
  42410. profileId int64
  42411. targetingtemplate *TargetingTemplate
  42412. urlParams_ gensupport.URLParams
  42413. ctx_ context.Context
  42414. header_ http.Header
  42415. }
  42416. // Insert: Inserts a new targeting template.
  42417. func (r *TargetingTemplatesService) Insert(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesInsertCall {
  42418. c := &TargetingTemplatesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42419. c.profileId = profileId
  42420. c.targetingtemplate = targetingtemplate
  42421. return c
  42422. }
  42423. // Fields allows partial responses to be retrieved. See
  42424. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42425. // for more information.
  42426. func (c *TargetingTemplatesInsertCall) Fields(s ...googleapi.Field) *TargetingTemplatesInsertCall {
  42427. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42428. return c
  42429. }
  42430. // Context sets the context to be used in this call's Do method. Any
  42431. // pending HTTP request will be aborted if the provided context is
  42432. // canceled.
  42433. func (c *TargetingTemplatesInsertCall) Context(ctx context.Context) *TargetingTemplatesInsertCall {
  42434. c.ctx_ = ctx
  42435. return c
  42436. }
  42437. // Header returns an http.Header that can be modified by the caller to
  42438. // add HTTP headers to the request.
  42439. func (c *TargetingTemplatesInsertCall) Header() http.Header {
  42440. if c.header_ == nil {
  42441. c.header_ = make(http.Header)
  42442. }
  42443. return c.header_
  42444. }
  42445. func (c *TargetingTemplatesInsertCall) doRequest(alt string) (*http.Response, error) {
  42446. reqHeaders := make(http.Header)
  42447. for k, v := range c.header_ {
  42448. reqHeaders[k] = v
  42449. }
  42450. reqHeaders.Set("User-Agent", c.s.userAgent())
  42451. var body io.Reader = nil
  42452. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  42453. if err != nil {
  42454. return nil, err
  42455. }
  42456. reqHeaders.Set("Content-Type", "application/json")
  42457. c.urlParams_.Set("alt", alt)
  42458. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  42459. urls += "?" + c.urlParams_.Encode()
  42460. req, _ := http.NewRequest("POST", urls, body)
  42461. req.Header = reqHeaders
  42462. googleapi.Expand(req.URL, map[string]string{
  42463. "profileId": strconv.FormatInt(c.profileId, 10),
  42464. })
  42465. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42466. }
  42467. // Do executes the "dfareporting.targetingTemplates.insert" call.
  42468. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  42469. // non-2xx status code is an error. Response headers are in either
  42470. // *TargetingTemplate.ServerResponse.Header or (if a response was
  42471. // returned at all) in error.(*googleapi.Error).Header. Use
  42472. // googleapi.IsNotModified to check whether the returned error was
  42473. // because http.StatusNotModified was returned.
  42474. func (c *TargetingTemplatesInsertCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  42475. gensupport.SetOptions(c.urlParams_, opts...)
  42476. res, err := c.doRequest("json")
  42477. if res != nil && res.StatusCode == http.StatusNotModified {
  42478. if res.Body != nil {
  42479. res.Body.Close()
  42480. }
  42481. return nil, &googleapi.Error{
  42482. Code: res.StatusCode,
  42483. Header: res.Header,
  42484. }
  42485. }
  42486. if err != nil {
  42487. return nil, err
  42488. }
  42489. defer googleapi.CloseBody(res)
  42490. if err := googleapi.CheckResponse(res); err != nil {
  42491. return nil, err
  42492. }
  42493. ret := &TargetingTemplate{
  42494. ServerResponse: googleapi.ServerResponse{
  42495. Header: res.Header,
  42496. HTTPStatusCode: res.StatusCode,
  42497. },
  42498. }
  42499. target := &ret
  42500. if err := gensupport.DecodeResponse(target, res); err != nil {
  42501. return nil, err
  42502. }
  42503. return ret, nil
  42504. // {
  42505. // "description": "Inserts a new targeting template.",
  42506. // "httpMethod": "POST",
  42507. // "id": "dfareporting.targetingTemplates.insert",
  42508. // "parameterOrder": [
  42509. // "profileId"
  42510. // ],
  42511. // "parameters": {
  42512. // "profileId": {
  42513. // "description": "User profile ID associated with this request.",
  42514. // "format": "int64",
  42515. // "location": "path",
  42516. // "required": true,
  42517. // "type": "string"
  42518. // }
  42519. // },
  42520. // "path": "userprofiles/{profileId}/targetingTemplates",
  42521. // "request": {
  42522. // "$ref": "TargetingTemplate"
  42523. // },
  42524. // "response": {
  42525. // "$ref": "TargetingTemplate"
  42526. // },
  42527. // "scopes": [
  42528. // "https://www.googleapis.com/auth/dfatrafficking"
  42529. // ]
  42530. // }
  42531. }
  42532. // method id "dfareporting.targetingTemplates.list":
  42533. type TargetingTemplatesListCall struct {
  42534. s *Service
  42535. profileId int64
  42536. urlParams_ gensupport.URLParams
  42537. ifNoneMatch_ string
  42538. ctx_ context.Context
  42539. header_ http.Header
  42540. }
  42541. // List: Retrieves a list of targeting templates, optionally filtered.
  42542. // This method supports paging.
  42543. func (r *TargetingTemplatesService) List(profileId int64) *TargetingTemplatesListCall {
  42544. c := &TargetingTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42545. c.profileId = profileId
  42546. return c
  42547. }
  42548. // AdvertiserId sets the optional parameter "advertiserId": Select only
  42549. // targeting templates with this advertiser ID.
  42550. func (c *TargetingTemplatesListCall) AdvertiserId(advertiserId int64) *TargetingTemplatesListCall {
  42551. c.urlParams_.Set("advertiserId", fmt.Sprint(advertiserId))
  42552. return c
  42553. }
  42554. // Ids sets the optional parameter "ids": Select only targeting
  42555. // templates with these IDs.
  42556. func (c *TargetingTemplatesListCall) Ids(ids ...int64) *TargetingTemplatesListCall {
  42557. var ids_ []string
  42558. for _, v := range ids {
  42559. ids_ = append(ids_, fmt.Sprint(v))
  42560. }
  42561. c.urlParams_.SetMulti("ids", ids_)
  42562. return c
  42563. }
  42564. // MaxResults sets the optional parameter "maxResults": Maximum number
  42565. // of results to return.
  42566. func (c *TargetingTemplatesListCall) MaxResults(maxResults int64) *TargetingTemplatesListCall {
  42567. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  42568. return c
  42569. }
  42570. // PageToken sets the optional parameter "pageToken": Value of the
  42571. // nextPageToken from the previous result page.
  42572. func (c *TargetingTemplatesListCall) PageToken(pageToken string) *TargetingTemplatesListCall {
  42573. c.urlParams_.Set("pageToken", pageToken)
  42574. return c
  42575. }
  42576. // SearchString sets the optional parameter "searchString": Allows
  42577. // searching for objects by name or ID. Wildcards (*) are allowed. For
  42578. // example, "template*2015" will return objects with names like
  42579. // "template June 2015", "template April 2015", or simply "template
  42580. // 2015". Most of the searches also add wildcards implicitly at the
  42581. // start and the end of the search string. For example, a search string
  42582. // of "template" will match objects with name "my template", "template
  42583. // 2015", or simply "template".
  42584. func (c *TargetingTemplatesListCall) SearchString(searchString string) *TargetingTemplatesListCall {
  42585. c.urlParams_.Set("searchString", searchString)
  42586. return c
  42587. }
  42588. // SortField sets the optional parameter "sortField": Field by which to
  42589. // sort the list.
  42590. //
  42591. // Possible values:
  42592. // "ID" (default)
  42593. // "NAME"
  42594. func (c *TargetingTemplatesListCall) SortField(sortField string) *TargetingTemplatesListCall {
  42595. c.urlParams_.Set("sortField", sortField)
  42596. return c
  42597. }
  42598. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  42599. // results.
  42600. //
  42601. // Possible values:
  42602. // "ASCENDING" (default)
  42603. // "DESCENDING"
  42604. func (c *TargetingTemplatesListCall) SortOrder(sortOrder string) *TargetingTemplatesListCall {
  42605. c.urlParams_.Set("sortOrder", sortOrder)
  42606. return c
  42607. }
  42608. // Fields allows partial responses to be retrieved. See
  42609. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42610. // for more information.
  42611. func (c *TargetingTemplatesListCall) Fields(s ...googleapi.Field) *TargetingTemplatesListCall {
  42612. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42613. return c
  42614. }
  42615. // IfNoneMatch sets the optional parameter which makes the operation
  42616. // fail if the object's ETag matches the given value. This is useful for
  42617. // getting updates only after the object has changed since the last
  42618. // request. Use googleapi.IsNotModified to check whether the response
  42619. // error from Do is the result of In-None-Match.
  42620. func (c *TargetingTemplatesListCall) IfNoneMatch(entityTag string) *TargetingTemplatesListCall {
  42621. c.ifNoneMatch_ = entityTag
  42622. return c
  42623. }
  42624. // Context sets the context to be used in this call's Do method. Any
  42625. // pending HTTP request will be aborted if the provided context is
  42626. // canceled.
  42627. func (c *TargetingTemplatesListCall) Context(ctx context.Context) *TargetingTemplatesListCall {
  42628. c.ctx_ = ctx
  42629. return c
  42630. }
  42631. // Header returns an http.Header that can be modified by the caller to
  42632. // add HTTP headers to the request.
  42633. func (c *TargetingTemplatesListCall) Header() http.Header {
  42634. if c.header_ == nil {
  42635. c.header_ = make(http.Header)
  42636. }
  42637. return c.header_
  42638. }
  42639. func (c *TargetingTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  42640. reqHeaders := make(http.Header)
  42641. for k, v := range c.header_ {
  42642. reqHeaders[k] = v
  42643. }
  42644. reqHeaders.Set("User-Agent", c.s.userAgent())
  42645. if c.ifNoneMatch_ != "" {
  42646. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  42647. }
  42648. var body io.Reader = nil
  42649. c.urlParams_.Set("alt", alt)
  42650. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  42651. urls += "?" + c.urlParams_.Encode()
  42652. req, _ := http.NewRequest("GET", urls, body)
  42653. req.Header = reqHeaders
  42654. googleapi.Expand(req.URL, map[string]string{
  42655. "profileId": strconv.FormatInt(c.profileId, 10),
  42656. })
  42657. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42658. }
  42659. // Do executes the "dfareporting.targetingTemplates.list" call.
  42660. // Exactly one of *TargetingTemplatesListResponse or error will be
  42661. // non-nil. Any non-2xx status code is an error. Response headers are in
  42662. // either *TargetingTemplatesListResponse.ServerResponse.Header or (if a
  42663. // response was returned at all) in error.(*googleapi.Error).Header. Use
  42664. // googleapi.IsNotModified to check whether the returned error was
  42665. // because http.StatusNotModified was returned.
  42666. func (c *TargetingTemplatesListCall) Do(opts ...googleapi.CallOption) (*TargetingTemplatesListResponse, error) {
  42667. gensupport.SetOptions(c.urlParams_, opts...)
  42668. res, err := c.doRequest("json")
  42669. if res != nil && res.StatusCode == http.StatusNotModified {
  42670. if res.Body != nil {
  42671. res.Body.Close()
  42672. }
  42673. return nil, &googleapi.Error{
  42674. Code: res.StatusCode,
  42675. Header: res.Header,
  42676. }
  42677. }
  42678. if err != nil {
  42679. return nil, err
  42680. }
  42681. defer googleapi.CloseBody(res)
  42682. if err := googleapi.CheckResponse(res); err != nil {
  42683. return nil, err
  42684. }
  42685. ret := &TargetingTemplatesListResponse{
  42686. ServerResponse: googleapi.ServerResponse{
  42687. Header: res.Header,
  42688. HTTPStatusCode: res.StatusCode,
  42689. },
  42690. }
  42691. target := &ret
  42692. if err := gensupport.DecodeResponse(target, res); err != nil {
  42693. return nil, err
  42694. }
  42695. return ret, nil
  42696. // {
  42697. // "description": "Retrieves a list of targeting templates, optionally filtered. This method supports paging.",
  42698. // "httpMethod": "GET",
  42699. // "id": "dfareporting.targetingTemplates.list",
  42700. // "parameterOrder": [
  42701. // "profileId"
  42702. // ],
  42703. // "parameters": {
  42704. // "advertiserId": {
  42705. // "description": "Select only targeting templates with this advertiser ID.",
  42706. // "format": "int64",
  42707. // "location": "query",
  42708. // "type": "string"
  42709. // },
  42710. // "ids": {
  42711. // "description": "Select only targeting templates with these IDs.",
  42712. // "format": "int64",
  42713. // "location": "query",
  42714. // "repeated": true,
  42715. // "type": "string"
  42716. // },
  42717. // "maxResults": {
  42718. // "default": "1000",
  42719. // "description": "Maximum number of results to return.",
  42720. // "format": "int32",
  42721. // "location": "query",
  42722. // "maximum": "1000",
  42723. // "minimum": "0",
  42724. // "type": "integer"
  42725. // },
  42726. // "pageToken": {
  42727. // "description": "Value of the nextPageToken from the previous result page.",
  42728. // "location": "query",
  42729. // "type": "string"
  42730. // },
  42731. // "profileId": {
  42732. // "description": "User profile ID associated with this request.",
  42733. // "format": "int64",
  42734. // "location": "path",
  42735. // "required": true,
  42736. // "type": "string"
  42737. // },
  42738. // "searchString": {
  42739. // "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\".",
  42740. // "location": "query",
  42741. // "type": "string"
  42742. // },
  42743. // "sortField": {
  42744. // "default": "ID",
  42745. // "description": "Field by which to sort the list.",
  42746. // "enum": [
  42747. // "ID",
  42748. // "NAME"
  42749. // ],
  42750. // "enumDescriptions": [
  42751. // "",
  42752. // ""
  42753. // ],
  42754. // "location": "query",
  42755. // "type": "string"
  42756. // },
  42757. // "sortOrder": {
  42758. // "default": "ASCENDING",
  42759. // "description": "Order of sorted results.",
  42760. // "enum": [
  42761. // "ASCENDING",
  42762. // "DESCENDING"
  42763. // ],
  42764. // "enumDescriptions": [
  42765. // "",
  42766. // ""
  42767. // ],
  42768. // "location": "query",
  42769. // "type": "string"
  42770. // }
  42771. // },
  42772. // "path": "userprofiles/{profileId}/targetingTemplates",
  42773. // "response": {
  42774. // "$ref": "TargetingTemplatesListResponse"
  42775. // },
  42776. // "scopes": [
  42777. // "https://www.googleapis.com/auth/dfatrafficking"
  42778. // ]
  42779. // }
  42780. }
  42781. // Pages invokes f for each page of results.
  42782. // A non-nil error returned from f will halt the iteration.
  42783. // The provided context supersedes any context provided to the Context method.
  42784. func (c *TargetingTemplatesListCall) Pages(ctx context.Context, f func(*TargetingTemplatesListResponse) error) error {
  42785. c.ctx_ = ctx
  42786. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  42787. for {
  42788. x, err := c.Do()
  42789. if err != nil {
  42790. return err
  42791. }
  42792. if err := f(x); err != nil {
  42793. return err
  42794. }
  42795. if x.NextPageToken == "" {
  42796. return nil
  42797. }
  42798. c.PageToken(x.NextPageToken)
  42799. }
  42800. }
  42801. // method id "dfareporting.targetingTemplates.patch":
  42802. type TargetingTemplatesPatchCall struct {
  42803. s *Service
  42804. profileId int64
  42805. targetingtemplate *TargetingTemplate
  42806. urlParams_ gensupport.URLParams
  42807. ctx_ context.Context
  42808. header_ http.Header
  42809. }
  42810. // Patch: Updates an existing targeting template. This method supports
  42811. // patch semantics.
  42812. func (r *TargetingTemplatesService) Patch(profileId int64, id int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesPatchCall {
  42813. c := &TargetingTemplatesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42814. c.profileId = profileId
  42815. c.urlParams_.Set("id", fmt.Sprint(id))
  42816. c.targetingtemplate = targetingtemplate
  42817. return c
  42818. }
  42819. // Fields allows partial responses to be retrieved. See
  42820. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42821. // for more information.
  42822. func (c *TargetingTemplatesPatchCall) Fields(s ...googleapi.Field) *TargetingTemplatesPatchCall {
  42823. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42824. return c
  42825. }
  42826. // Context sets the context to be used in this call's Do method. Any
  42827. // pending HTTP request will be aborted if the provided context is
  42828. // canceled.
  42829. func (c *TargetingTemplatesPatchCall) Context(ctx context.Context) *TargetingTemplatesPatchCall {
  42830. c.ctx_ = ctx
  42831. return c
  42832. }
  42833. // Header returns an http.Header that can be modified by the caller to
  42834. // add HTTP headers to the request.
  42835. func (c *TargetingTemplatesPatchCall) Header() http.Header {
  42836. if c.header_ == nil {
  42837. c.header_ = make(http.Header)
  42838. }
  42839. return c.header_
  42840. }
  42841. func (c *TargetingTemplatesPatchCall) doRequest(alt string) (*http.Response, error) {
  42842. reqHeaders := make(http.Header)
  42843. for k, v := range c.header_ {
  42844. reqHeaders[k] = v
  42845. }
  42846. reqHeaders.Set("User-Agent", c.s.userAgent())
  42847. var body io.Reader = nil
  42848. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  42849. if err != nil {
  42850. return nil, err
  42851. }
  42852. reqHeaders.Set("Content-Type", "application/json")
  42853. c.urlParams_.Set("alt", alt)
  42854. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  42855. urls += "?" + c.urlParams_.Encode()
  42856. req, _ := http.NewRequest("PATCH", urls, body)
  42857. req.Header = reqHeaders
  42858. googleapi.Expand(req.URL, map[string]string{
  42859. "profileId": strconv.FormatInt(c.profileId, 10),
  42860. })
  42861. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42862. }
  42863. // Do executes the "dfareporting.targetingTemplates.patch" call.
  42864. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  42865. // non-2xx status code is an error. Response headers are in either
  42866. // *TargetingTemplate.ServerResponse.Header or (if a response was
  42867. // returned at all) in error.(*googleapi.Error).Header. Use
  42868. // googleapi.IsNotModified to check whether the returned error was
  42869. // because http.StatusNotModified was returned.
  42870. func (c *TargetingTemplatesPatchCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  42871. gensupport.SetOptions(c.urlParams_, opts...)
  42872. res, err := c.doRequest("json")
  42873. if res != nil && res.StatusCode == http.StatusNotModified {
  42874. if res.Body != nil {
  42875. res.Body.Close()
  42876. }
  42877. return nil, &googleapi.Error{
  42878. Code: res.StatusCode,
  42879. Header: res.Header,
  42880. }
  42881. }
  42882. if err != nil {
  42883. return nil, err
  42884. }
  42885. defer googleapi.CloseBody(res)
  42886. if err := googleapi.CheckResponse(res); err != nil {
  42887. return nil, err
  42888. }
  42889. ret := &TargetingTemplate{
  42890. ServerResponse: googleapi.ServerResponse{
  42891. Header: res.Header,
  42892. HTTPStatusCode: res.StatusCode,
  42893. },
  42894. }
  42895. target := &ret
  42896. if err := gensupport.DecodeResponse(target, res); err != nil {
  42897. return nil, err
  42898. }
  42899. return ret, nil
  42900. // {
  42901. // "description": "Updates an existing targeting template. This method supports patch semantics.",
  42902. // "httpMethod": "PATCH",
  42903. // "id": "dfareporting.targetingTemplates.patch",
  42904. // "parameterOrder": [
  42905. // "profileId",
  42906. // "id"
  42907. // ],
  42908. // "parameters": {
  42909. // "id": {
  42910. // "description": "Targeting template ID.",
  42911. // "format": "int64",
  42912. // "location": "query",
  42913. // "required": true,
  42914. // "type": "string"
  42915. // },
  42916. // "profileId": {
  42917. // "description": "User profile ID associated with this request.",
  42918. // "format": "int64",
  42919. // "location": "path",
  42920. // "required": true,
  42921. // "type": "string"
  42922. // }
  42923. // },
  42924. // "path": "userprofiles/{profileId}/targetingTemplates",
  42925. // "request": {
  42926. // "$ref": "TargetingTemplate"
  42927. // },
  42928. // "response": {
  42929. // "$ref": "TargetingTemplate"
  42930. // },
  42931. // "scopes": [
  42932. // "https://www.googleapis.com/auth/dfatrafficking"
  42933. // ]
  42934. // }
  42935. }
  42936. // method id "dfareporting.targetingTemplates.update":
  42937. type TargetingTemplatesUpdateCall struct {
  42938. s *Service
  42939. profileId int64
  42940. targetingtemplate *TargetingTemplate
  42941. urlParams_ gensupport.URLParams
  42942. ctx_ context.Context
  42943. header_ http.Header
  42944. }
  42945. // Update: Updates an existing targeting template.
  42946. func (r *TargetingTemplatesService) Update(profileId int64, targetingtemplate *TargetingTemplate) *TargetingTemplatesUpdateCall {
  42947. c := &TargetingTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  42948. c.profileId = profileId
  42949. c.targetingtemplate = targetingtemplate
  42950. return c
  42951. }
  42952. // Fields allows partial responses to be retrieved. See
  42953. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  42954. // for more information.
  42955. func (c *TargetingTemplatesUpdateCall) Fields(s ...googleapi.Field) *TargetingTemplatesUpdateCall {
  42956. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  42957. return c
  42958. }
  42959. // Context sets the context to be used in this call's Do method. Any
  42960. // pending HTTP request will be aborted if the provided context is
  42961. // canceled.
  42962. func (c *TargetingTemplatesUpdateCall) Context(ctx context.Context) *TargetingTemplatesUpdateCall {
  42963. c.ctx_ = ctx
  42964. return c
  42965. }
  42966. // Header returns an http.Header that can be modified by the caller to
  42967. // add HTTP headers to the request.
  42968. func (c *TargetingTemplatesUpdateCall) Header() http.Header {
  42969. if c.header_ == nil {
  42970. c.header_ = make(http.Header)
  42971. }
  42972. return c.header_
  42973. }
  42974. func (c *TargetingTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  42975. reqHeaders := make(http.Header)
  42976. for k, v := range c.header_ {
  42977. reqHeaders[k] = v
  42978. }
  42979. reqHeaders.Set("User-Agent", c.s.userAgent())
  42980. var body io.Reader = nil
  42981. body, err := googleapi.WithoutDataWrapper.JSONReader(c.targetingtemplate)
  42982. if err != nil {
  42983. return nil, err
  42984. }
  42985. reqHeaders.Set("Content-Type", "application/json")
  42986. c.urlParams_.Set("alt", alt)
  42987. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/targetingTemplates")
  42988. urls += "?" + c.urlParams_.Encode()
  42989. req, _ := http.NewRequest("PUT", urls, body)
  42990. req.Header = reqHeaders
  42991. googleapi.Expand(req.URL, map[string]string{
  42992. "profileId": strconv.FormatInt(c.profileId, 10),
  42993. })
  42994. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  42995. }
  42996. // Do executes the "dfareporting.targetingTemplates.update" call.
  42997. // Exactly one of *TargetingTemplate or error will be non-nil. Any
  42998. // non-2xx status code is an error. Response headers are in either
  42999. // *TargetingTemplate.ServerResponse.Header or (if a response was
  43000. // returned at all) in error.(*googleapi.Error).Header. Use
  43001. // googleapi.IsNotModified to check whether the returned error was
  43002. // because http.StatusNotModified was returned.
  43003. func (c *TargetingTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*TargetingTemplate, error) {
  43004. gensupport.SetOptions(c.urlParams_, opts...)
  43005. res, err := c.doRequest("json")
  43006. if res != nil && res.StatusCode == http.StatusNotModified {
  43007. if res.Body != nil {
  43008. res.Body.Close()
  43009. }
  43010. return nil, &googleapi.Error{
  43011. Code: res.StatusCode,
  43012. Header: res.Header,
  43013. }
  43014. }
  43015. if err != nil {
  43016. return nil, err
  43017. }
  43018. defer googleapi.CloseBody(res)
  43019. if err := googleapi.CheckResponse(res); err != nil {
  43020. return nil, err
  43021. }
  43022. ret := &TargetingTemplate{
  43023. ServerResponse: googleapi.ServerResponse{
  43024. Header: res.Header,
  43025. HTTPStatusCode: res.StatusCode,
  43026. },
  43027. }
  43028. target := &ret
  43029. if err := gensupport.DecodeResponse(target, res); err != nil {
  43030. return nil, err
  43031. }
  43032. return ret, nil
  43033. // {
  43034. // "description": "Updates an existing targeting template.",
  43035. // "httpMethod": "PUT",
  43036. // "id": "dfareporting.targetingTemplates.update",
  43037. // "parameterOrder": [
  43038. // "profileId"
  43039. // ],
  43040. // "parameters": {
  43041. // "profileId": {
  43042. // "description": "User profile ID associated with this request.",
  43043. // "format": "int64",
  43044. // "location": "path",
  43045. // "required": true,
  43046. // "type": "string"
  43047. // }
  43048. // },
  43049. // "path": "userprofiles/{profileId}/targetingTemplates",
  43050. // "request": {
  43051. // "$ref": "TargetingTemplate"
  43052. // },
  43053. // "response": {
  43054. // "$ref": "TargetingTemplate"
  43055. // },
  43056. // "scopes": [
  43057. // "https://www.googleapis.com/auth/dfatrafficking"
  43058. // ]
  43059. // }
  43060. }
  43061. // method id "dfareporting.userProfiles.get":
  43062. type UserProfilesGetCall struct {
  43063. s *Service
  43064. profileId int64
  43065. urlParams_ gensupport.URLParams
  43066. ifNoneMatch_ string
  43067. ctx_ context.Context
  43068. header_ http.Header
  43069. }
  43070. // Get: Gets one user profile by ID.
  43071. func (r *UserProfilesService) Get(profileId int64) *UserProfilesGetCall {
  43072. c := &UserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43073. c.profileId = profileId
  43074. return c
  43075. }
  43076. // Fields allows partial responses to be retrieved. See
  43077. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43078. // for more information.
  43079. func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
  43080. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43081. return c
  43082. }
  43083. // IfNoneMatch sets the optional parameter which makes the operation
  43084. // fail if the object's ETag matches the given value. This is useful for
  43085. // getting updates only after the object has changed since the last
  43086. // request. Use googleapi.IsNotModified to check whether the response
  43087. // error from Do is the result of In-None-Match.
  43088. func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
  43089. c.ifNoneMatch_ = entityTag
  43090. return c
  43091. }
  43092. // Context sets the context to be used in this call's Do method. Any
  43093. // pending HTTP request will be aborted if the provided context is
  43094. // canceled.
  43095. func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
  43096. c.ctx_ = ctx
  43097. return c
  43098. }
  43099. // Header returns an http.Header that can be modified by the caller to
  43100. // add HTTP headers to the request.
  43101. func (c *UserProfilesGetCall) Header() http.Header {
  43102. if c.header_ == nil {
  43103. c.header_ = make(http.Header)
  43104. }
  43105. return c.header_
  43106. }
  43107. func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  43108. reqHeaders := make(http.Header)
  43109. for k, v := range c.header_ {
  43110. reqHeaders[k] = v
  43111. }
  43112. reqHeaders.Set("User-Agent", c.s.userAgent())
  43113. if c.ifNoneMatch_ != "" {
  43114. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43115. }
  43116. var body io.Reader = nil
  43117. c.urlParams_.Set("alt", alt)
  43118. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}")
  43119. urls += "?" + c.urlParams_.Encode()
  43120. req, _ := http.NewRequest("GET", urls, body)
  43121. req.Header = reqHeaders
  43122. googleapi.Expand(req.URL, map[string]string{
  43123. "profileId": strconv.FormatInt(c.profileId, 10),
  43124. })
  43125. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43126. }
  43127. // Do executes the "dfareporting.userProfiles.get" call.
  43128. // Exactly one of *UserProfile or error will be non-nil. Any non-2xx
  43129. // status code is an error. Response headers are in either
  43130. // *UserProfile.ServerResponse.Header or (if a response was returned at
  43131. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  43132. // to check whether the returned error was because
  43133. // http.StatusNotModified was returned.
  43134. func (c *UserProfilesGetCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
  43135. gensupport.SetOptions(c.urlParams_, opts...)
  43136. res, err := c.doRequest("json")
  43137. if res != nil && res.StatusCode == http.StatusNotModified {
  43138. if res.Body != nil {
  43139. res.Body.Close()
  43140. }
  43141. return nil, &googleapi.Error{
  43142. Code: res.StatusCode,
  43143. Header: res.Header,
  43144. }
  43145. }
  43146. if err != nil {
  43147. return nil, err
  43148. }
  43149. defer googleapi.CloseBody(res)
  43150. if err := googleapi.CheckResponse(res); err != nil {
  43151. return nil, err
  43152. }
  43153. ret := &UserProfile{
  43154. ServerResponse: googleapi.ServerResponse{
  43155. Header: res.Header,
  43156. HTTPStatusCode: res.StatusCode,
  43157. },
  43158. }
  43159. target := &ret
  43160. if err := gensupport.DecodeResponse(target, res); err != nil {
  43161. return nil, err
  43162. }
  43163. return ret, nil
  43164. // {
  43165. // "description": "Gets one user profile by ID.",
  43166. // "httpMethod": "GET",
  43167. // "id": "dfareporting.userProfiles.get",
  43168. // "parameterOrder": [
  43169. // "profileId"
  43170. // ],
  43171. // "parameters": {
  43172. // "profileId": {
  43173. // "description": "The user profile ID.",
  43174. // "format": "int64",
  43175. // "location": "path",
  43176. // "required": true,
  43177. // "type": "string"
  43178. // }
  43179. // },
  43180. // "path": "userprofiles/{profileId}",
  43181. // "response": {
  43182. // "$ref": "UserProfile"
  43183. // },
  43184. // "scopes": [
  43185. // "https://www.googleapis.com/auth/dfareporting",
  43186. // "https://www.googleapis.com/auth/dfatrafficking"
  43187. // ]
  43188. // }
  43189. }
  43190. // method id "dfareporting.userProfiles.list":
  43191. type UserProfilesListCall struct {
  43192. s *Service
  43193. urlParams_ gensupport.URLParams
  43194. ifNoneMatch_ string
  43195. ctx_ context.Context
  43196. header_ http.Header
  43197. }
  43198. // List: Retrieves list of user profiles for a user.
  43199. func (r *UserProfilesService) List() *UserProfilesListCall {
  43200. c := &UserProfilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43201. return c
  43202. }
  43203. // Fields allows partial responses to be retrieved. See
  43204. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43205. // for more information.
  43206. func (c *UserProfilesListCall) Fields(s ...googleapi.Field) *UserProfilesListCall {
  43207. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43208. return c
  43209. }
  43210. // IfNoneMatch sets the optional parameter which makes the operation
  43211. // fail if the object's ETag matches the given value. This is useful for
  43212. // getting updates only after the object has changed since the last
  43213. // request. Use googleapi.IsNotModified to check whether the response
  43214. // error from Do is the result of In-None-Match.
  43215. func (c *UserProfilesListCall) IfNoneMatch(entityTag string) *UserProfilesListCall {
  43216. c.ifNoneMatch_ = entityTag
  43217. return c
  43218. }
  43219. // Context sets the context to be used in this call's Do method. Any
  43220. // pending HTTP request will be aborted if the provided context is
  43221. // canceled.
  43222. func (c *UserProfilesListCall) Context(ctx context.Context) *UserProfilesListCall {
  43223. c.ctx_ = ctx
  43224. return c
  43225. }
  43226. // Header returns an http.Header that can be modified by the caller to
  43227. // add HTTP headers to the request.
  43228. func (c *UserProfilesListCall) Header() http.Header {
  43229. if c.header_ == nil {
  43230. c.header_ = make(http.Header)
  43231. }
  43232. return c.header_
  43233. }
  43234. func (c *UserProfilesListCall) doRequest(alt string) (*http.Response, error) {
  43235. reqHeaders := make(http.Header)
  43236. for k, v := range c.header_ {
  43237. reqHeaders[k] = v
  43238. }
  43239. reqHeaders.Set("User-Agent", c.s.userAgent())
  43240. if c.ifNoneMatch_ != "" {
  43241. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43242. }
  43243. var body io.Reader = nil
  43244. c.urlParams_.Set("alt", alt)
  43245. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles")
  43246. urls += "?" + c.urlParams_.Encode()
  43247. req, _ := http.NewRequest("GET", urls, body)
  43248. req.Header = reqHeaders
  43249. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43250. }
  43251. // Do executes the "dfareporting.userProfiles.list" call.
  43252. // Exactly one of *UserProfileList or error will be non-nil. Any non-2xx
  43253. // status code is an error. Response headers are in either
  43254. // *UserProfileList.ServerResponse.Header or (if a response was returned
  43255. // at all) in error.(*googleapi.Error).Header. Use
  43256. // googleapi.IsNotModified to check whether the returned error was
  43257. // because http.StatusNotModified was returned.
  43258. func (c *UserProfilesListCall) Do(opts ...googleapi.CallOption) (*UserProfileList, error) {
  43259. gensupport.SetOptions(c.urlParams_, opts...)
  43260. res, err := c.doRequest("json")
  43261. if res != nil && res.StatusCode == http.StatusNotModified {
  43262. if res.Body != nil {
  43263. res.Body.Close()
  43264. }
  43265. return nil, &googleapi.Error{
  43266. Code: res.StatusCode,
  43267. Header: res.Header,
  43268. }
  43269. }
  43270. if err != nil {
  43271. return nil, err
  43272. }
  43273. defer googleapi.CloseBody(res)
  43274. if err := googleapi.CheckResponse(res); err != nil {
  43275. return nil, err
  43276. }
  43277. ret := &UserProfileList{
  43278. ServerResponse: googleapi.ServerResponse{
  43279. Header: res.Header,
  43280. HTTPStatusCode: res.StatusCode,
  43281. },
  43282. }
  43283. target := &ret
  43284. if err := gensupport.DecodeResponse(target, res); err != nil {
  43285. return nil, err
  43286. }
  43287. return ret, nil
  43288. // {
  43289. // "description": "Retrieves list of user profiles for a user.",
  43290. // "httpMethod": "GET",
  43291. // "id": "dfareporting.userProfiles.list",
  43292. // "path": "userprofiles",
  43293. // "response": {
  43294. // "$ref": "UserProfileList"
  43295. // },
  43296. // "scopes": [
  43297. // "https://www.googleapis.com/auth/dfareporting",
  43298. // "https://www.googleapis.com/auth/dfatrafficking"
  43299. // ]
  43300. // }
  43301. }
  43302. // method id "dfareporting.userRolePermissionGroups.get":
  43303. type UserRolePermissionGroupsGetCall struct {
  43304. s *Service
  43305. profileId int64
  43306. id int64
  43307. urlParams_ gensupport.URLParams
  43308. ifNoneMatch_ string
  43309. ctx_ context.Context
  43310. header_ http.Header
  43311. }
  43312. // Get: Gets one user role permission group by ID.
  43313. func (r *UserRolePermissionGroupsService) Get(profileId int64, id int64) *UserRolePermissionGroupsGetCall {
  43314. c := &UserRolePermissionGroupsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43315. c.profileId = profileId
  43316. c.id = id
  43317. return c
  43318. }
  43319. // Fields allows partial responses to be retrieved. See
  43320. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43321. // for more information.
  43322. func (c *UserRolePermissionGroupsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsGetCall {
  43323. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43324. return c
  43325. }
  43326. // IfNoneMatch sets the optional parameter which makes the operation
  43327. // fail if the object's ETag matches the given value. This is useful for
  43328. // getting updates only after the object has changed since the last
  43329. // request. Use googleapi.IsNotModified to check whether the response
  43330. // error from Do is the result of In-None-Match.
  43331. func (c *UserRolePermissionGroupsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsGetCall {
  43332. c.ifNoneMatch_ = entityTag
  43333. return c
  43334. }
  43335. // Context sets the context to be used in this call's Do method. Any
  43336. // pending HTTP request will be aborted if the provided context is
  43337. // canceled.
  43338. func (c *UserRolePermissionGroupsGetCall) Context(ctx context.Context) *UserRolePermissionGroupsGetCall {
  43339. c.ctx_ = ctx
  43340. return c
  43341. }
  43342. // Header returns an http.Header that can be modified by the caller to
  43343. // add HTTP headers to the request.
  43344. func (c *UserRolePermissionGroupsGetCall) Header() http.Header {
  43345. if c.header_ == nil {
  43346. c.header_ = make(http.Header)
  43347. }
  43348. return c.header_
  43349. }
  43350. func (c *UserRolePermissionGroupsGetCall) doRequest(alt string) (*http.Response, error) {
  43351. reqHeaders := make(http.Header)
  43352. for k, v := range c.header_ {
  43353. reqHeaders[k] = v
  43354. }
  43355. reqHeaders.Set("User-Agent", c.s.userAgent())
  43356. if c.ifNoneMatch_ != "" {
  43357. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43358. }
  43359. var body io.Reader = nil
  43360. c.urlParams_.Set("alt", alt)
  43361. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups/{id}")
  43362. urls += "?" + c.urlParams_.Encode()
  43363. req, _ := http.NewRequest("GET", urls, body)
  43364. req.Header = reqHeaders
  43365. googleapi.Expand(req.URL, map[string]string{
  43366. "profileId": strconv.FormatInt(c.profileId, 10),
  43367. "id": strconv.FormatInt(c.id, 10),
  43368. })
  43369. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43370. }
  43371. // Do executes the "dfareporting.userRolePermissionGroups.get" call.
  43372. // Exactly one of *UserRolePermissionGroup or error will be non-nil. Any
  43373. // non-2xx status code is an error. Response headers are in either
  43374. // *UserRolePermissionGroup.ServerResponse.Header or (if a response was
  43375. // returned at all) in error.(*googleapi.Error).Header. Use
  43376. // googleapi.IsNotModified to check whether the returned error was
  43377. // because http.StatusNotModified was returned.
  43378. func (c *UserRolePermissionGroupsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroup, error) {
  43379. gensupport.SetOptions(c.urlParams_, opts...)
  43380. res, err := c.doRequest("json")
  43381. if res != nil && res.StatusCode == http.StatusNotModified {
  43382. if res.Body != nil {
  43383. res.Body.Close()
  43384. }
  43385. return nil, &googleapi.Error{
  43386. Code: res.StatusCode,
  43387. Header: res.Header,
  43388. }
  43389. }
  43390. if err != nil {
  43391. return nil, err
  43392. }
  43393. defer googleapi.CloseBody(res)
  43394. if err := googleapi.CheckResponse(res); err != nil {
  43395. return nil, err
  43396. }
  43397. ret := &UserRolePermissionGroup{
  43398. ServerResponse: googleapi.ServerResponse{
  43399. Header: res.Header,
  43400. HTTPStatusCode: res.StatusCode,
  43401. },
  43402. }
  43403. target := &ret
  43404. if err := gensupport.DecodeResponse(target, res); err != nil {
  43405. return nil, err
  43406. }
  43407. return ret, nil
  43408. // {
  43409. // "description": "Gets one user role permission group by ID.",
  43410. // "httpMethod": "GET",
  43411. // "id": "dfareporting.userRolePermissionGroups.get",
  43412. // "parameterOrder": [
  43413. // "profileId",
  43414. // "id"
  43415. // ],
  43416. // "parameters": {
  43417. // "id": {
  43418. // "description": "User role permission group ID.",
  43419. // "format": "int64",
  43420. // "location": "path",
  43421. // "required": true,
  43422. // "type": "string"
  43423. // },
  43424. // "profileId": {
  43425. // "description": "User profile ID associated with this request.",
  43426. // "format": "int64",
  43427. // "location": "path",
  43428. // "required": true,
  43429. // "type": "string"
  43430. // }
  43431. // },
  43432. // "path": "userprofiles/{profileId}/userRolePermissionGroups/{id}",
  43433. // "response": {
  43434. // "$ref": "UserRolePermissionGroup"
  43435. // },
  43436. // "scopes": [
  43437. // "https://www.googleapis.com/auth/dfatrafficking"
  43438. // ]
  43439. // }
  43440. }
  43441. // method id "dfareporting.userRolePermissionGroups.list":
  43442. type UserRolePermissionGroupsListCall struct {
  43443. s *Service
  43444. profileId int64
  43445. urlParams_ gensupport.URLParams
  43446. ifNoneMatch_ string
  43447. ctx_ context.Context
  43448. header_ http.Header
  43449. }
  43450. // List: Gets a list of all supported user role permission groups.
  43451. func (r *UserRolePermissionGroupsService) List(profileId int64) *UserRolePermissionGroupsListCall {
  43452. c := &UserRolePermissionGroupsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43453. c.profileId = profileId
  43454. return c
  43455. }
  43456. // Fields allows partial responses to be retrieved. See
  43457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43458. // for more information.
  43459. func (c *UserRolePermissionGroupsListCall) Fields(s ...googleapi.Field) *UserRolePermissionGroupsListCall {
  43460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43461. return c
  43462. }
  43463. // IfNoneMatch sets the optional parameter which makes the operation
  43464. // fail if the object's ETag matches the given value. This is useful for
  43465. // getting updates only after the object has changed since the last
  43466. // request. Use googleapi.IsNotModified to check whether the response
  43467. // error from Do is the result of In-None-Match.
  43468. func (c *UserRolePermissionGroupsListCall) IfNoneMatch(entityTag string) *UserRolePermissionGroupsListCall {
  43469. c.ifNoneMatch_ = entityTag
  43470. return c
  43471. }
  43472. // Context sets the context to be used in this call's Do method. Any
  43473. // pending HTTP request will be aborted if the provided context is
  43474. // canceled.
  43475. func (c *UserRolePermissionGroupsListCall) Context(ctx context.Context) *UserRolePermissionGroupsListCall {
  43476. c.ctx_ = ctx
  43477. return c
  43478. }
  43479. // Header returns an http.Header that can be modified by the caller to
  43480. // add HTTP headers to the request.
  43481. func (c *UserRolePermissionGroupsListCall) Header() http.Header {
  43482. if c.header_ == nil {
  43483. c.header_ = make(http.Header)
  43484. }
  43485. return c.header_
  43486. }
  43487. func (c *UserRolePermissionGroupsListCall) doRequest(alt string) (*http.Response, error) {
  43488. reqHeaders := make(http.Header)
  43489. for k, v := range c.header_ {
  43490. reqHeaders[k] = v
  43491. }
  43492. reqHeaders.Set("User-Agent", c.s.userAgent())
  43493. if c.ifNoneMatch_ != "" {
  43494. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43495. }
  43496. var body io.Reader = nil
  43497. c.urlParams_.Set("alt", alt)
  43498. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissionGroups")
  43499. urls += "?" + c.urlParams_.Encode()
  43500. req, _ := http.NewRequest("GET", urls, body)
  43501. req.Header = reqHeaders
  43502. googleapi.Expand(req.URL, map[string]string{
  43503. "profileId": strconv.FormatInt(c.profileId, 10),
  43504. })
  43505. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43506. }
  43507. // Do executes the "dfareporting.userRolePermissionGroups.list" call.
  43508. // Exactly one of *UserRolePermissionGroupsListResponse or error will be
  43509. // non-nil. Any non-2xx status code is an error. Response headers are in
  43510. // either *UserRolePermissionGroupsListResponse.ServerResponse.Header or
  43511. // (if a response was returned at all) in
  43512. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  43513. // whether the returned error was because http.StatusNotModified was
  43514. // returned.
  43515. func (c *UserRolePermissionGroupsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionGroupsListResponse, error) {
  43516. gensupport.SetOptions(c.urlParams_, opts...)
  43517. res, err := c.doRequest("json")
  43518. if res != nil && res.StatusCode == http.StatusNotModified {
  43519. if res.Body != nil {
  43520. res.Body.Close()
  43521. }
  43522. return nil, &googleapi.Error{
  43523. Code: res.StatusCode,
  43524. Header: res.Header,
  43525. }
  43526. }
  43527. if err != nil {
  43528. return nil, err
  43529. }
  43530. defer googleapi.CloseBody(res)
  43531. if err := googleapi.CheckResponse(res); err != nil {
  43532. return nil, err
  43533. }
  43534. ret := &UserRolePermissionGroupsListResponse{
  43535. ServerResponse: googleapi.ServerResponse{
  43536. Header: res.Header,
  43537. HTTPStatusCode: res.StatusCode,
  43538. },
  43539. }
  43540. target := &ret
  43541. if err := gensupport.DecodeResponse(target, res); err != nil {
  43542. return nil, err
  43543. }
  43544. return ret, nil
  43545. // {
  43546. // "description": "Gets a list of all supported user role permission groups.",
  43547. // "httpMethod": "GET",
  43548. // "id": "dfareporting.userRolePermissionGroups.list",
  43549. // "parameterOrder": [
  43550. // "profileId"
  43551. // ],
  43552. // "parameters": {
  43553. // "profileId": {
  43554. // "description": "User profile ID associated with this request.",
  43555. // "format": "int64",
  43556. // "location": "path",
  43557. // "required": true,
  43558. // "type": "string"
  43559. // }
  43560. // },
  43561. // "path": "userprofiles/{profileId}/userRolePermissionGroups",
  43562. // "response": {
  43563. // "$ref": "UserRolePermissionGroupsListResponse"
  43564. // },
  43565. // "scopes": [
  43566. // "https://www.googleapis.com/auth/dfatrafficking"
  43567. // ]
  43568. // }
  43569. }
  43570. // method id "dfareporting.userRolePermissions.get":
  43571. type UserRolePermissionsGetCall struct {
  43572. s *Service
  43573. profileId int64
  43574. id int64
  43575. urlParams_ gensupport.URLParams
  43576. ifNoneMatch_ string
  43577. ctx_ context.Context
  43578. header_ http.Header
  43579. }
  43580. // Get: Gets one user role permission by ID.
  43581. func (r *UserRolePermissionsService) Get(profileId int64, id int64) *UserRolePermissionsGetCall {
  43582. c := &UserRolePermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43583. c.profileId = profileId
  43584. c.id = id
  43585. return c
  43586. }
  43587. // Fields allows partial responses to be retrieved. See
  43588. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43589. // for more information.
  43590. func (c *UserRolePermissionsGetCall) Fields(s ...googleapi.Field) *UserRolePermissionsGetCall {
  43591. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43592. return c
  43593. }
  43594. // IfNoneMatch sets the optional parameter which makes the operation
  43595. // fail if the object's ETag matches the given value. This is useful for
  43596. // getting updates only after the object has changed since the last
  43597. // request. Use googleapi.IsNotModified to check whether the response
  43598. // error from Do is the result of In-None-Match.
  43599. func (c *UserRolePermissionsGetCall) IfNoneMatch(entityTag string) *UserRolePermissionsGetCall {
  43600. c.ifNoneMatch_ = entityTag
  43601. return c
  43602. }
  43603. // Context sets the context to be used in this call's Do method. Any
  43604. // pending HTTP request will be aborted if the provided context is
  43605. // canceled.
  43606. func (c *UserRolePermissionsGetCall) Context(ctx context.Context) *UserRolePermissionsGetCall {
  43607. c.ctx_ = ctx
  43608. return c
  43609. }
  43610. // Header returns an http.Header that can be modified by the caller to
  43611. // add HTTP headers to the request.
  43612. func (c *UserRolePermissionsGetCall) Header() http.Header {
  43613. if c.header_ == nil {
  43614. c.header_ = make(http.Header)
  43615. }
  43616. return c.header_
  43617. }
  43618. func (c *UserRolePermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  43619. reqHeaders := make(http.Header)
  43620. for k, v := range c.header_ {
  43621. reqHeaders[k] = v
  43622. }
  43623. reqHeaders.Set("User-Agent", c.s.userAgent())
  43624. if c.ifNoneMatch_ != "" {
  43625. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43626. }
  43627. var body io.Reader = nil
  43628. c.urlParams_.Set("alt", alt)
  43629. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions/{id}")
  43630. urls += "?" + c.urlParams_.Encode()
  43631. req, _ := http.NewRequest("GET", urls, body)
  43632. req.Header = reqHeaders
  43633. googleapi.Expand(req.URL, map[string]string{
  43634. "profileId": strconv.FormatInt(c.profileId, 10),
  43635. "id": strconv.FormatInt(c.id, 10),
  43636. })
  43637. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43638. }
  43639. // Do executes the "dfareporting.userRolePermissions.get" call.
  43640. // Exactly one of *UserRolePermission or error will be non-nil. Any
  43641. // non-2xx status code is an error. Response headers are in either
  43642. // *UserRolePermission.ServerResponse.Header or (if a response was
  43643. // returned at all) in error.(*googleapi.Error).Header. Use
  43644. // googleapi.IsNotModified to check whether the returned error was
  43645. // because http.StatusNotModified was returned.
  43646. func (c *UserRolePermissionsGetCall) Do(opts ...googleapi.CallOption) (*UserRolePermission, error) {
  43647. gensupport.SetOptions(c.urlParams_, opts...)
  43648. res, err := c.doRequest("json")
  43649. if res != nil && res.StatusCode == http.StatusNotModified {
  43650. if res.Body != nil {
  43651. res.Body.Close()
  43652. }
  43653. return nil, &googleapi.Error{
  43654. Code: res.StatusCode,
  43655. Header: res.Header,
  43656. }
  43657. }
  43658. if err != nil {
  43659. return nil, err
  43660. }
  43661. defer googleapi.CloseBody(res)
  43662. if err := googleapi.CheckResponse(res); err != nil {
  43663. return nil, err
  43664. }
  43665. ret := &UserRolePermission{
  43666. ServerResponse: googleapi.ServerResponse{
  43667. Header: res.Header,
  43668. HTTPStatusCode: res.StatusCode,
  43669. },
  43670. }
  43671. target := &ret
  43672. if err := gensupport.DecodeResponse(target, res); err != nil {
  43673. return nil, err
  43674. }
  43675. return ret, nil
  43676. // {
  43677. // "description": "Gets one user role permission by ID.",
  43678. // "httpMethod": "GET",
  43679. // "id": "dfareporting.userRolePermissions.get",
  43680. // "parameterOrder": [
  43681. // "profileId",
  43682. // "id"
  43683. // ],
  43684. // "parameters": {
  43685. // "id": {
  43686. // "description": "User role permission ID.",
  43687. // "format": "int64",
  43688. // "location": "path",
  43689. // "required": true,
  43690. // "type": "string"
  43691. // },
  43692. // "profileId": {
  43693. // "description": "User profile ID associated with this request.",
  43694. // "format": "int64",
  43695. // "location": "path",
  43696. // "required": true,
  43697. // "type": "string"
  43698. // }
  43699. // },
  43700. // "path": "userprofiles/{profileId}/userRolePermissions/{id}",
  43701. // "response": {
  43702. // "$ref": "UserRolePermission"
  43703. // },
  43704. // "scopes": [
  43705. // "https://www.googleapis.com/auth/dfatrafficking"
  43706. // ]
  43707. // }
  43708. }
  43709. // method id "dfareporting.userRolePermissions.list":
  43710. type UserRolePermissionsListCall struct {
  43711. s *Service
  43712. profileId int64
  43713. urlParams_ gensupport.URLParams
  43714. ifNoneMatch_ string
  43715. ctx_ context.Context
  43716. header_ http.Header
  43717. }
  43718. // List: Gets a list of user role permissions, possibly filtered.
  43719. func (r *UserRolePermissionsService) List(profileId int64) *UserRolePermissionsListCall {
  43720. c := &UserRolePermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43721. c.profileId = profileId
  43722. return c
  43723. }
  43724. // Ids sets the optional parameter "ids": Select only user role
  43725. // permissions with these IDs.
  43726. func (c *UserRolePermissionsListCall) Ids(ids ...int64) *UserRolePermissionsListCall {
  43727. var ids_ []string
  43728. for _, v := range ids {
  43729. ids_ = append(ids_, fmt.Sprint(v))
  43730. }
  43731. c.urlParams_.SetMulti("ids", ids_)
  43732. return c
  43733. }
  43734. // Fields allows partial responses to be retrieved. See
  43735. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43736. // for more information.
  43737. func (c *UserRolePermissionsListCall) Fields(s ...googleapi.Field) *UserRolePermissionsListCall {
  43738. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43739. return c
  43740. }
  43741. // IfNoneMatch sets the optional parameter which makes the operation
  43742. // fail if the object's ETag matches the given value. This is useful for
  43743. // getting updates only after the object has changed since the last
  43744. // request. Use googleapi.IsNotModified to check whether the response
  43745. // error from Do is the result of In-None-Match.
  43746. func (c *UserRolePermissionsListCall) IfNoneMatch(entityTag string) *UserRolePermissionsListCall {
  43747. c.ifNoneMatch_ = entityTag
  43748. return c
  43749. }
  43750. // Context sets the context to be used in this call's Do method. Any
  43751. // pending HTTP request will be aborted if the provided context is
  43752. // canceled.
  43753. func (c *UserRolePermissionsListCall) Context(ctx context.Context) *UserRolePermissionsListCall {
  43754. c.ctx_ = ctx
  43755. return c
  43756. }
  43757. // Header returns an http.Header that can be modified by the caller to
  43758. // add HTTP headers to the request.
  43759. func (c *UserRolePermissionsListCall) Header() http.Header {
  43760. if c.header_ == nil {
  43761. c.header_ = make(http.Header)
  43762. }
  43763. return c.header_
  43764. }
  43765. func (c *UserRolePermissionsListCall) doRequest(alt string) (*http.Response, error) {
  43766. reqHeaders := make(http.Header)
  43767. for k, v := range c.header_ {
  43768. reqHeaders[k] = v
  43769. }
  43770. reqHeaders.Set("User-Agent", c.s.userAgent())
  43771. if c.ifNoneMatch_ != "" {
  43772. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  43773. }
  43774. var body io.Reader = nil
  43775. c.urlParams_.Set("alt", alt)
  43776. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRolePermissions")
  43777. urls += "?" + c.urlParams_.Encode()
  43778. req, _ := http.NewRequest("GET", urls, body)
  43779. req.Header = reqHeaders
  43780. googleapi.Expand(req.URL, map[string]string{
  43781. "profileId": strconv.FormatInt(c.profileId, 10),
  43782. })
  43783. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43784. }
  43785. // Do executes the "dfareporting.userRolePermissions.list" call.
  43786. // Exactly one of *UserRolePermissionsListResponse or error will be
  43787. // non-nil. Any non-2xx status code is an error. Response headers are in
  43788. // either *UserRolePermissionsListResponse.ServerResponse.Header or (if
  43789. // a response was returned at all) in error.(*googleapi.Error).Header.
  43790. // Use googleapi.IsNotModified to check whether the returned error was
  43791. // because http.StatusNotModified was returned.
  43792. func (c *UserRolePermissionsListCall) Do(opts ...googleapi.CallOption) (*UserRolePermissionsListResponse, error) {
  43793. gensupport.SetOptions(c.urlParams_, opts...)
  43794. res, err := c.doRequest("json")
  43795. if res != nil && res.StatusCode == http.StatusNotModified {
  43796. if res.Body != nil {
  43797. res.Body.Close()
  43798. }
  43799. return nil, &googleapi.Error{
  43800. Code: res.StatusCode,
  43801. Header: res.Header,
  43802. }
  43803. }
  43804. if err != nil {
  43805. return nil, err
  43806. }
  43807. defer googleapi.CloseBody(res)
  43808. if err := googleapi.CheckResponse(res); err != nil {
  43809. return nil, err
  43810. }
  43811. ret := &UserRolePermissionsListResponse{
  43812. ServerResponse: googleapi.ServerResponse{
  43813. Header: res.Header,
  43814. HTTPStatusCode: res.StatusCode,
  43815. },
  43816. }
  43817. target := &ret
  43818. if err := gensupport.DecodeResponse(target, res); err != nil {
  43819. return nil, err
  43820. }
  43821. return ret, nil
  43822. // {
  43823. // "description": "Gets a list of user role permissions, possibly filtered.",
  43824. // "httpMethod": "GET",
  43825. // "id": "dfareporting.userRolePermissions.list",
  43826. // "parameterOrder": [
  43827. // "profileId"
  43828. // ],
  43829. // "parameters": {
  43830. // "ids": {
  43831. // "description": "Select only user role permissions with these IDs.",
  43832. // "format": "int64",
  43833. // "location": "query",
  43834. // "repeated": true,
  43835. // "type": "string"
  43836. // },
  43837. // "profileId": {
  43838. // "description": "User profile ID associated with this request.",
  43839. // "format": "int64",
  43840. // "location": "path",
  43841. // "required": true,
  43842. // "type": "string"
  43843. // }
  43844. // },
  43845. // "path": "userprofiles/{profileId}/userRolePermissions",
  43846. // "response": {
  43847. // "$ref": "UserRolePermissionsListResponse"
  43848. // },
  43849. // "scopes": [
  43850. // "https://www.googleapis.com/auth/dfatrafficking"
  43851. // ]
  43852. // }
  43853. }
  43854. // method id "dfareporting.userRoles.delete":
  43855. type UserRolesDeleteCall struct {
  43856. s *Service
  43857. profileId int64
  43858. id int64
  43859. urlParams_ gensupport.URLParams
  43860. ctx_ context.Context
  43861. header_ http.Header
  43862. }
  43863. // Delete: Deletes an existing user role.
  43864. func (r *UserRolesService) Delete(profileId int64, id int64) *UserRolesDeleteCall {
  43865. c := &UserRolesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43866. c.profileId = profileId
  43867. c.id = id
  43868. return c
  43869. }
  43870. // Fields allows partial responses to be retrieved. See
  43871. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43872. // for more information.
  43873. func (c *UserRolesDeleteCall) Fields(s ...googleapi.Field) *UserRolesDeleteCall {
  43874. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43875. return c
  43876. }
  43877. // Context sets the context to be used in this call's Do method. Any
  43878. // pending HTTP request will be aborted if the provided context is
  43879. // canceled.
  43880. func (c *UserRolesDeleteCall) Context(ctx context.Context) *UserRolesDeleteCall {
  43881. c.ctx_ = ctx
  43882. return c
  43883. }
  43884. // Header returns an http.Header that can be modified by the caller to
  43885. // add HTTP headers to the request.
  43886. func (c *UserRolesDeleteCall) Header() http.Header {
  43887. if c.header_ == nil {
  43888. c.header_ = make(http.Header)
  43889. }
  43890. return c.header_
  43891. }
  43892. func (c *UserRolesDeleteCall) doRequest(alt string) (*http.Response, error) {
  43893. reqHeaders := make(http.Header)
  43894. for k, v := range c.header_ {
  43895. reqHeaders[k] = v
  43896. }
  43897. reqHeaders.Set("User-Agent", c.s.userAgent())
  43898. var body io.Reader = nil
  43899. c.urlParams_.Set("alt", alt)
  43900. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  43901. urls += "?" + c.urlParams_.Encode()
  43902. req, _ := http.NewRequest("DELETE", urls, body)
  43903. req.Header = reqHeaders
  43904. googleapi.Expand(req.URL, map[string]string{
  43905. "profileId": strconv.FormatInt(c.profileId, 10),
  43906. "id": strconv.FormatInt(c.id, 10),
  43907. })
  43908. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  43909. }
  43910. // Do executes the "dfareporting.userRoles.delete" call.
  43911. func (c *UserRolesDeleteCall) Do(opts ...googleapi.CallOption) error {
  43912. gensupport.SetOptions(c.urlParams_, opts...)
  43913. res, err := c.doRequest("json")
  43914. if err != nil {
  43915. return err
  43916. }
  43917. defer googleapi.CloseBody(res)
  43918. if err := googleapi.CheckResponse(res); err != nil {
  43919. return err
  43920. }
  43921. return nil
  43922. // {
  43923. // "description": "Deletes an existing user role.",
  43924. // "httpMethod": "DELETE",
  43925. // "id": "dfareporting.userRoles.delete",
  43926. // "parameterOrder": [
  43927. // "profileId",
  43928. // "id"
  43929. // ],
  43930. // "parameters": {
  43931. // "id": {
  43932. // "description": "User role ID.",
  43933. // "format": "int64",
  43934. // "location": "path",
  43935. // "required": true,
  43936. // "type": "string"
  43937. // },
  43938. // "profileId": {
  43939. // "description": "User profile ID associated with this request.",
  43940. // "format": "int64",
  43941. // "location": "path",
  43942. // "required": true,
  43943. // "type": "string"
  43944. // }
  43945. // },
  43946. // "path": "userprofiles/{profileId}/userRoles/{id}",
  43947. // "scopes": [
  43948. // "https://www.googleapis.com/auth/dfatrafficking"
  43949. // ]
  43950. // }
  43951. }
  43952. // method id "dfareporting.userRoles.get":
  43953. type UserRolesGetCall struct {
  43954. s *Service
  43955. profileId int64
  43956. id int64
  43957. urlParams_ gensupport.URLParams
  43958. ifNoneMatch_ string
  43959. ctx_ context.Context
  43960. header_ http.Header
  43961. }
  43962. // Get: Gets one user role by ID.
  43963. func (r *UserRolesService) Get(profileId int64, id int64) *UserRolesGetCall {
  43964. c := &UserRolesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  43965. c.profileId = profileId
  43966. c.id = id
  43967. return c
  43968. }
  43969. // Fields allows partial responses to be retrieved. See
  43970. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  43971. // for more information.
  43972. func (c *UserRolesGetCall) Fields(s ...googleapi.Field) *UserRolesGetCall {
  43973. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  43974. return c
  43975. }
  43976. // IfNoneMatch sets the optional parameter which makes the operation
  43977. // fail if the object's ETag matches the given value. This is useful for
  43978. // getting updates only after the object has changed since the last
  43979. // request. Use googleapi.IsNotModified to check whether the response
  43980. // error from Do is the result of In-None-Match.
  43981. func (c *UserRolesGetCall) IfNoneMatch(entityTag string) *UserRolesGetCall {
  43982. c.ifNoneMatch_ = entityTag
  43983. return c
  43984. }
  43985. // Context sets the context to be used in this call's Do method. Any
  43986. // pending HTTP request will be aborted if the provided context is
  43987. // canceled.
  43988. func (c *UserRolesGetCall) Context(ctx context.Context) *UserRolesGetCall {
  43989. c.ctx_ = ctx
  43990. return c
  43991. }
  43992. // Header returns an http.Header that can be modified by the caller to
  43993. // add HTTP headers to the request.
  43994. func (c *UserRolesGetCall) Header() http.Header {
  43995. if c.header_ == nil {
  43996. c.header_ = make(http.Header)
  43997. }
  43998. return c.header_
  43999. }
  44000. func (c *UserRolesGetCall) doRequest(alt string) (*http.Response, error) {
  44001. reqHeaders := make(http.Header)
  44002. for k, v := range c.header_ {
  44003. reqHeaders[k] = v
  44004. }
  44005. reqHeaders.Set("User-Agent", c.s.userAgent())
  44006. if c.ifNoneMatch_ != "" {
  44007. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44008. }
  44009. var body io.Reader = nil
  44010. c.urlParams_.Set("alt", alt)
  44011. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles/{id}")
  44012. urls += "?" + c.urlParams_.Encode()
  44013. req, _ := http.NewRequest("GET", urls, body)
  44014. req.Header = reqHeaders
  44015. googleapi.Expand(req.URL, map[string]string{
  44016. "profileId": strconv.FormatInt(c.profileId, 10),
  44017. "id": strconv.FormatInt(c.id, 10),
  44018. })
  44019. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44020. }
  44021. // Do executes the "dfareporting.userRoles.get" call.
  44022. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44023. // code is an error. Response headers are in either
  44024. // *UserRole.ServerResponse.Header or (if a response was returned at
  44025. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44026. // to check whether the returned error was because
  44027. // http.StatusNotModified was returned.
  44028. func (c *UserRolesGetCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44029. gensupport.SetOptions(c.urlParams_, opts...)
  44030. res, err := c.doRequest("json")
  44031. if res != nil && res.StatusCode == http.StatusNotModified {
  44032. if res.Body != nil {
  44033. res.Body.Close()
  44034. }
  44035. return nil, &googleapi.Error{
  44036. Code: res.StatusCode,
  44037. Header: res.Header,
  44038. }
  44039. }
  44040. if err != nil {
  44041. return nil, err
  44042. }
  44043. defer googleapi.CloseBody(res)
  44044. if err := googleapi.CheckResponse(res); err != nil {
  44045. return nil, err
  44046. }
  44047. ret := &UserRole{
  44048. ServerResponse: googleapi.ServerResponse{
  44049. Header: res.Header,
  44050. HTTPStatusCode: res.StatusCode,
  44051. },
  44052. }
  44053. target := &ret
  44054. if err := gensupport.DecodeResponse(target, res); err != nil {
  44055. return nil, err
  44056. }
  44057. return ret, nil
  44058. // {
  44059. // "description": "Gets one user role by ID.",
  44060. // "httpMethod": "GET",
  44061. // "id": "dfareporting.userRoles.get",
  44062. // "parameterOrder": [
  44063. // "profileId",
  44064. // "id"
  44065. // ],
  44066. // "parameters": {
  44067. // "id": {
  44068. // "description": "User role ID.",
  44069. // "format": "int64",
  44070. // "location": "path",
  44071. // "required": true,
  44072. // "type": "string"
  44073. // },
  44074. // "profileId": {
  44075. // "description": "User profile ID associated with this request.",
  44076. // "format": "int64",
  44077. // "location": "path",
  44078. // "required": true,
  44079. // "type": "string"
  44080. // }
  44081. // },
  44082. // "path": "userprofiles/{profileId}/userRoles/{id}",
  44083. // "response": {
  44084. // "$ref": "UserRole"
  44085. // },
  44086. // "scopes": [
  44087. // "https://www.googleapis.com/auth/dfatrafficking"
  44088. // ]
  44089. // }
  44090. }
  44091. // method id "dfareporting.userRoles.insert":
  44092. type UserRolesInsertCall struct {
  44093. s *Service
  44094. profileId int64
  44095. userrole *UserRole
  44096. urlParams_ gensupport.URLParams
  44097. ctx_ context.Context
  44098. header_ http.Header
  44099. }
  44100. // Insert: Inserts a new user role.
  44101. func (r *UserRolesService) Insert(profileId int64, userrole *UserRole) *UserRolesInsertCall {
  44102. c := &UserRolesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44103. c.profileId = profileId
  44104. c.userrole = userrole
  44105. return c
  44106. }
  44107. // Fields allows partial responses to be retrieved. See
  44108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44109. // for more information.
  44110. func (c *UserRolesInsertCall) Fields(s ...googleapi.Field) *UserRolesInsertCall {
  44111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44112. return c
  44113. }
  44114. // Context sets the context to be used in this call's Do method. Any
  44115. // pending HTTP request will be aborted if the provided context is
  44116. // canceled.
  44117. func (c *UserRolesInsertCall) Context(ctx context.Context) *UserRolesInsertCall {
  44118. c.ctx_ = ctx
  44119. return c
  44120. }
  44121. // Header returns an http.Header that can be modified by the caller to
  44122. // add HTTP headers to the request.
  44123. func (c *UserRolesInsertCall) Header() http.Header {
  44124. if c.header_ == nil {
  44125. c.header_ = make(http.Header)
  44126. }
  44127. return c.header_
  44128. }
  44129. func (c *UserRolesInsertCall) doRequest(alt string) (*http.Response, error) {
  44130. reqHeaders := make(http.Header)
  44131. for k, v := range c.header_ {
  44132. reqHeaders[k] = v
  44133. }
  44134. reqHeaders.Set("User-Agent", c.s.userAgent())
  44135. var body io.Reader = nil
  44136. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  44137. if err != nil {
  44138. return nil, err
  44139. }
  44140. reqHeaders.Set("Content-Type", "application/json")
  44141. c.urlParams_.Set("alt", alt)
  44142. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44143. urls += "?" + c.urlParams_.Encode()
  44144. req, _ := http.NewRequest("POST", urls, body)
  44145. req.Header = reqHeaders
  44146. googleapi.Expand(req.URL, map[string]string{
  44147. "profileId": strconv.FormatInt(c.profileId, 10),
  44148. })
  44149. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44150. }
  44151. // Do executes the "dfareporting.userRoles.insert" call.
  44152. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44153. // code is an error. Response headers are in either
  44154. // *UserRole.ServerResponse.Header or (if a response was returned at
  44155. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44156. // to check whether the returned error was because
  44157. // http.StatusNotModified was returned.
  44158. func (c *UserRolesInsertCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44159. gensupport.SetOptions(c.urlParams_, opts...)
  44160. res, err := c.doRequest("json")
  44161. if res != nil && res.StatusCode == http.StatusNotModified {
  44162. if res.Body != nil {
  44163. res.Body.Close()
  44164. }
  44165. return nil, &googleapi.Error{
  44166. Code: res.StatusCode,
  44167. Header: res.Header,
  44168. }
  44169. }
  44170. if err != nil {
  44171. return nil, err
  44172. }
  44173. defer googleapi.CloseBody(res)
  44174. if err := googleapi.CheckResponse(res); err != nil {
  44175. return nil, err
  44176. }
  44177. ret := &UserRole{
  44178. ServerResponse: googleapi.ServerResponse{
  44179. Header: res.Header,
  44180. HTTPStatusCode: res.StatusCode,
  44181. },
  44182. }
  44183. target := &ret
  44184. if err := gensupport.DecodeResponse(target, res); err != nil {
  44185. return nil, err
  44186. }
  44187. return ret, nil
  44188. // {
  44189. // "description": "Inserts a new user role.",
  44190. // "httpMethod": "POST",
  44191. // "id": "dfareporting.userRoles.insert",
  44192. // "parameterOrder": [
  44193. // "profileId"
  44194. // ],
  44195. // "parameters": {
  44196. // "profileId": {
  44197. // "description": "User profile ID associated with this request.",
  44198. // "format": "int64",
  44199. // "location": "path",
  44200. // "required": true,
  44201. // "type": "string"
  44202. // }
  44203. // },
  44204. // "path": "userprofiles/{profileId}/userRoles",
  44205. // "request": {
  44206. // "$ref": "UserRole"
  44207. // },
  44208. // "response": {
  44209. // "$ref": "UserRole"
  44210. // },
  44211. // "scopes": [
  44212. // "https://www.googleapis.com/auth/dfatrafficking"
  44213. // ]
  44214. // }
  44215. }
  44216. // method id "dfareporting.userRoles.list":
  44217. type UserRolesListCall struct {
  44218. s *Service
  44219. profileId int64
  44220. urlParams_ gensupport.URLParams
  44221. ifNoneMatch_ string
  44222. ctx_ context.Context
  44223. header_ http.Header
  44224. }
  44225. // List: Retrieves a list of user roles, possibly filtered. This method
  44226. // supports paging.
  44227. func (r *UserRolesService) List(profileId int64) *UserRolesListCall {
  44228. c := &UserRolesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44229. c.profileId = profileId
  44230. return c
  44231. }
  44232. // AccountUserRoleOnly sets the optional parameter
  44233. // "accountUserRoleOnly": Select only account level user roles not
  44234. // associated with any specific subaccount.
  44235. func (c *UserRolesListCall) AccountUserRoleOnly(accountUserRoleOnly bool) *UserRolesListCall {
  44236. c.urlParams_.Set("accountUserRoleOnly", fmt.Sprint(accountUserRoleOnly))
  44237. return c
  44238. }
  44239. // Ids sets the optional parameter "ids": Select only user roles with
  44240. // the specified IDs.
  44241. func (c *UserRolesListCall) Ids(ids ...int64) *UserRolesListCall {
  44242. var ids_ []string
  44243. for _, v := range ids {
  44244. ids_ = append(ids_, fmt.Sprint(v))
  44245. }
  44246. c.urlParams_.SetMulti("ids", ids_)
  44247. return c
  44248. }
  44249. // MaxResults sets the optional parameter "maxResults": Maximum number
  44250. // of results to return.
  44251. func (c *UserRolesListCall) MaxResults(maxResults int64) *UserRolesListCall {
  44252. c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  44253. return c
  44254. }
  44255. // PageToken sets the optional parameter "pageToken": Value of the
  44256. // nextPageToken from the previous result page.
  44257. func (c *UserRolesListCall) PageToken(pageToken string) *UserRolesListCall {
  44258. c.urlParams_.Set("pageToken", pageToken)
  44259. return c
  44260. }
  44261. // SearchString sets the optional parameter "searchString": Allows
  44262. // searching for objects by name or ID. Wildcards (*) are allowed. For
  44263. // example, "userrole*2015" will return objects with names like
  44264. // "userrole June 2015", "userrole April 2015", or simply "userrole
  44265. // 2015". Most of the searches also add wildcards implicitly at the
  44266. // start and the end of the search string. For example, a search string
  44267. // of "userrole" will match objects with name "my userrole", "userrole
  44268. // 2015", or simply "userrole".
  44269. func (c *UserRolesListCall) SearchString(searchString string) *UserRolesListCall {
  44270. c.urlParams_.Set("searchString", searchString)
  44271. return c
  44272. }
  44273. // SortField sets the optional parameter "sortField": Field by which to
  44274. // sort the list.
  44275. //
  44276. // Possible values:
  44277. // "ID" (default)
  44278. // "NAME"
  44279. func (c *UserRolesListCall) SortField(sortField string) *UserRolesListCall {
  44280. c.urlParams_.Set("sortField", sortField)
  44281. return c
  44282. }
  44283. // SortOrder sets the optional parameter "sortOrder": Order of sorted
  44284. // results.
  44285. //
  44286. // Possible values:
  44287. // "ASCENDING" (default)
  44288. // "DESCENDING"
  44289. func (c *UserRolesListCall) SortOrder(sortOrder string) *UserRolesListCall {
  44290. c.urlParams_.Set("sortOrder", sortOrder)
  44291. return c
  44292. }
  44293. // SubaccountId sets the optional parameter "subaccountId": Select only
  44294. // user roles that belong to this subaccount.
  44295. func (c *UserRolesListCall) SubaccountId(subaccountId int64) *UserRolesListCall {
  44296. c.urlParams_.Set("subaccountId", fmt.Sprint(subaccountId))
  44297. return c
  44298. }
  44299. // Fields allows partial responses to be retrieved. See
  44300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44301. // for more information.
  44302. func (c *UserRolesListCall) Fields(s ...googleapi.Field) *UserRolesListCall {
  44303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44304. return c
  44305. }
  44306. // IfNoneMatch sets the optional parameter which makes the operation
  44307. // fail if the object's ETag matches the given value. This is useful for
  44308. // getting updates only after the object has changed since the last
  44309. // request. Use googleapi.IsNotModified to check whether the response
  44310. // error from Do is the result of In-None-Match.
  44311. func (c *UserRolesListCall) IfNoneMatch(entityTag string) *UserRolesListCall {
  44312. c.ifNoneMatch_ = entityTag
  44313. return c
  44314. }
  44315. // Context sets the context to be used in this call's Do method. Any
  44316. // pending HTTP request will be aborted if the provided context is
  44317. // canceled.
  44318. func (c *UserRolesListCall) Context(ctx context.Context) *UserRolesListCall {
  44319. c.ctx_ = ctx
  44320. return c
  44321. }
  44322. // Header returns an http.Header that can be modified by the caller to
  44323. // add HTTP headers to the request.
  44324. func (c *UserRolesListCall) Header() http.Header {
  44325. if c.header_ == nil {
  44326. c.header_ = make(http.Header)
  44327. }
  44328. return c.header_
  44329. }
  44330. func (c *UserRolesListCall) doRequest(alt string) (*http.Response, error) {
  44331. reqHeaders := make(http.Header)
  44332. for k, v := range c.header_ {
  44333. reqHeaders[k] = v
  44334. }
  44335. reqHeaders.Set("User-Agent", c.s.userAgent())
  44336. if c.ifNoneMatch_ != "" {
  44337. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44338. }
  44339. var body io.Reader = nil
  44340. c.urlParams_.Set("alt", alt)
  44341. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44342. urls += "?" + c.urlParams_.Encode()
  44343. req, _ := http.NewRequest("GET", urls, body)
  44344. req.Header = reqHeaders
  44345. googleapi.Expand(req.URL, map[string]string{
  44346. "profileId": strconv.FormatInt(c.profileId, 10),
  44347. })
  44348. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44349. }
  44350. // Do executes the "dfareporting.userRoles.list" call.
  44351. // Exactly one of *UserRolesListResponse or error will be non-nil. Any
  44352. // non-2xx status code is an error. Response headers are in either
  44353. // *UserRolesListResponse.ServerResponse.Header or (if a response was
  44354. // returned at all) in error.(*googleapi.Error).Header. Use
  44355. // googleapi.IsNotModified to check whether the returned error was
  44356. // because http.StatusNotModified was returned.
  44357. func (c *UserRolesListCall) Do(opts ...googleapi.CallOption) (*UserRolesListResponse, error) {
  44358. gensupport.SetOptions(c.urlParams_, opts...)
  44359. res, err := c.doRequest("json")
  44360. if res != nil && res.StatusCode == http.StatusNotModified {
  44361. if res.Body != nil {
  44362. res.Body.Close()
  44363. }
  44364. return nil, &googleapi.Error{
  44365. Code: res.StatusCode,
  44366. Header: res.Header,
  44367. }
  44368. }
  44369. if err != nil {
  44370. return nil, err
  44371. }
  44372. defer googleapi.CloseBody(res)
  44373. if err := googleapi.CheckResponse(res); err != nil {
  44374. return nil, err
  44375. }
  44376. ret := &UserRolesListResponse{
  44377. ServerResponse: googleapi.ServerResponse{
  44378. Header: res.Header,
  44379. HTTPStatusCode: res.StatusCode,
  44380. },
  44381. }
  44382. target := &ret
  44383. if err := gensupport.DecodeResponse(target, res); err != nil {
  44384. return nil, err
  44385. }
  44386. return ret, nil
  44387. // {
  44388. // "description": "Retrieves a list of user roles, possibly filtered. This method supports paging.",
  44389. // "httpMethod": "GET",
  44390. // "id": "dfareporting.userRoles.list",
  44391. // "parameterOrder": [
  44392. // "profileId"
  44393. // ],
  44394. // "parameters": {
  44395. // "accountUserRoleOnly": {
  44396. // "description": "Select only account level user roles not associated with any specific subaccount.",
  44397. // "location": "query",
  44398. // "type": "boolean"
  44399. // },
  44400. // "ids": {
  44401. // "description": "Select only user roles with the specified IDs.",
  44402. // "format": "int64",
  44403. // "location": "query",
  44404. // "repeated": true,
  44405. // "type": "string"
  44406. // },
  44407. // "maxResults": {
  44408. // "default": "1000",
  44409. // "description": "Maximum number of results to return.",
  44410. // "format": "int32",
  44411. // "location": "query",
  44412. // "maximum": "1000",
  44413. // "minimum": "0",
  44414. // "type": "integer"
  44415. // },
  44416. // "pageToken": {
  44417. // "description": "Value of the nextPageToken from the previous result page.",
  44418. // "location": "query",
  44419. // "type": "string"
  44420. // },
  44421. // "profileId": {
  44422. // "description": "User profile ID associated with this request.",
  44423. // "format": "int64",
  44424. // "location": "path",
  44425. // "required": true,
  44426. // "type": "string"
  44427. // },
  44428. // "searchString": {
  44429. // "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\".",
  44430. // "location": "query",
  44431. // "type": "string"
  44432. // },
  44433. // "sortField": {
  44434. // "default": "ID",
  44435. // "description": "Field by which to sort the list.",
  44436. // "enum": [
  44437. // "ID",
  44438. // "NAME"
  44439. // ],
  44440. // "enumDescriptions": [
  44441. // "",
  44442. // ""
  44443. // ],
  44444. // "location": "query",
  44445. // "type": "string"
  44446. // },
  44447. // "sortOrder": {
  44448. // "default": "ASCENDING",
  44449. // "description": "Order of sorted results.",
  44450. // "enum": [
  44451. // "ASCENDING",
  44452. // "DESCENDING"
  44453. // ],
  44454. // "enumDescriptions": [
  44455. // "",
  44456. // ""
  44457. // ],
  44458. // "location": "query",
  44459. // "type": "string"
  44460. // },
  44461. // "subaccountId": {
  44462. // "description": "Select only user roles that belong to this subaccount.",
  44463. // "format": "int64",
  44464. // "location": "query",
  44465. // "type": "string"
  44466. // }
  44467. // },
  44468. // "path": "userprofiles/{profileId}/userRoles",
  44469. // "response": {
  44470. // "$ref": "UserRolesListResponse"
  44471. // },
  44472. // "scopes": [
  44473. // "https://www.googleapis.com/auth/dfatrafficking"
  44474. // ]
  44475. // }
  44476. }
  44477. // Pages invokes f for each page of results.
  44478. // A non-nil error returned from f will halt the iteration.
  44479. // The provided context supersedes any context provided to the Context method.
  44480. func (c *UserRolesListCall) Pages(ctx context.Context, f func(*UserRolesListResponse) error) error {
  44481. c.ctx_ = ctx
  44482. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  44483. for {
  44484. x, err := c.Do()
  44485. if err != nil {
  44486. return err
  44487. }
  44488. if err := f(x); err != nil {
  44489. return err
  44490. }
  44491. if x.NextPageToken == "" {
  44492. return nil
  44493. }
  44494. c.PageToken(x.NextPageToken)
  44495. }
  44496. }
  44497. // method id "dfareporting.userRoles.patch":
  44498. type UserRolesPatchCall struct {
  44499. s *Service
  44500. profileId int64
  44501. userrole *UserRole
  44502. urlParams_ gensupport.URLParams
  44503. ctx_ context.Context
  44504. header_ http.Header
  44505. }
  44506. // Patch: Updates an existing user role. This method supports patch
  44507. // semantics.
  44508. func (r *UserRolesService) Patch(profileId int64, id int64, userrole *UserRole) *UserRolesPatchCall {
  44509. c := &UserRolesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44510. c.profileId = profileId
  44511. c.urlParams_.Set("id", fmt.Sprint(id))
  44512. c.userrole = userrole
  44513. return c
  44514. }
  44515. // Fields allows partial responses to be retrieved. See
  44516. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44517. // for more information.
  44518. func (c *UserRolesPatchCall) Fields(s ...googleapi.Field) *UserRolesPatchCall {
  44519. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44520. return c
  44521. }
  44522. // Context sets the context to be used in this call's Do method. Any
  44523. // pending HTTP request will be aborted if the provided context is
  44524. // canceled.
  44525. func (c *UserRolesPatchCall) Context(ctx context.Context) *UserRolesPatchCall {
  44526. c.ctx_ = ctx
  44527. return c
  44528. }
  44529. // Header returns an http.Header that can be modified by the caller to
  44530. // add HTTP headers to the request.
  44531. func (c *UserRolesPatchCall) Header() http.Header {
  44532. if c.header_ == nil {
  44533. c.header_ = make(http.Header)
  44534. }
  44535. return c.header_
  44536. }
  44537. func (c *UserRolesPatchCall) doRequest(alt string) (*http.Response, error) {
  44538. reqHeaders := make(http.Header)
  44539. for k, v := range c.header_ {
  44540. reqHeaders[k] = v
  44541. }
  44542. reqHeaders.Set("User-Agent", c.s.userAgent())
  44543. var body io.Reader = nil
  44544. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  44545. if err != nil {
  44546. return nil, err
  44547. }
  44548. reqHeaders.Set("Content-Type", "application/json")
  44549. c.urlParams_.Set("alt", alt)
  44550. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44551. urls += "?" + c.urlParams_.Encode()
  44552. req, _ := http.NewRequest("PATCH", urls, body)
  44553. req.Header = reqHeaders
  44554. googleapi.Expand(req.URL, map[string]string{
  44555. "profileId": strconv.FormatInt(c.profileId, 10),
  44556. })
  44557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44558. }
  44559. // Do executes the "dfareporting.userRoles.patch" call.
  44560. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44561. // code is an error. Response headers are in either
  44562. // *UserRole.ServerResponse.Header or (if a response was returned at
  44563. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44564. // to check whether the returned error was because
  44565. // http.StatusNotModified was returned.
  44566. func (c *UserRolesPatchCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44567. gensupport.SetOptions(c.urlParams_, opts...)
  44568. res, err := c.doRequest("json")
  44569. if res != nil && res.StatusCode == http.StatusNotModified {
  44570. if res.Body != nil {
  44571. res.Body.Close()
  44572. }
  44573. return nil, &googleapi.Error{
  44574. Code: res.StatusCode,
  44575. Header: res.Header,
  44576. }
  44577. }
  44578. if err != nil {
  44579. return nil, err
  44580. }
  44581. defer googleapi.CloseBody(res)
  44582. if err := googleapi.CheckResponse(res); err != nil {
  44583. return nil, err
  44584. }
  44585. ret := &UserRole{
  44586. ServerResponse: googleapi.ServerResponse{
  44587. Header: res.Header,
  44588. HTTPStatusCode: res.StatusCode,
  44589. },
  44590. }
  44591. target := &ret
  44592. if err := gensupport.DecodeResponse(target, res); err != nil {
  44593. return nil, err
  44594. }
  44595. return ret, nil
  44596. // {
  44597. // "description": "Updates an existing user role. This method supports patch semantics.",
  44598. // "httpMethod": "PATCH",
  44599. // "id": "dfareporting.userRoles.patch",
  44600. // "parameterOrder": [
  44601. // "profileId",
  44602. // "id"
  44603. // ],
  44604. // "parameters": {
  44605. // "id": {
  44606. // "description": "User role ID.",
  44607. // "format": "int64",
  44608. // "location": "query",
  44609. // "required": true,
  44610. // "type": "string"
  44611. // },
  44612. // "profileId": {
  44613. // "description": "User profile ID associated with this request.",
  44614. // "format": "int64",
  44615. // "location": "path",
  44616. // "required": true,
  44617. // "type": "string"
  44618. // }
  44619. // },
  44620. // "path": "userprofiles/{profileId}/userRoles",
  44621. // "request": {
  44622. // "$ref": "UserRole"
  44623. // },
  44624. // "response": {
  44625. // "$ref": "UserRole"
  44626. // },
  44627. // "scopes": [
  44628. // "https://www.googleapis.com/auth/dfatrafficking"
  44629. // ]
  44630. // }
  44631. }
  44632. // method id "dfareporting.userRoles.update":
  44633. type UserRolesUpdateCall struct {
  44634. s *Service
  44635. profileId int64
  44636. userrole *UserRole
  44637. urlParams_ gensupport.URLParams
  44638. ctx_ context.Context
  44639. header_ http.Header
  44640. }
  44641. // Update: Updates an existing user role.
  44642. func (r *UserRolesService) Update(profileId int64, userrole *UserRole) *UserRolesUpdateCall {
  44643. c := &UserRolesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44644. c.profileId = profileId
  44645. c.userrole = userrole
  44646. return c
  44647. }
  44648. // Fields allows partial responses to be retrieved. See
  44649. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44650. // for more information.
  44651. func (c *UserRolesUpdateCall) Fields(s ...googleapi.Field) *UserRolesUpdateCall {
  44652. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44653. return c
  44654. }
  44655. // Context sets the context to be used in this call's Do method. Any
  44656. // pending HTTP request will be aborted if the provided context is
  44657. // canceled.
  44658. func (c *UserRolesUpdateCall) Context(ctx context.Context) *UserRolesUpdateCall {
  44659. c.ctx_ = ctx
  44660. return c
  44661. }
  44662. // Header returns an http.Header that can be modified by the caller to
  44663. // add HTTP headers to the request.
  44664. func (c *UserRolesUpdateCall) Header() http.Header {
  44665. if c.header_ == nil {
  44666. c.header_ = make(http.Header)
  44667. }
  44668. return c.header_
  44669. }
  44670. func (c *UserRolesUpdateCall) doRequest(alt string) (*http.Response, error) {
  44671. reqHeaders := make(http.Header)
  44672. for k, v := range c.header_ {
  44673. reqHeaders[k] = v
  44674. }
  44675. reqHeaders.Set("User-Agent", c.s.userAgent())
  44676. var body io.Reader = nil
  44677. body, err := googleapi.WithoutDataWrapper.JSONReader(c.userrole)
  44678. if err != nil {
  44679. return nil, err
  44680. }
  44681. reqHeaders.Set("Content-Type", "application/json")
  44682. c.urlParams_.Set("alt", alt)
  44683. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/userRoles")
  44684. urls += "?" + c.urlParams_.Encode()
  44685. req, _ := http.NewRequest("PUT", urls, body)
  44686. req.Header = reqHeaders
  44687. googleapi.Expand(req.URL, map[string]string{
  44688. "profileId": strconv.FormatInt(c.profileId, 10),
  44689. })
  44690. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44691. }
  44692. // Do executes the "dfareporting.userRoles.update" call.
  44693. // Exactly one of *UserRole or error will be non-nil. Any non-2xx status
  44694. // code is an error. Response headers are in either
  44695. // *UserRole.ServerResponse.Header or (if a response was returned at
  44696. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44697. // to check whether the returned error was because
  44698. // http.StatusNotModified was returned.
  44699. func (c *UserRolesUpdateCall) Do(opts ...googleapi.CallOption) (*UserRole, error) {
  44700. gensupport.SetOptions(c.urlParams_, opts...)
  44701. res, err := c.doRequest("json")
  44702. if res != nil && res.StatusCode == http.StatusNotModified {
  44703. if res.Body != nil {
  44704. res.Body.Close()
  44705. }
  44706. return nil, &googleapi.Error{
  44707. Code: res.StatusCode,
  44708. Header: res.Header,
  44709. }
  44710. }
  44711. if err != nil {
  44712. return nil, err
  44713. }
  44714. defer googleapi.CloseBody(res)
  44715. if err := googleapi.CheckResponse(res); err != nil {
  44716. return nil, err
  44717. }
  44718. ret := &UserRole{
  44719. ServerResponse: googleapi.ServerResponse{
  44720. Header: res.Header,
  44721. HTTPStatusCode: res.StatusCode,
  44722. },
  44723. }
  44724. target := &ret
  44725. if err := gensupport.DecodeResponse(target, res); err != nil {
  44726. return nil, err
  44727. }
  44728. return ret, nil
  44729. // {
  44730. // "description": "Updates an existing user role.",
  44731. // "httpMethod": "PUT",
  44732. // "id": "dfareporting.userRoles.update",
  44733. // "parameterOrder": [
  44734. // "profileId"
  44735. // ],
  44736. // "parameters": {
  44737. // "profileId": {
  44738. // "description": "User profile ID associated with this request.",
  44739. // "format": "int64",
  44740. // "location": "path",
  44741. // "required": true,
  44742. // "type": "string"
  44743. // }
  44744. // },
  44745. // "path": "userprofiles/{profileId}/userRoles",
  44746. // "request": {
  44747. // "$ref": "UserRole"
  44748. // },
  44749. // "response": {
  44750. // "$ref": "UserRole"
  44751. // },
  44752. // "scopes": [
  44753. // "https://www.googleapis.com/auth/dfatrafficking"
  44754. // ]
  44755. // }
  44756. }
  44757. // method id "dfareporting.videoFormats.get":
  44758. type VideoFormatsGetCall struct {
  44759. s *Service
  44760. profileId int64
  44761. id int64
  44762. urlParams_ gensupport.URLParams
  44763. ifNoneMatch_ string
  44764. ctx_ context.Context
  44765. header_ http.Header
  44766. }
  44767. // Get: Gets one video format by ID.
  44768. func (r *VideoFormatsService) Get(profileId int64, id int64) *VideoFormatsGetCall {
  44769. c := &VideoFormatsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44770. c.profileId = profileId
  44771. c.id = id
  44772. return c
  44773. }
  44774. // Fields allows partial responses to be retrieved. See
  44775. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44776. // for more information.
  44777. func (c *VideoFormatsGetCall) Fields(s ...googleapi.Field) *VideoFormatsGetCall {
  44778. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44779. return c
  44780. }
  44781. // IfNoneMatch sets the optional parameter which makes the operation
  44782. // fail if the object's ETag matches the given value. This is useful for
  44783. // getting updates only after the object has changed since the last
  44784. // request. Use googleapi.IsNotModified to check whether the response
  44785. // error from Do is the result of In-None-Match.
  44786. func (c *VideoFormatsGetCall) IfNoneMatch(entityTag string) *VideoFormatsGetCall {
  44787. c.ifNoneMatch_ = entityTag
  44788. return c
  44789. }
  44790. // Context sets the context to be used in this call's Do method. Any
  44791. // pending HTTP request will be aborted if the provided context is
  44792. // canceled.
  44793. func (c *VideoFormatsGetCall) Context(ctx context.Context) *VideoFormatsGetCall {
  44794. c.ctx_ = ctx
  44795. return c
  44796. }
  44797. // Header returns an http.Header that can be modified by the caller to
  44798. // add HTTP headers to the request.
  44799. func (c *VideoFormatsGetCall) Header() http.Header {
  44800. if c.header_ == nil {
  44801. c.header_ = make(http.Header)
  44802. }
  44803. return c.header_
  44804. }
  44805. func (c *VideoFormatsGetCall) doRequest(alt string) (*http.Response, error) {
  44806. reqHeaders := make(http.Header)
  44807. for k, v := range c.header_ {
  44808. reqHeaders[k] = v
  44809. }
  44810. reqHeaders.Set("User-Agent", c.s.userAgent())
  44811. if c.ifNoneMatch_ != "" {
  44812. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44813. }
  44814. var body io.Reader = nil
  44815. c.urlParams_.Set("alt", alt)
  44816. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats/{id}")
  44817. urls += "?" + c.urlParams_.Encode()
  44818. req, _ := http.NewRequest("GET", urls, body)
  44819. req.Header = reqHeaders
  44820. googleapi.Expand(req.URL, map[string]string{
  44821. "profileId": strconv.FormatInt(c.profileId, 10),
  44822. "id": strconv.FormatInt(c.id, 10),
  44823. })
  44824. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44825. }
  44826. // Do executes the "dfareporting.videoFormats.get" call.
  44827. // Exactly one of *VideoFormat or error will be non-nil. Any non-2xx
  44828. // status code is an error. Response headers are in either
  44829. // *VideoFormat.ServerResponse.Header or (if a response was returned at
  44830. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  44831. // to check whether the returned error was because
  44832. // http.StatusNotModified was returned.
  44833. func (c *VideoFormatsGetCall) Do(opts ...googleapi.CallOption) (*VideoFormat, error) {
  44834. gensupport.SetOptions(c.urlParams_, opts...)
  44835. res, err := c.doRequest("json")
  44836. if res != nil && res.StatusCode == http.StatusNotModified {
  44837. if res.Body != nil {
  44838. res.Body.Close()
  44839. }
  44840. return nil, &googleapi.Error{
  44841. Code: res.StatusCode,
  44842. Header: res.Header,
  44843. }
  44844. }
  44845. if err != nil {
  44846. return nil, err
  44847. }
  44848. defer googleapi.CloseBody(res)
  44849. if err := googleapi.CheckResponse(res); err != nil {
  44850. return nil, err
  44851. }
  44852. ret := &VideoFormat{
  44853. ServerResponse: googleapi.ServerResponse{
  44854. Header: res.Header,
  44855. HTTPStatusCode: res.StatusCode,
  44856. },
  44857. }
  44858. target := &ret
  44859. if err := gensupport.DecodeResponse(target, res); err != nil {
  44860. return nil, err
  44861. }
  44862. return ret, nil
  44863. // {
  44864. // "description": "Gets one video format by ID.",
  44865. // "httpMethod": "GET",
  44866. // "id": "dfareporting.videoFormats.get",
  44867. // "parameterOrder": [
  44868. // "profileId",
  44869. // "id"
  44870. // ],
  44871. // "parameters": {
  44872. // "id": {
  44873. // "description": "Video format ID.",
  44874. // "format": "int32",
  44875. // "location": "path",
  44876. // "required": true,
  44877. // "type": "integer"
  44878. // },
  44879. // "profileId": {
  44880. // "description": "User profile ID associated with this request.",
  44881. // "format": "int64",
  44882. // "location": "path",
  44883. // "required": true,
  44884. // "type": "string"
  44885. // }
  44886. // },
  44887. // "path": "userprofiles/{profileId}/videoFormats/{id}",
  44888. // "response": {
  44889. // "$ref": "VideoFormat"
  44890. // },
  44891. // "scopes": [
  44892. // "https://www.googleapis.com/auth/dfatrafficking"
  44893. // ]
  44894. // }
  44895. }
  44896. // method id "dfareporting.videoFormats.list":
  44897. type VideoFormatsListCall struct {
  44898. s *Service
  44899. profileId int64
  44900. urlParams_ gensupport.URLParams
  44901. ifNoneMatch_ string
  44902. ctx_ context.Context
  44903. header_ http.Header
  44904. }
  44905. // List: Lists available video formats.
  44906. func (r *VideoFormatsService) List(profileId int64) *VideoFormatsListCall {
  44907. c := &VideoFormatsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  44908. c.profileId = profileId
  44909. return c
  44910. }
  44911. // Fields allows partial responses to be retrieved. See
  44912. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  44913. // for more information.
  44914. func (c *VideoFormatsListCall) Fields(s ...googleapi.Field) *VideoFormatsListCall {
  44915. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  44916. return c
  44917. }
  44918. // IfNoneMatch sets the optional parameter which makes the operation
  44919. // fail if the object's ETag matches the given value. This is useful for
  44920. // getting updates only after the object has changed since the last
  44921. // request. Use googleapi.IsNotModified to check whether the response
  44922. // error from Do is the result of In-None-Match.
  44923. func (c *VideoFormatsListCall) IfNoneMatch(entityTag string) *VideoFormatsListCall {
  44924. c.ifNoneMatch_ = entityTag
  44925. return c
  44926. }
  44927. // Context sets the context to be used in this call's Do method. Any
  44928. // pending HTTP request will be aborted if the provided context is
  44929. // canceled.
  44930. func (c *VideoFormatsListCall) Context(ctx context.Context) *VideoFormatsListCall {
  44931. c.ctx_ = ctx
  44932. return c
  44933. }
  44934. // Header returns an http.Header that can be modified by the caller to
  44935. // add HTTP headers to the request.
  44936. func (c *VideoFormatsListCall) Header() http.Header {
  44937. if c.header_ == nil {
  44938. c.header_ = make(http.Header)
  44939. }
  44940. return c.header_
  44941. }
  44942. func (c *VideoFormatsListCall) doRequest(alt string) (*http.Response, error) {
  44943. reqHeaders := make(http.Header)
  44944. for k, v := range c.header_ {
  44945. reqHeaders[k] = v
  44946. }
  44947. reqHeaders.Set("User-Agent", c.s.userAgent())
  44948. if c.ifNoneMatch_ != "" {
  44949. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  44950. }
  44951. var body io.Reader = nil
  44952. c.urlParams_.Set("alt", alt)
  44953. urls := googleapi.ResolveRelative(c.s.BasePath, "userprofiles/{profileId}/videoFormats")
  44954. urls += "?" + c.urlParams_.Encode()
  44955. req, _ := http.NewRequest("GET", urls, body)
  44956. req.Header = reqHeaders
  44957. googleapi.Expand(req.URL, map[string]string{
  44958. "profileId": strconv.FormatInt(c.profileId, 10),
  44959. })
  44960. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  44961. }
  44962. // Do executes the "dfareporting.videoFormats.list" call.
  44963. // Exactly one of *VideoFormatsListResponse or error will be non-nil.
  44964. // Any non-2xx status code is an error. Response headers are in either
  44965. // *VideoFormatsListResponse.ServerResponse.Header or (if a response was
  44966. // returned at all) in error.(*googleapi.Error).Header. Use
  44967. // googleapi.IsNotModified to check whether the returned error was
  44968. // because http.StatusNotModified was returned.
  44969. func (c *VideoFormatsListCall) Do(opts ...googleapi.CallOption) (*VideoFormatsListResponse, error) {
  44970. gensupport.SetOptions(c.urlParams_, opts...)
  44971. res, err := c.doRequest("json")
  44972. if res != nil && res.StatusCode == http.StatusNotModified {
  44973. if res.Body != nil {
  44974. res.Body.Close()
  44975. }
  44976. return nil, &googleapi.Error{
  44977. Code: res.StatusCode,
  44978. Header: res.Header,
  44979. }
  44980. }
  44981. if err != nil {
  44982. return nil, err
  44983. }
  44984. defer googleapi.CloseBody(res)
  44985. if err := googleapi.CheckResponse(res); err != nil {
  44986. return nil, err
  44987. }
  44988. ret := &VideoFormatsListResponse{
  44989. ServerResponse: googleapi.ServerResponse{
  44990. Header: res.Header,
  44991. HTTPStatusCode: res.StatusCode,
  44992. },
  44993. }
  44994. target := &ret
  44995. if err := gensupport.DecodeResponse(target, res); err != nil {
  44996. return nil, err
  44997. }
  44998. return ret, nil
  44999. // {
  45000. // "description": "Lists available video formats.",
  45001. // "httpMethod": "GET",
  45002. // "id": "dfareporting.videoFormats.list",
  45003. // "parameterOrder": [
  45004. // "profileId"
  45005. // ],
  45006. // "parameters": {
  45007. // "profileId": {
  45008. // "description": "User profile ID associated with this request.",
  45009. // "format": "int64",
  45010. // "location": "path",
  45011. // "required": true,
  45012. // "type": "string"
  45013. // }
  45014. // },
  45015. // "path": "userprofiles/{profileId}/videoFormats",
  45016. // "response": {
  45017. // "$ref": "VideoFormatsListResponse"
  45018. // },
  45019. // "scopes": [
  45020. // "https://www.googleapis.com/auth/dfatrafficking"
  45021. // ]
  45022. // }
  45023. }